From 1398ba1ea4a3b2222d05985136d54332accf9704 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Wed, 6 Sep 2023 10:26:42 -0400 Subject: [PATCH 01/14] Update pyproject.toml --- pyproject.toml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 54d20618..dc9e8e5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [tool.poetry] name = "HSSM" -version = "0.1.3" +version = "0.1.4" description = "" authors = [ - "Aisulu Omar ", - "Paul Xu ", "Alexander Fengler ", + "Paul Xu ", + "Aisulu Omar ", "Michael Frank ", ] readme = "README.md" @@ -28,11 +28,10 @@ huggingface-hub = "^0.15.1" onnxruntime = "^1.15.0" bambi = "^0.12.0" numpyro = "^0.12.1" -hddm-wfpt = {git = "https://github.com/brown-ccv/hddm-wfpt.git"} [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" -black = {extras = ["jupyter"], version = "^23.7.0"} +black = { extras = ["jupyter"], version = "^23.7.0" } mypy = "^1.4.1" pre-commit = "^2.20.0" jupyterlab = "^4.0.2" @@ -171,5 +170,11 @@ convention = "numpy" ignore_missing_imports = true [build-system] -requires = ["poetry-core>=1.4.0"] +requires = [ + "poetry-core>=1.4.0", + "setuptools", + "wheel", + "Cython>=0.29.32", + "numpy >= 1.23.4", +] build-backend = "poetry.core.masonry.api" From 474152576479d45fd123654ac76cfae5b7ab42e0 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Wed, 6 Sep 2023 10:35:39 -0400 Subject: [PATCH 02/14] add hddm-wfpt as part of the package --- src/hssm/likelihoods/blackbox.py | 9 +- src/hssm/likelihoods/hddm_wfpt/__init__.py | 4 + src/hssm/likelihoods/hddm_wfpt/cdfdif.c | 221 + src/hssm/likelihoods/hddm_wfpt/cdfdif.h | 1 + .../likelihoods/hddm_wfpt/cdfdif_wrapper.c | 11478 ++++++ .../likelihoods/hddm_wfpt/cdfdif_wrapper.pyx | 53 + src/hssm/likelihoods/hddm_wfpt/integrate.pxi | 206 + src/hssm/likelihoods/hddm_wfpt/pdf.pxi | 146 + src/hssm/likelihoods/hddm_wfpt/wfpt.cpp | 29592 ++++++++++++++++ src/hssm/likelihoods/hddm_wfpt/wfpt.pyx | 705 + 10 files changed, 42411 insertions(+), 4 deletions(-) create mode 100644 src/hssm/likelihoods/hddm_wfpt/__init__.py create mode 100644 src/hssm/likelihoods/hddm_wfpt/cdfdif.c create mode 100644 src/hssm/likelihoods/hddm_wfpt/cdfdif.h create mode 100644 src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c create mode 100644 src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx create mode 100644 src/hssm/likelihoods/hddm_wfpt/integrate.pxi create mode 100644 src/hssm/likelihoods/hddm_wfpt/pdf.pxi create mode 100644 src/hssm/likelihoods/hddm_wfpt/wfpt.cpp create mode 100644 src/hssm/likelihoods/hddm_wfpt/wfpt.pyx diff --git a/src/hssm/likelihoods/blackbox.py b/src/hssm/likelihoods/blackbox.py index 1712c1d7..c8c1a7ee 100644 --- a/src/hssm/likelihoods/blackbox.py +++ b/src/hssm/likelihoods/blackbox.py @@ -2,9 +2,10 @@ from __future__ import annotations -import hddm_wfpt import numpy as np +from .hddm_wfpt import wfpt + def hddm_to_hssm(func): """Make HDDM likelihood function compatible with HSSM.""" @@ -30,7 +31,7 @@ def logp_ddm_bbox(data: np.ndarray, v, a, z, t) -> np.ndarray: size = len(data) zeros = np.zeros(size, dtype=np.float64) - return hddm_wfpt.wfpt.wiener_logp_array( + return wfpt.wiener_logp_array( x=data, v=v, sv=zeros, @@ -49,7 +50,7 @@ def logp_ddm_sdv_bbox(data: np.ndarray, v, a, z, t, sv) -> np.ndarray: size = len(data) zeros = np.zeros(size, dtype=np.float64) - return hddm_wfpt.wfpt.wiener_logp_array( + return wfpt.wiener_logp_array( x=data, v=v, sv=sv, @@ -65,7 +66,7 @@ def logp_ddm_sdv_bbox(data: np.ndarray, v, a, z, t, sv) -> np.ndarray: @hddm_to_hssm def logp_full_ddm(data: np.ndarray, v, a, z, t, sv, sz, st): """Compute blackbox log-likelihoods for full_ddm models.""" - return hddm_wfpt.wfpt.wiener_logp_array( + return wfpt.wiener_logp_array( x=data, v=v, sv=sv, diff --git a/src/hssm/likelihoods/hddm_wfpt/__init__.py b/src/hssm/likelihoods/hddm_wfpt/__init__.py new file mode 100644 index 00000000..121a7990 --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/__init__.py @@ -0,0 +1,4 @@ +"""The HDDM wfpt likelihood function.""" + + +import wfpt # noqa: F401 diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif.c b/src/hssm/likelihoods/hddm_wfpt/cdfdif.c new file mode 100644 index 00000000..04ac2467 --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/cdfdif.c @@ -0,0 +1,221 @@ +/* + Name: cdfdif.c + Copyright: Academic use + Author: Joachim Vandekerckhove + Department of Psychology + Katholieke Universiteit Leuven + Belgium + email: joachim.vandekerckhove@psy.kuleuven.be + Date: The generating algorithm was written on 09/01/06 + Description: Computes Cumulative Distribution Function for the Diffusion + model with random trial to trial mean drift (normal), starting + point and non-decision (ter) time (both rectangular). + Uses 6 quadrature points for drift and 6 for the others. + Based on methods described in: + Tuerlinckx, F. (2004). The efficient computation of the + cumulative distribution and probability density functions + in the diffusion model, Behavior Research Methods, + Instruments, & Computers, 36 (4), 702-716. + + */ + +#include +#include +//#include +//#include + +#define PI 3.1415926535897932384626433832795028841971693993751 + + +//double cdfdif(double t, int x, double *par, double *prob); +//void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]); +//double fabs(double a) { return a>0 ? a : -a; } + +/* void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) */ +/* { */ +/* double *p, *nwp, *x, *t, *y, *pr, nonzero = 1e-10; */ +/* int nt,i; */ + +/* t = mxGetPr(prhs[0]); */ +/* x = mxGetPr(prhs[1]); */ +/* p = mxGetPr(prhs[2]); */ +/* nt = mxGetN(prhs[0]); */ + +/* nwp = malloc(7*sizeof(double)); */ +/* for(i=0;i<7;i++) nwp[i]=p[i]; */ + +/* plhs[0] = mxCreateDoubleMatrix(1,nt, mxREAL); */ +/* plhs[1] = mxCreateDoubleMatrix(1,1, mxREAL); */ +/* y = mxGetPr(plhs[0]); */ +/* pr = mxGetPr(plhs[1]); */ + +/* if (nwp[2]epsilon) /* test for gk(m) being close to zero */ + { + sum_nu+=(exp(-200*gz[i]*gk[m])-1)/(exp(-200*a*gk[m])-1)*w_gh[m]; + } + else + { + sum_nu+=gz[i]/a*w_gh[m]; + } + } + sum_z+=sum_nu*w_g[i]/2; + } + *prob=sum_z; + /* end of prob */ + + if (t-Ter+st/2>min_RT)/* is t larger than lower boundary Ter distribution? */ + { + upper_t = tTer+st/2) /* is t larger than upper boundary Ter distribution? */ + { + sum_hist[0] = 0; + sum_hist[1] = 0; + sum_hist[2] = 0; + for (v=0;v0)) + break; + } + Fnew=(p0*(1-x)+p1*x)-sum_hist[2]*4*PI/(a2*sZ*st); + /* cumulative distribution function for t and x */ + } + else if (t<=Ter+st/2) /* is t lower than upper boundary Ter distribution? */ + { + sum_nu=0; + for (m=0;mepsilon) + { + sum_z=0; + for (i=0;i0)) + break; + } + sum_z+=.5*w_g[i]*(ser-4*sum_hist[2])*(PI/100)/ + (a2*st)*exp((2*x-1)*zzz*gk[m]*100); + } + } + else + { + sum_hist[0] = 0; + sum_hist[1] = 0; + sum_hist[2] = 0; + su=-(Z_U*Z_U)/(12*a2)+(Z_U*Z_U*Z_U)/ + (12*a*a2)-(Z_U*Z_U*Z_U*Z_U)/(48*a2*a2); + sl=-(Z_L*Z_L)/(12*a2)+(Z_L*Z_L*Z_L)/ + (12*a*a2)-(Z_L*Z_L*Z_L*Z_L)/(48*a2*a2); + for (v=1;v0)) + break; + } + sum_z=400*a2*a*(sl-su-sum_hist[2])/(st*sZ); + } + sum_nu+=sum_z*w_gh[m]; + } + Fnew=(p0*(1-x)+p1*x)-sum_nu; + } + } + else if (t-Ter+st/2<=min_RT) /* is t lower than lower boundary Ter distr? */ + { + Fnew=0; + } + + Fnew = Fnew>delta ? Fnew : 0; + + return Fnew; +} diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif.h b/src/hssm/likelihoods/hddm_wfpt/cdfdif.h new file mode 100644 index 00000000..6c5b1e61 --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/cdfdif.h @@ -0,0 +1 @@ +double cdfdif(double t, int x, double *par, double *prob); diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c new file mode 100644 index 00000000..07bff919 --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c @@ -0,0 +1,11478 @@ +/* Generated by Cython 3.0.0 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "hddm_wfpt/cdfdif.h" + ], + "include_dirs": [ + "hddm_wfpt" + ], + "name": "cdfdif_wrapper", + "sources": [ + "hddm_wfpt/cdfdif_wrapper.pyx", + "hddm_wfpt/cdfdif.c" + ] + }, + "module_name": "cdfdif_wrapper" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#define CYTHON_ABI "3_0_0" +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030000F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject *co=NULL, *result=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(p))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; + if (!(empty = PyTuple_New(0))) goto end; + result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); + end: + Py_XDECREF((PyObject*) co); + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE(obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#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)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__cdfdif_wrapper +#define __PYX_HAVE_API__cdfdif_wrapper +/* Early includes */ +#include +#include + + /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */ + +#include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" +#include "numpy/ufuncobject.h" +#include "cdfdif.h" +#include "math.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else // Py < 3.12 + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "hddm_wfpt/cdfdif_wrapper.pyx", + "__init__.cython-30.pxd", + "type.pxd", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* BufferFormatStructs.proto */ +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +/* #### Code section: numeric_typedefs ### */ + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":730 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":737 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":744 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":754 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":758 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":765 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +/* #### Code section: complex_type_declarations ### */ +/* Declarations.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":769 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* BufferGetAndValidate.proto */ +#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ + ((obj == Py_None || obj == NULL) ?\ + (__Pyx_ZeroBuffer(buf), 0) :\ + __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) +static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static void __Pyx_ZeroBuffer(Py_buffer* buf); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +/* AssertionsEnabled.proto */ +#define __Pyx_init_assertions_enabled() +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define __pyx_assertions_enabled() (1) +#elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API) + #define __pyx_assertions_enabled() (!Py_OptimizeFlag) +#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6 + static int __pyx_assertions_enabled_flag; + #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) + #undef __Pyx_init_assertions_enabled + static void __Pyx_init_assertions_enabled(void) { + __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level; + } +#else + #define __pyx_assertions_enabled() (!Py_OptimizeFlag) +#endif + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_0 +#define __PYX_HAVE_RT_ImportType_proto_3_0_0 +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#include +#endif +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_3_0_0 { + __Pyx_ImportType_CheckSize_Error_3_0_0 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_0 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_0 = 2 +}; +static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 check_size); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ +static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/ + +/* Module declarations from "libc.string" */ + +/* Module declarations from "libc.stdio" */ + +/* Module declarations from "__builtin__" */ + +/* Module declarations from "cpython.type" */ + +/* Module declarations from "cpython" */ + +/* Module declarations from "cpython.object" */ + +/* Module declarations from "cpython.ref" */ + +/* Module declarations from "numpy" */ + +/* Module declarations from "numpy" */ + +/* Module declarations from "cdfdif_wrapper" */ +static CYTHON_INLINE double __pyx_f_14cdfdif_wrapper_add_outlier_cdf(double, double, double, double); /*proto*/ +static CYTHON_INLINE int __pyx_f_14cdfdif_wrapper_p_outlier_in_range(double); /*proto*/ +/* #### Code section: typeinfo ### */ +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "cdfdif_wrapper" +extern int __pyx_module_is_main_cdfdif_wrapper; +int __pyx_module_is_main_cdfdif_wrapper = 0; + +/* Implementation of "cdfdif_wrapper" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_AssertionError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ImportError; +/* #### Code section: string_decls ### */ +static const char __pyx_k_a[] = "a"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_y[] = "y"; +static const char __pyx_k_z[] = "z"; +static const char __pyx_k__6[] = "*"; +static const char __pyx_k__8[] = "?"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_st[] = "st"; +static const char __pyx_k_sv[] = "sv"; +static const char __pyx_k_sz[] = "sz"; +static const char __pyx_k_abs[] = "abs"; +static const char __pyx_k_max[] = "max"; +static const char __pyx_k_epsi[] = "epsi"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_sign[] = "sign"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_empty[] = "empty"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_double[] = "double"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_params[] = "params"; +static const char __pyx_k_boundary[] = "boundary"; +static const char __pyx_k_p_outlier[] = "p_outlier"; +static const char __pyx_k_w_outlier[] = "w_outlier"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_p_boundary[] = "p_boundary"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_AssertionError[] = "AssertionError"; +static const char __pyx_k_cdfdif_wrapper[] = "cdfdif_wrapper"; +static const char __pyx_k_dmat_cdf_array[] = "dmat_cdf_array"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_hddm_wfpt_cdfdif_wrapper_pyx[] = "hddm_wfpt/cdfdif_wrapper.pyx"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_1_2_w_outlier_must_be_smaller_th[] = "1. / (2*w_outlier) must be smaller than RT"; +static const char __pyx_k_at_least_one_of_the_parameters_i[] = "at least one of the parameters is out of the support"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyTypeObject *__pyx_ptype_7cpython_4type_type; + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyTypeObject *__pyx_ptype_5numpy_dtype; + PyTypeObject *__pyx_ptype_5numpy_flatiter; + PyTypeObject *__pyx_ptype_5numpy_broadcast; + PyTypeObject *__pyx_ptype_5numpy_ndarray; + PyTypeObject *__pyx_ptype_5numpy_generic; + PyTypeObject *__pyx_ptype_5numpy_number; + PyTypeObject *__pyx_ptype_5numpy_integer; + PyTypeObject *__pyx_ptype_5numpy_signedinteger; + PyTypeObject *__pyx_ptype_5numpy_unsignedinteger; + PyTypeObject *__pyx_ptype_5numpy_inexact; + PyTypeObject *__pyx_ptype_5numpy_floating; + PyTypeObject *__pyx_ptype_5numpy_complexfloating; + PyTypeObject *__pyx_ptype_5numpy_flexible; + PyTypeObject *__pyx_ptype_5numpy_character; + PyTypeObject *__pyx_ptype_5numpy_ufunc; + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_kp_u_1_2_w_outlier_must_be_smaller_th; + PyObject *__pyx_n_s_AssertionError; + PyObject *__pyx_n_s_ImportError; + PyObject *__pyx_n_s_ValueError; + PyObject *__pyx_n_s__6; + PyObject *__pyx_n_s__8; + PyObject *__pyx_n_s_a; + PyObject *__pyx_n_s_abs; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_kp_u_at_least_one_of_the_parameters_i; + PyObject *__pyx_n_s_boundary; + PyObject *__pyx_n_s_cdfdif_wrapper; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_dmat_cdf_array; + PyObject *__pyx_n_s_double; + PyObject *__pyx_n_s_dtype; + PyObject *__pyx_n_s_empty; + PyObject *__pyx_n_s_epsi; + PyObject *__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx; + PyObject *__pyx_n_s_i; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_max; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_np; + PyObject *__pyx_n_s_numpy; + PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; + PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; + PyObject *__pyx_n_s_p_boundary; + PyObject *__pyx_n_s_p_outlier; + PyObject *__pyx_n_s_params; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_sign; + PyObject *__pyx_n_s_size; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_st; + PyObject *__pyx_n_s_sv; + PyObject *__pyx_n_s_sz; + PyObject *__pyx_n_s_t; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_v; + PyObject *__pyx_n_s_w_outlier; + PyObject *__pyx_n_s_x; + PyObject *__pyx_n_s_y; + PyObject *__pyx_n_s_z; + PyObject *__pyx_tuple_; + PyObject *__pyx_tuple__2; + PyObject *__pyx_tuple__4; + PyObject *__pyx_tuple__5; + PyObject *__pyx_tuple__7; + PyObject *__pyx_codeobj__3; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc); + Py_CLEAR(clear_module_state->__pyx_kp_u_1_2_w_outlier_must_be_smaller_th); + Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); + Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); + Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); + Py_CLEAR(clear_module_state->__pyx_n_s__6); + Py_CLEAR(clear_module_state->__pyx_n_s__8); + Py_CLEAR(clear_module_state->__pyx_n_s_a); + Py_CLEAR(clear_module_state->__pyx_n_s_abs); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_kp_u_at_least_one_of_the_parameters_i); + Py_CLEAR(clear_module_state->__pyx_n_s_boundary); + Py_CLEAR(clear_module_state->__pyx_n_s_cdfdif_wrapper); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_dmat_cdf_array); + Py_CLEAR(clear_module_state->__pyx_n_s_double); + Py_CLEAR(clear_module_state->__pyx_n_s_dtype); + Py_CLEAR(clear_module_state->__pyx_n_s_empty); + Py_CLEAR(clear_module_state->__pyx_n_s_epsi); + Py_CLEAR(clear_module_state->__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx); + Py_CLEAR(clear_module_state->__pyx_n_s_i); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_max); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_np); + Py_CLEAR(clear_module_state->__pyx_n_s_numpy); + Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); + Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); + Py_CLEAR(clear_module_state->__pyx_n_s_p_boundary); + Py_CLEAR(clear_module_state->__pyx_n_s_p_outlier); + Py_CLEAR(clear_module_state->__pyx_n_s_params); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_sign); + Py_CLEAR(clear_module_state->__pyx_n_s_size); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_st); + Py_CLEAR(clear_module_state->__pyx_n_s_sv); + Py_CLEAR(clear_module_state->__pyx_n_s_sz); + Py_CLEAR(clear_module_state->__pyx_n_s_t); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_v); + Py_CLEAR(clear_module_state->__pyx_n_s_w_outlier); + Py_CLEAR(clear_module_state->__pyx_n_s_x); + Py_CLEAR(clear_module_state->__pyx_n_s_y); + Py_CLEAR(clear_module_state->__pyx_n_s_z); + Py_CLEAR(clear_module_state->__pyx_tuple_); + Py_CLEAR(clear_module_state->__pyx_tuple__2); + Py_CLEAR(clear_module_state->__pyx_tuple__4); + Py_CLEAR(clear_module_state->__pyx_tuple__5); + Py_CLEAR(clear_module_state->__pyx_tuple__7); + Py_CLEAR(clear_module_state->__pyx_codeobj__3); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc); + Py_VISIT(traverse_module_state->__pyx_kp_u_1_2_w_outlier_must_be_smaller_th); + Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); + Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); + Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); + Py_VISIT(traverse_module_state->__pyx_n_s__6); + Py_VISIT(traverse_module_state->__pyx_n_s__8); + Py_VISIT(traverse_module_state->__pyx_n_s_a); + Py_VISIT(traverse_module_state->__pyx_n_s_abs); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_kp_u_at_least_one_of_the_parameters_i); + Py_VISIT(traverse_module_state->__pyx_n_s_boundary); + Py_VISIT(traverse_module_state->__pyx_n_s_cdfdif_wrapper); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_dmat_cdf_array); + Py_VISIT(traverse_module_state->__pyx_n_s_double); + Py_VISIT(traverse_module_state->__pyx_n_s_dtype); + Py_VISIT(traverse_module_state->__pyx_n_s_empty); + Py_VISIT(traverse_module_state->__pyx_n_s_epsi); + Py_VISIT(traverse_module_state->__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx); + Py_VISIT(traverse_module_state->__pyx_n_s_i); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_max); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_np); + Py_VISIT(traverse_module_state->__pyx_n_s_numpy); + Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); + Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); + Py_VISIT(traverse_module_state->__pyx_n_s_p_boundary); + Py_VISIT(traverse_module_state->__pyx_n_s_p_outlier); + Py_VISIT(traverse_module_state->__pyx_n_s_params); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_sign); + Py_VISIT(traverse_module_state->__pyx_n_s_size); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_st); + Py_VISIT(traverse_module_state->__pyx_n_s_sv); + Py_VISIT(traverse_module_state->__pyx_n_s_sz); + Py_VISIT(traverse_module_state->__pyx_n_s_t); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_v); + Py_VISIT(traverse_module_state->__pyx_n_s_w_outlier); + Py_VISIT(traverse_module_state->__pyx_n_s_x); + Py_VISIT(traverse_module_state->__pyx_n_s_y); + Py_VISIT(traverse_module_state->__pyx_n_s_z); + Py_VISIT(traverse_module_state->__pyx_tuple_); + Py_VISIT(traverse_module_state->__pyx_tuple__2); + Py_VISIT(traverse_module_state->__pyx_tuple__4); + Py_VISIT(traverse_module_state->__pyx_tuple__5); + Py_VISIT(traverse_module_state->__pyx_tuple__7); + Py_VISIT(traverse_module_state->__pyx_codeobj__3); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype +#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter +#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast +#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray +#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic +#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number +#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer +#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger +#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger +#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact +#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating +#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating +#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible +#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character +#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_kp_u_1_2_w_outlier_must_be_smaller_th __pyx_mstate_global->__pyx_kp_u_1_2_w_outlier_must_be_smaller_th +#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError +#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError +#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError +#define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 +#define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8 +#define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a +#define __pyx_n_s_abs __pyx_mstate_global->__pyx_n_s_abs +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_kp_u_at_least_one_of_the_parameters_i __pyx_mstate_global->__pyx_kp_u_at_least_one_of_the_parameters_i +#define __pyx_n_s_boundary __pyx_mstate_global->__pyx_n_s_boundary +#define __pyx_n_s_cdfdif_wrapper __pyx_mstate_global->__pyx_n_s_cdfdif_wrapper +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_dmat_cdf_array __pyx_mstate_global->__pyx_n_s_dmat_cdf_array +#define __pyx_n_s_double __pyx_mstate_global->__pyx_n_s_double +#define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype +#define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty +#define __pyx_n_s_epsi __pyx_mstate_global->__pyx_n_s_epsi +#define __pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx __pyx_mstate_global->__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx +#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np +#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy +#define __pyx_kp_u_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy_core_multiarray_failed_to +#define __pyx_kp_u_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_u_numpy_core_umath_failed_to_impor +#define __pyx_n_s_p_boundary __pyx_mstate_global->__pyx_n_s_p_boundary +#define __pyx_n_s_p_outlier __pyx_mstate_global->__pyx_n_s_p_outlier +#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_sign __pyx_mstate_global->__pyx_n_s_sign +#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st +#define __pyx_n_s_sv __pyx_mstate_global->__pyx_n_s_sv +#define __pyx_n_s_sz __pyx_mstate_global->__pyx_n_s_sz +#define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v +#define __pyx_n_s_w_outlier __pyx_mstate_global->__pyx_n_s_w_outlier +#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x +#define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y +#define __pyx_n_s_z __pyx_mstate_global->__pyx_n_s_z +#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ +#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 +#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 +#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 +#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 +#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 +/* #### Code section: module_code ### */ + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + * + * @property + * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { + PyObject *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("base", __pyx_f[1], 245, 1, __PYX_ERR(1, 245, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248 + * """Returns a borrowed reference to the object owning the data/memory. + * """ + * return PyArray_BASE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(248,1,__PYX_ERR(1, 248, __pyx_L1_error)) + __pyx_r = PyArray_BASE(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + * + * @property + * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.base.base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + +static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) { + PyArray_Descr *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyArray_Descr *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("descr", 0); + __Pyx_TraceCall("descr", __pyx_f[1], 251, 0, __PYX_ERR(1, 251, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254 + * """Returns an owned reference to the dtype of the array. + * """ + * return PyArray_DESCR(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error)) + __Pyx_XDECREF((PyObject *)__pyx_r); + __pyx_t_1 = PyArray_DESCR(__pyx_v_self); + __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1)); + __pyx_r = ((PyArray_Descr *)__pyx_t_1); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.ndarray.descr.descr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + * + * @property + * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + +static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { + int __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("ndim", __pyx_f[1], 257, 1, __PYX_ERR(1, 257, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260 + * """Returns the number of dimensions in the array. + * """ + * return PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(260,1,__PYX_ERR(1, 260, __pyx_L1_error)) + __pyx_r = PyArray_NDIM(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + * + * @property + * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.ndim.ndim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + * + * @property + * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { + npy_intp *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("shape", __pyx_f[1], 263, 1, __PYX_ERR(1, 263, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268 + * Can return NULL for 0-dimensional arrays. + * """ + * return PyArray_DIMS(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(268,1,__PYX_ERR(1, 268, __pyx_L1_error)) + __pyx_r = PyArray_DIMS(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + * + * @property + * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.shape.shape", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + * + * @property + * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { + npy_intp *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("strides", __pyx_f[1], 271, 1, __PYX_ERR(1, 271, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275 + * The number of elements matches the number of dimensions of the array (ndim). + * """ + * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(275,1,__PYX_ERR(1, 275, __pyx_L1_error)) + __pyx_r = PyArray_STRIDES(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + * + * @property + * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.strides.strides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + * + * @property + * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { + npy_intp __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("size", __pyx_f[1], 278, 1, __PYX_ERR(1, 278, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281 + * """Returns the total size (in number of elements) of the array. + * """ + * return PyArray_SIZE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(281,1,__PYX_ERR(1, 281, __pyx_L1_error)) + __pyx_r = PyArray_SIZE(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + * + * @property + * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.size.size", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + * + * @property + * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { + char *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("data", __pyx_f[1], 284, 1, __PYX_ERR(1, 284, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290 + * of `PyArray_DATA()` instead, which returns a 'void*'. + * """ + * return PyArray_BYTES(self) # <<<<<<<<<<<<<< + * + * ctypedef unsigned char npy_bool + */ + __Pyx_TraceLine(290,1,__PYX_ERR(1, 290, __pyx_L1_error)) + __pyx_r = PyArray_BYTES(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + * + * @property + * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.data.data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[1], 773, 0, __PYX_ERR(1, 773, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[1], 776, 0, __PYX_ERR(1, 776, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[1], 779, 0, __PYX_ERR(1, 779, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __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(1, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +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) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[1], 782, 0, __PYX_ERR(1, 782, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __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(1, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +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) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[1], 785, 0, __PYX_ERR(1, 785, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + */ + __Pyx_TraceLine(786,0,__PYX_ERR(1, 786, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __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(1, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[1], 788, 0, __PYX_ERR(1, 788, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __Pyx_TraceLine(789,0,__PYX_ERR(1, 789, __pyx_L1_error)) + __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); + if (__pyx_t_1) { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":790 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_TraceLine(790,0,__PYX_ERR(1, 790, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(792,0,__PYX_ERR(1, 792, __pyx_L1_error)) + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_array_base", 0); + __Pyx_TraceCall("set_array_base", __pyx_f[1], 967, 0, __PYX_ERR(1, 967, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 + * + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< + * PyArray_SetBaseObject(arr, base) + * + */ + __Pyx_TraceLine(968,0,__PYX_ERR(1, 968, __pyx_L1_error)) + Py_INCREF(__pyx_v_base); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __Pyx_TraceLine(969,0,__PYX_ERR(1, 969, __pyx_L1_error)) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_v_base; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_array_base", 0); + __Pyx_TraceCall("get_array_base", __pyx_f[1], 971, 0, __PYX_ERR(1, 971, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 + * + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< + * if base is NULL: + * return None + */ + __Pyx_TraceLine(972,0,__PYX_ERR(1, 972, __pyx_L1_error)) + __pyx_v_base = PyArray_BASE(__pyx_v_arr); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + __Pyx_TraceLine(973,0,__PYX_ERR(1, 973, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_base == NULL); + if (__pyx_t_1) { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 + * base = PyArray_BASE(arr) + * if base is NULL: + * return None # <<<<<<<<<<<<<< + * return base + * + */ + __Pyx_TraceLine(974,0,__PYX_ERR(1, 974, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 + * if base is NULL: + * return None + * return base # <<<<<<<<<<<<<< + * + * # Versions of the import_* functions which are more suitable for + */ + __Pyx_TraceLine(975,0,__PYX_ERR(1, 975, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_array", 0); + __Pyx_TraceCall("import_array", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __Pyx_TraceLine(980,0,__PYX_ERR(1, 980, __pyx_L1_error)) + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 + * cdef inline int import_array() except -1: + * try: + * __pyx_import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L3_error)) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 + * try: + * __pyx_import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L5_except_error)) + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 982, __pyx_L5_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L5_except_error)) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 983, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 983, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_umath", 0); + __Pyx_TraceCall("import_umath", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_TraceLine(986,0,__PYX_ERR(1, 986, __pyx_L1_error)) + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L3_error)) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L5_except_error)) + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L5_except_error)) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_ufunc", 0); + __Pyx_TraceCall("import_ufunc", __pyx_f[1], 991, 0, __PYX_ERR(1, 991, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_TraceLine(992,0,__PYX_ERR(1, 992, __pyx_L1_error)) + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L3_error)) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __Pyx_TraceLine(994,0,__PYX_ERR(1, 994, __pyx_L5_except_error)) + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L5_except_error)) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + __Pyx_TraceCall("is_timedelta64_object", __pyx_f[1], 998, 0, __PYX_ERR(1, 998, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1010 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error)) + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + __Pyx_TraceCall("is_datetime64_object", __pyx_f[1], 1013, 0, __PYX_ERR(1, 1013, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1025 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error)) + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("get_datetime64_value", __pyx_f[1], 1028, 1, __PYX_ERR(1, 1028, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1035 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(1035,1,__PYX_ERR(1, 1035, __pyx_L1_error)) + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("get_timedelta64_value", __pyx_f[1], 1038, 1, __PYX_ERR(1, 1038, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1042 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(1042,1,__PYX_ERR(1, 1042, __pyx_L1_error)) + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("get_datetime64_unit", __pyx_f[1], 1045, 1, __PYX_ERR(1, 1045, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1049 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __Pyx_TraceLine(1049,1,__PYX_ERR(1, 1049, __pyx_L1_error)) + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = (NPY_DATETIMEUNIT) 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "cdfdif_wrapper.pyx":11 + * double fabs(double) + * + * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< + * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier + * + */ + +static CYTHON_INLINE double __pyx_f_14cdfdif_wrapper_add_outlier_cdf(double __pyx_v_y, double __pyx_v_x, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + double __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("add_outlier_cdf", 0); + __Pyx_TraceCall("add_outlier_cdf", __pyx_f[0], 11, 0, __PYX_ERR(0, 11, __pyx_L1_error)); + + /* "cdfdif_wrapper.pyx":12 + * + * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): + * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier # <<<<<<<<<<<<<< + * + * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) + */ + __Pyx_TraceLine(12,0,__PYX_ERR(0, 12, __pyx_L1_error)) + __pyx_t_1 = (2.0 * __pyx_v_w_outlier); + if (unlikely(__pyx_t_1 == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 12, __pyx_L1_error) + } + __pyx_r = ((__pyx_v_y * (1.0 - __pyx_v_p_outlier)) + (((__pyx_v_x + (1. / __pyx_t_1)) * __pyx_v_w_outlier) * __pyx_v_p_outlier)); + goto __pyx_L0; + + /* "cdfdif_wrapper.pyx":11 + * double fabs(double) + * + * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< + * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("cdfdif_wrapper.add_outlier_cdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cdfdif_wrapper.pyx":14 + * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier + * + * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< + * + * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, + */ + +static CYTHON_INLINE int __pyx_f_14cdfdif_wrapper_p_outlier_in_range(double __pyx_v_p_outlier) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("p_outlier_in_range", 0); + __Pyx_TraceCall("p_outlier_in_range", __pyx_f[0], 14, 0, __PYX_ERR(0, 14, __pyx_L1_error)); + __pyx_r = ((__pyx_v_p_outlier >= 0.0) & (__pyx_v_p_outlier <= 1.0)); + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("cdfdif_wrapper.p_outlier_in_range", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cdfdif_wrapper.pyx":16 + * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) + * + * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< + * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_14cdfdif_wrapper_1dmat_cdf_array = {"dmat_cdf_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + double __pyx_v_v; + double __pyx_v_sv; + double __pyx_v_a; + double __pyx_v_z; + double __pyx_v_sz; + double __pyx_v_t; + double __pyx_v_st; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dmat_cdf_array (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 1); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 2); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 3); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 4); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 5); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 6); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 7); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 8); __PYX_ERR(0, 16, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 9); __PYX_ERR(0, 16, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dmat_cdf_array") < 0)) __PYX_ERR(0, 16, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 10)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_v = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 16, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cdfdif_wrapper.dmat_cdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_r = __pyx_pf_14cdfdif_wrapper_dmat_cdf_array(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + Py_ssize_t __pyx_v_size; + PyArrayObject *__pyx_v_y = 0; + int __pyx_v_boundary; + double __pyx_v_p_boundary; + double __pyx_v_params[7]; + double __pyx_v_epsi; + Py_ssize_t __pyx_v_i; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + double __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + npy_intp *__pyx_t_11; + PyArrayObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__3) + __Pyx_RefNannySetupContext("dmat_cdf_array", 0); + __Pyx_TraceCall("dmat_cdf_array", __pyx_f[0], 16, 0, __PYX_ERR(0, 16, __pyx_L1_error)); + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 16, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + + /* "cdfdif_wrapper.pyx":20 + * + * #check arguments + * if p_outlier > 0: # <<<<<<<<<<<<<< + * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') + * + */ + __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_p_outlier > 0.0); + if (__pyx_t_1) { + + /* "cdfdif_wrapper.pyx":21 + * #check arguments + * if p_outlier > 0: + * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') # <<<<<<<<<<<<<< + * + * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ + */ + __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error)) + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_abs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_x)}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_8 = (2.0 * __pyx_v_w_outlier); + if (unlikely(__pyx_t_8 == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 21, __pyx_L1_error) + } + __pyx_t_4 = PyFloat_FromDouble((1. / __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 21, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 21, __pyx_L1_error) + #endif + + /* "cdfdif_wrapper.pyx":20 + * + * #check arguments + * if p_outlier > 0: # <<<<<<<<<<<<<< + * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') + * + */ + } + + /* "cdfdif_wrapper.pyx":23 + * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') + * + * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< + * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError("at least one of the parameters is out of the support") + */ + __Pyx_TraceLine(23,0,__PYX_ERR(0, 23, __pyx_L1_error)) + __pyx_t_9 = (__pyx_v_sv < 0.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_a <= 0.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_z < 0.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_z > 1.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_sz < 0.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_sz > 1.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = ((__pyx_v_z + (__pyx_v_sz / 2.)) > 1.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + + /* "cdfdif_wrapper.pyx":24 + * + * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ + * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * raise ValueError("at least one of the parameters is out of the support") + * + */ + __Pyx_TraceLine(24,0,__PYX_ERR(0, 24, __pyx_L1_error)) + __pyx_t_9 = ((__pyx_v_z - (__pyx_v_sz / 2.)) < 0.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = ((__pyx_v_t - (__pyx_v_st / 2.)) < 0.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_t < 0.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_st < 0.0); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_9 = __pyx_f_14cdfdif_wrapper_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_9 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_10 = (!__pyx_t_9); + __pyx_t_1 = __pyx_t_10; + __pyx_L5_bool_binop_done:; + + /* "cdfdif_wrapper.pyx":23 + * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') + * + * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< + * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError("at least one of the parameters is out of the support") + */ + __Pyx_TraceLine(23,0,__PYX_ERR(0, 23, __pyx_L1_error)) + if (unlikely(__pyx_t_1)) { + + /* "cdfdif_wrapper.pyx":25 + * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ + * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError("at least one of the parameters is out of the support") # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(25,0,__PYX_ERR(0, 25, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 25, __pyx_L1_error) + + /* "cdfdif_wrapper.pyx":23 + * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') + * + * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< + * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError("at least one of the parameters is out of the support") + */ + } + + /* "cdfdif_wrapper.pyx":28 + * + * + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim=1] y = np.empty(size, dtype=np.double) + * cdef int boundary + */ + __Pyx_TraceLine(28,0,__PYX_ERR(0, 28, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_v_size = (__pyx_t_11[0]); + + /* "cdfdif_wrapper.pyx":29 + * + * cdef Py_ssize_t size = x.shape[0] + * cdef np.ndarray[double, ndim=1] y = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< + * cdef int boundary + * cdef double p_boundary + */ + __Pyx_TraceLine(29,0,__PYX_ERR(0, 29, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_12 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 29, __pyx_L1_error) + } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_12 = 0; + __pyx_v_y = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "cdfdif_wrapper.pyx":33 + * cdef double p_boundary + * cdef double params[7] + * cdef double epsi = 1e-10 # <<<<<<<<<<<<<< + * + * #transform parameters + */ + __Pyx_TraceLine(33,0,__PYX_ERR(0, 33, __pyx_L1_error)) + __pyx_v_epsi = 1e-10; + + /* "cdfdif_wrapper.pyx":36 + * + * #transform parameters + * params[0] = a/10. # <<<<<<<<<<<<<< + * params[1] = t + * params[2] = sv/10. + epsi + */ + __Pyx_TraceLine(36,0,__PYX_ERR(0, 36, __pyx_L1_error)) + (__pyx_v_params[0]) = (__pyx_v_a / 10.); + + /* "cdfdif_wrapper.pyx":37 + * #transform parameters + * params[0] = a/10. + * params[1] = t # <<<<<<<<<<<<<< + * params[2] = sv/10. + epsi + * params[3] = z*(a/10.) + */ + __Pyx_TraceLine(37,0,__PYX_ERR(0, 37, __pyx_L1_error)) + (__pyx_v_params[1]) = __pyx_v_t; + + /* "cdfdif_wrapper.pyx":38 + * params[0] = a/10. + * params[1] = t + * params[2] = sv/10. + epsi # <<<<<<<<<<<<<< + * params[3] = z*(a/10.) + * params[4] = sz*(a/10.) + epsi + */ + __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error)) + (__pyx_v_params[2]) = ((__pyx_v_sv / 10.) + __pyx_v_epsi); + + /* "cdfdif_wrapper.pyx":39 + * params[1] = t + * params[2] = sv/10. + epsi + * params[3] = z*(a/10.) # <<<<<<<<<<<<<< + * params[4] = sz*(a/10.) + epsi + * params[5] = st + epsi + */ + __Pyx_TraceLine(39,0,__PYX_ERR(0, 39, __pyx_L1_error)) + (__pyx_v_params[3]) = (__pyx_v_z * (__pyx_v_a / 10.)); + + /* "cdfdif_wrapper.pyx":40 + * params[2] = sv/10. + epsi + * params[3] = z*(a/10.) + * params[4] = sz*(a/10.) + epsi # <<<<<<<<<<<<<< + * params[5] = st + epsi + * params[6] = v/10. + */ + __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error)) + (__pyx_v_params[4]) = ((__pyx_v_sz * (__pyx_v_a / 10.)) + __pyx_v_epsi); + + /* "cdfdif_wrapper.pyx":41 + * params[3] = z*(a/10.) + * params[4] = sz*(a/10.) + epsi + * params[5] = st + epsi # <<<<<<<<<<<<<< + * params[6] = v/10. + * + */ + __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error)) + (__pyx_v_params[5]) = (__pyx_v_st + __pyx_v_epsi); + + /* "cdfdif_wrapper.pyx":42 + * params[4] = sz*(a/10.) + epsi + * params[5] = st + epsi + * params[6] = v/10. # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error)) + (__pyx_v_params[6]) = (__pyx_v_v / 10.); + + /* "cdfdif_wrapper.pyx":45 + * + * + * for i in range(size): # <<<<<<<<<<<<<< + * boundary = (int) (x[i] > 0) + * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) + */ + __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_size; + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "cdfdif_wrapper.pyx":46 + * + * for i in range(size): + * boundary = (int) (x[i] > 0) # <<<<<<<<<<<<<< + * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) + * y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] + */ + __Pyx_TraceLine(46,0,__PYX_ERR(0, 46, __pyx_L1_error)) + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 46, __pyx_L1_error) + } + __pyx_v_boundary = ((int)((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides)) > 0.0)); + + /* "cdfdif_wrapper.pyx":47 + * for i in range(size): + * boundary = (int) (x[i] > 0) + * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) # <<<<<<<<<<<<<< + * y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] + * + */ + __Pyx_TraceLine(47,0,__PYX_ERR(0, 47, __pyx_L1_error)) + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 47, __pyx_L1_error) + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_y.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 47, __pyx_L1_error) + } + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = cdfdif(fabs((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides))), __pyx_v_boundary, __pyx_v_params, (&__pyx_v_p_boundary)); + + /* "cdfdif_wrapper.pyx":48 + * boundary = (int) (x[i] > 0) + * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) + * y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] # <<<<<<<<<<<<<< + * + * #add p_outlier probability + */ + __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error)) + __pyx_t_5 = PyFloat_FromDouble((1.0 - __pyx_v_p_boundary)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sign); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 48, __pyx_L1_error) + } + __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_y.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 48, __pyx_L1_error) + } + __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_y.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 48, __pyx_L1_error) + } + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_8; + + /* "cdfdif_wrapper.pyx":51 + * + * #add p_outlier probability + * y[i] = add_outlier_cdf(y[i], x[i], p_outlier, w_outlier) # <<<<<<<<<<<<<< + * + * return y + */ + __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error)) + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_y.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 51, __pyx_L1_error) + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 51, __pyx_L1_error) + } + __pyx_t_8 = __pyx_f_14cdfdif_wrapper_add_outlier_cdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_p_outlier, __pyx_v_w_outlier); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_y.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 51, __pyx_L1_error) + } + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_8; + } + + /* "cdfdif_wrapper.pyx":53 + * y[i] = add_outlier_cdf(y[i], x[i], p_outlier, w_outlier) + * + * return y # <<<<<<<<<<<<<< + */ + __Pyx_TraceLine(53,0,__PYX_ERR(0, 53, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_y); + __pyx_r = ((PyObject *)__pyx_v_y); + goto __pyx_L0; + + /* "cdfdif_wrapper.pyx":16 + * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) + * + * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< + * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("cdfdif_wrapper.dmat_cdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_1_2_w_outlier_must_be_smaller_th, __pyx_k_1_2_w_outlier_must_be_smaller_th, sizeof(__pyx_k_1_2_w_outlier_must_be_smaller_th), 0, 1, 0, 0}, + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, + {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_kp_u_at_least_one_of_the_parameters_i, __pyx_k_at_least_one_of_the_parameters_i, sizeof(__pyx_k_at_least_one_of_the_parameters_i), 0, 1, 0, 0}, + {&__pyx_n_s_boundary, __pyx_k_boundary, sizeof(__pyx_k_boundary), 0, 0, 1, 1}, + {&__pyx_n_s_cdfdif_wrapper, __pyx_k_cdfdif_wrapper, sizeof(__pyx_k_cdfdif_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_dmat_cdf_array, __pyx_k_dmat_cdf_array, sizeof(__pyx_k_dmat_cdf_array), 0, 0, 1, 1}, + {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_epsi, __pyx_k_epsi, sizeof(__pyx_k_epsi), 0, 0, 1, 1}, + {&__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx, __pyx_k_hddm_wfpt_cdfdif_wrapper_pyx, sizeof(__pyx_k_hddm_wfpt_cdfdif_wrapper_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, + {&__pyx_n_s_p_boundary, __pyx_k_p_boundary, sizeof(__pyx_k_p_boundary), 0, 0, 1, 1}, + {&__pyx_n_s_p_outlier, __pyx_k_p_outlier, sizeof(__pyx_k_p_outlier), 0, 0, 1, 1}, + {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, + {&__pyx_n_s_sv, __pyx_k_sv, sizeof(__pyx_k_sv), 0, 0, 1, 1}, + {&__pyx_n_s_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_w_outlier, __pyx_k_w_outlier, sizeof(__pyx_k_w_outlier), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 983, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "cdfdif_wrapper.pyx":21 + * #check arguments + * if p_outlier > 0: + * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') # <<<<<<<<<<<<<< + * + * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_1_2_w_outlier_must_be_smaller_th); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "cdfdif_wrapper.pyx":25 + * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ + * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError("at least one of the parameters is out of the support") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_at_least_one_of_the_parameters_i); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "cdfdif_wrapper.pyx":16 + * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) + * + * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< + * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): + * + */ + __pyx_tuple__7 = PyTuple_Pack(17, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_y, __pyx_n_s_boundary, __pyx_n_s_p_boundary, __pyx_n_s_params, __pyx_n_s_epsi, __pyx_n_s_i); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx, __pyx_n_s_dmat_cdf_array, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 2, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + /* AssertionsEnabled.init */ + __Pyx_init_assertions_enabled(); + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2, __pyx_L1_error) + + /* NumpyImportArray.init */ + /* + * Cython has automatically inserted a call to _import_array since + * you didn't include one when you cimported numpy. To disable this + * add the line + * numpy._import_array + */ +#ifdef NPY_FEATURE_VERSION +#if !NO_IMPORT_ARRAY +if (unlikely(_import_array() == -1)) { + PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import " + "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; " + "use 'numpy._import_array' to disable if you are certain you don't need it)."); +} +#endif +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyTypeObject), + #elif CYTHON_COMPILING_IN_LIMITED_API + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyTypeObject), + #else + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_cdfdif_wrapper(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_cdfdif_wrapper}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "cdfdif_wrapper", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initcdfdif_wrapper(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initcdfdif_wrapper(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +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) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_cdfdif_wrapper(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + __Pyx_TraceDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'cdfdif_wrapper' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("cdfdif_wrapper", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 2, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to cdfdif_wrapper pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 2, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 2, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 2, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 2, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 2, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 2, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + if (__pyx_module_is_main_cdfdif_wrapper) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 2, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "cdfdif_wrapper")) { + if (unlikely((PyDict_SetItemString(modules, "cdfdif_wrapper", __pyx_m) < 0))) __PYX_ERR(0, 2, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 2, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 2, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 2, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 2, __pyx_L1_error) + #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void)", __pyx_f[0], 2, 0, __PYX_ERR(0, 2, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + * + * @property + * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + * + * @property + * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + __Pyx_TraceLine(257,0,__PYX_ERR(1, 257, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + * + * @property + * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + __Pyx_TraceLine(263,0,__PYX_ERR(1, 263, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + * + * @property + * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + __Pyx_TraceLine(271,0,__PYX_ERR(1, 271, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + * + * @property + * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + __Pyx_TraceLine(278,0,__PYX_ERR(1, 278, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + * + * @property + * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + __Pyx_TraceLine(773,0,__PYX_ERR(1, 773, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + __Pyx_TraceLine(788,0,__PYX_ERR(1, 788, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + __Pyx_TraceLine(967,0,__PYX_ERR(1, 967, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + __Pyx_TraceLine(971,0,__PYX_ERR(1, 971, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + __Pyx_TraceLine(998,0,__PYX_ERR(1, 998, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error)) + + + /* "cdfdif_wrapper.pyx":3 + * + * cimport numpy as np + * import numpy as np # <<<<<<<<<<<<<< + * + * cdef extern from "cdfdif.h": + */ + __Pyx_TraceLine(3,0,__PYX_ERR(0, 3, __pyx_L1_error)) + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cdfdif_wrapper.pyx":11 + * double fabs(double) + * + * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< + * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier + * + */ + __Pyx_TraceLine(11,0,__PYX_ERR(0, 11, __pyx_L1_error)) + + + /* "cdfdif_wrapper.pyx":14 + * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier + * + * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< + * + * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, + */ + __Pyx_TraceLine(14,0,__PYX_ERR(0, 14, __pyx_L1_error)) + + + /* "cdfdif_wrapper.pyx":16 + * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) + * + * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< + * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): + * + */ + __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error)) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14cdfdif_wrapper_1dmat_cdf_array, 0, __pyx_n_s_dmat_cdf_array, NULL, __pyx_n_s_cdfdif_wrapper, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dmat_cdf_array, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cdfdif_wrapper.pyx":2 + * + * cimport numpy as np # <<<<<<<<<<<<<< + * import numpy as np + * + */ + __Pyx_TraceLine(2,0,__PYX_ERR(0, 2, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_TraceReturn(Py_None, 0); + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init cdfdif_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init cdfdif_wrapper"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; // error + return kwvalues[i]; + } + } + return NULL; // not found (no exception set) +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + if (kwds_is_tuple) { + if (pos >= PyTuple_GET_SIZE(kwds)) break; + key = PyTuple_GET_ITEM(kwds, pos); + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* IsLittleEndian */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t <= '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case '?': return "'bool'"; + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparsable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) { + CYTHON_UNUSED_VAR(is_complex); + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) { + CYTHON_UNUSED_VAR(is_complex); + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number, ndim; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* BufferGetAndValidate */ + static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (unlikely(info->buf == NULL)) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} +static void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static int __Pyx__GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + buf->buf = NULL; + if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { + __Pyx_ZeroBuffer(buf); + return -1; + } + if (unlikely(buf->ndim != nd)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if (unlikely((size_t)buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_SafeReleaseBuffer(buf); + return -1; +} + +/* PyDictVersioning */ + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ + #if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCallMethO */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ + static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + Py_DECREF(argstuple); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) + if (__Pyx_IsCyOrPyCFunction(func)) +#else + if (PyCFunction_Check(func)) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + } + else if (nargs == 1 && kwargs == NULL) { + if (PyCFunction_Check(func)) + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, args[0]); + } + } + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + #if CYTHON_VECTORCALL + vectorcallfunc f = _PyVectorcall_Function(func); + if (f) { + return f(func, args, (size_t)nargs, kwargs); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, kwargs); + } + #endif + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); +} + +/* ExtTypeTest */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + __Pyx_TypeName obj_type_name; + __Pyx_TypeName type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetName(type); + PyErr_Format(PyExc_TypeError, + "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, + obj_type_name, type_name); + __Pyx_DECREF_TypeName(obj_type_name); + __Pyx_DECREF_TypeName(type_name); + return 0; +} + +/* BufferIndexError */ + static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType_3_0_0 +#define __PYX_HAVE_RT_ImportType_3_0_0 +static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; + Py_ssize_t itemsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + PyObject *py_itemsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#if !CYTHON_COMPILING_IN_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize+itemsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_0 && + ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd-%zd from PyObject", + module_name, class_name, size, basicsize, basicsize+itemsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_0 && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, 1); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + #endif + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportDottedModule */ + #if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s__6; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* FixUpExtensionType */ + #if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* FetchSharedCythonModule */ + static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); + if (unlikely(!abi_module)) return NULL; + Py_INCREF(abi_module); + return abi_module; +} + +/* FetchCommonType */ + static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ + #if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ + static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); + PyList_SET_ITEM(fromlist, 0, marker); + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyCFunctionObject *cf = (PyCFunctionObject*) op; + if (unlikely(op == NULL)) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + cf->m_ml = ml; + cf->m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + cf->m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(((PyCFunctionObject*)m)->m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(((PyCFunctionObject*)m)->m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#ifdef _Py_TPFLAGS_HAVE_VECTORCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ + static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + #if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + _PyTraceback_Add(funcname, filename, py_line); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + __Pyx_TypeName obj_type_name; + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface", + obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* Declarations */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = (float)(1.0) / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = (float)(1.0) / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if ((b.imag == 0) && (a.real >= 0)) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if ((b.imag == 0) && (a.real >= 0)) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FormatTypeName */ + #if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__8)); + } + return name; +} +#endif + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; + char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } + PyOS_snprintf(message, sizeof(message), + "compile time version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + #if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + 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])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + 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])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx new file mode 100644 index 00000000..3bfe1987 --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx @@ -0,0 +1,53 @@ + +cimport numpy as np +import numpy as np + +cdef extern from "cdfdif.h": + double cdfdif(double t, int x, double *par, double *prob) + +cdef extern from "math.h": + double fabs(double) + +cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): + return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier + +cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) + +def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, + double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): + + #check arguments + if p_outlier > 0: + assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') + + if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ + (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): + raise ValueError("at least one of the parameters is out of the support") + + + cdef Py_ssize_t size = x.shape[0] + cdef np.ndarray[double, ndim=1] y = np.empty(size, dtype=np.double) + cdef int boundary + cdef double p_boundary + cdef double params[7] + cdef double epsi = 1e-10 + + #transform parameters + params[0] = a/10. + params[1] = t + params[2] = sv/10. + epsi + params[3] = z*(a/10.) + params[4] = sz*(a/10.) + epsi + params[5] = st + epsi + params[6] = v/10. + + + for i in range(size): + boundary = (int) (x[i] > 0) + y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) + y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] + + #add p_outlier probability + y[i] = add_outlier_cdf(y[i], x[i], p_outlier, w_outlier) + + return y diff --git a/src/hssm/likelihoods/hddm_wfpt/integrate.pxi b/src/hssm/likelihoods/hddm_wfpt/integrate.pxi new file mode 100644 index 00000000..c2505c9c --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/integrate.pxi @@ -0,0 +1,206 @@ +#cython: embedsignature=True +#cython: cdivision=True +#cython: wraparound=False +#cython: boundscheck=False + +import numpy as np +cimport numpy as np +cimport cython + +include 'pdf.pxi' + +cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, + double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: + #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" + #assert ((ub_t-lb_t)*(ub_z-lb_z)==0 and (n_sz*n_st)==0), "the function is defined for 1D-integration only" + + cdef double ht, hz + cdef int n = max(n_st, n_sz) + if n_st==0: #integration over z + hz = (ub_z-lb_z)/n + ht = 0 + lb_t = t + ub_t = t + else: #integration over t + hz = 0 + ht = (ub_t-lb_t)/n + lb_z = z + ub_z = z + + cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) + cdef double z_tag, t_tag, y + cdef int i + + for i from 1 <= i <= n: + z_tag = lb_z + hz * i + t_tag = lb_t + ht * i + y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) + if i&1: #check if i is odd + S += (4 * y) + else: + S += (2 * y) + S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y + S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st + + return ((ht+hz) * S / 3) + +cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: + #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" + #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) + + cdef double ht + cdef double S + cdef double t_tag, y + cdef int i_t + + ht = (ub_t-lb_t)/n_st + + S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) + + for i_t from 1 <= i_t <= n_st: + t_tag = lb_t + ht * i_t + y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) + if i_t&1: #check if i is odd + S += (4 * y) + else: + S += (2 * y) + S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y + S = S/ (ub_t-lb_t) + + return (ht * S / 3) + +cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, + double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, + double S, double f_beg, double f_end, double f_mid, int bottom) nogil: + + cdef double z_c, z_d, z_e, t_c, t_d, t_e, h + cdef double fd, fe + cdef double Sleft, Sright, S2 + #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) + + if (ub_t-lb_t) == 0: #integration over sz + h = ub_z - lb_z + z_c = (ub_z + lb_z)/2. + z_d = (lb_z + z_c)/2. + z_e = (z_c + ub_z)/2. + t_c = t + t_d = t + t_e = t + + else: #integration over t + h = ub_t - lb_t + t_c = (ub_t + lb_t)/2. + t_d = (lb_t + t_c)/2. + t_e = (t_c + ub_t)/2. + z_c = z + z_d = z + z_e = z + + fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT + fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT + + Sleft = (h/12)*(f_beg + 4*fd + f_mid) + Sright = (h/12)*(f_mid + 4*fe + f_end) + S2 = Sleft + Sright + if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): + return S2 + (S2 - S)/15 + return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + lb_z, z_c, lb_t, t_c, ZT, simps_err/2, + Sleft, f_beg, f_mid, fd, bottom-1) + \ + adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + z_c, ub_z, t_c, ub_t, ZT, simps_err/2, + Sright, f_mid, f_end, fe, bottom-1) + +cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, + double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, + double simps_err, int maxRecursionDepth) nogil: + + cdef double h + + if (ub_t - lb_t) == 0: #integration over z + lb_t = t + ub_t = t + h = ub_z - lb_z + else: #integration over t + h = (ub_t-lb_t) + lb_z = z + ub_z = z + + cdef double ZT = h + cdef double c_t = (lb_t + ub_t)/2. + cdef double c_z = (lb_z + ub_z)/2. + + cdef double f_beg, f_end, f_mid, S + f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT + f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT + f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT + S = (h/6)*(f_beg + 4*f_mid + f_end) + cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + lb_z, ub_z, lb_t, ub_t, ZT, simps_err, + S, f_beg, f_end, f_mid, maxRecursionDepth) + return res + +cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, + double a, double z, double t, double + pdf_err, double err_1d, double lb_z, + double ub_z, double lb_t, double + ub_t, double st, double err_2d, double + S, double f_beg, double f_end, double + f_mid, int maxRecursionDepth_sz, int + bottom) nogil: + + cdef double fd, fe + cdef double Sleft, Sright, S2 + #print "in AdaptiveSimpsAux_2D: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) + + cdef double t_c = (ub_t + lb_t)/2. + cdef double t_d = (lb_t + t_c)/2. + cdef double t_e = (t_c + ub_t)/2. + cdef double h = ub_t - lb_t + + fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, + 0, 0, err_1d, maxRecursionDepth_sz)/st + fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, + 0, 0, err_1d, maxRecursionDepth_sz)/st + + Sleft = (h/12)*(f_beg + 4*fd + f_mid) + Sright = (h/12)*(f_mid + 4*fe + f_end) + S2 = Sleft + Sright + + if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): + return S2 + (S2 - S)/15; + + return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, + lb_z, ub_z, lb_t, t_c, st, err_2d/2, + Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ + adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, + lb_z, ub_z, t_c, ub_t, st, err_2d/2, + Sright, f_mid, f_end, fe, maxRecursionDepth_sz, bottom-1) + + +cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, + double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, + double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: + + cdef double h = (ub_t-lb_t) + + cdef double st = (ub_t - lb_t) + cdef double c_t = (lb_t + ub_t)/2. + cdef double c_z = (lb_z + ub_z)/2. + + cdef double f_beg, f_end, f_mid, S + cdef double err_1d = simps_err + cdef double err_2d = simps_err + + f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, + 0, 0, err_1d, maxRecursionDepth_sz)/st + + f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, + 0, 0, err_1d, maxRecursionDepth_sz)/st + f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, + 0, 0, err_1d, maxRecursionDepth_sz)/st + S = (h/6)*(f_beg + 4*f_mid + f_end) + cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, + lb_z, ub_z, lb_t, ub_t, st, err_2d, + S, f_beg, f_end, f_mid, maxRecursionDepth_sz, maxRecursionDepth_st) + return res diff --git a/src/hssm/likelihoods/hddm_wfpt/pdf.pxi b/src/hssm/likelihoods/hddm_wfpt/pdf.pxi new file mode 100644 index 00000000..3964f74c --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/pdf.pxi @@ -0,0 +1,146 @@ +#cython: embedsignature=True +#cython: cdivision=True +#cython: wraparound=False +#cython: boundscheck=False + +cimport cython + +#include "integrate.pxi" + +#from libc.math cimport tan, sin, cos, log, exp, sqrt, fmax, pow, ceil, floor, fabs, M_PI + +cdef extern from "math.h" nogil: + double sin(double) + double cos(double) + double log(double) + double exp(double) + double sqrt(double) +# double fmax(double, double) + double pow(double, double) + double ceil(double) + double floor(double) + double fabs(double) + double M_PI + +cdef extern from "" namespace "std" nogil: + T max[T](T a, T b) + +cdef double ftt_01w(double tt, double w, double err) nogil: + """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method + and implementation of Navarro & Fuss, 2009. + """ + cdef double kl, ks, p + cdef int k, K, lower, upper + + # calculate number of terms needed for large t + if M_PI*tt*err<1: # if error threshold is set low enough + kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound + kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met + else: # if error threshold set too high + kl=1./(M_PI*sqrt(tt)) # set to boundary condition + + # calculate number of terms needed for small t + if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough + ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound + ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met + else: # if error threshold was set too high + ks=2 # minimal kappa for that case + + # compute f(tt|0,1,w) + p=0 #initialize density + if ks(ceil(ks)) # round to smallest integer meeting error + lower = (-floor((K-1)/2.)) + upper = (ceil((K-1)/2.)) + for k from lower <= k <= upper: # loop over k + p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum + p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term + + else: # if large t is better... + K=(ceil(kl)) # round to smallest integer meeting error + for k from 1 <= k <= K: + p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum + p*=M_PI # add con_stant term + + return p + +cdef inline double prob_ub(double v, double a, double z) nogil: + """Probability of hitting upper boundary.""" + if v == 0: + return z + else: + return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) + +cdef double pdf(double x, double v, double a, double w, double err) nogil: + """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method + and implementation of Navarro & Fuss, 2009. + """ + if x <= 0: + return 0 + + cdef double tt = x/a**2 # use normalized time + cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) + + # convert to f(t|v,a,w) + return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) + +cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: + """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method + and implementation of Navarro & Fuss, 2009. + sv is the std of the drift rate + """ + if x <= 0: + return 0 + + if sv==0: + return pdf(x, v, a, z, err) + + cdef double tt = x/(pow(a,2)) # use normalized time + cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) + + # convert to f(t|v,a,w) + return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) + +cpdef double full_pdf(double x, double v, double sv, double a, double + z, double sz, double t, double st, double err, int + n_st=2, int n_sz=2, bint use_adaptive=1, double + simps_err=1e-3) nogil: + """full pdf""" + + # Check if parpameters are valid + if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ + ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): + return 0 + + # transform x,v,z if x is upper bound response + if x > 0: + v = -v + z = 1.-z + + x = fabs(x) + + if st<1e-3: + st = 0 + if sz <1e-3: + sz = 0 + + if (sz==0): + if (st==0): #sv=0,sz=0,st=0 + return pdf_sv(x - t, v, sv, a, z, err) + else: #sv=0,sz=0,st=$ + if use_adaptive>0: + return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) + else: + return simpson_1D(x, v, sv, a, z, t, err, z, z, 0, t-st/2., t+st/2., n_st) + + else: #sz=$ + if (st==0): #sv=0,sz=$,st=0 + if use_adaptive: + return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) + else: + return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) + else: #sv=0,sz=$,st=$ + if use_adaptive: + return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) + else: + return simpson_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t-st/2., t+st/2., n_st) diff --git a/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp b/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp new file mode 100644 index 00000000..c98e5ae0 --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp @@ -0,0 +1,29592 @@ +/* Generated by Cython 3.0.0 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "extra_compile_args": [ + "-stdlib=libc++" + ], + "extra_link_args": [ + "-stdlib=libc++", + "-mmacosx-version-min=10.9" + ], + "language": "c++", + "name": "wfpt", + "sources": [ + "hddm_wfpt/wfpt.pyx" + ] + }, + "module_name": "wfpt" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#define CYTHON_ABI "3_0_0" +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030000F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(const U& other) const { return *ptr == other; } + template bool operator !=(const U& other) const { return *ptr != other; } + template bool operator==(const __Pyx_FakeReference& other) const { return *ptr == *other.ptr; } + template bool operator!=(const __Pyx_FakeReference& other) const { return *ptr != *other.ptr; } + private: + T *ptr; +}; + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject *co=NULL, *result=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(p))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; + if (!(empty = PyTuple_New(0))) goto end; + result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); + end: + Py_XDECREF((PyObject*) co); + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE(obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#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)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #define __PYX_EXTERN_C extern "C++" +#endif + +#define __PYX_HAVE__wfpt +#define __PYX_HAVE_API__wfpt +/* Early includes */ +#include +#include + + /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */ + +#include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" +#include "numpy/ufuncobject.h" +#include "math.h" +#include +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else // Py < 3.12 + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "hddm_wfpt/wfpt.pyx", + "__init__.cython-30.pxd", + "hddm_wfpt/pdf.pxi", + "hddm_wfpt/integrate.pxi", + "type.pxd", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* BufferFormatStructs.proto */ +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +/* #### Code section: numeric_typedefs ### */ + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":730 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":737 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":744 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":754 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":758 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":765 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +/* #### Code section: complex_type_declarations ### */ +/* Declarations.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":769 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_opt_args_4wfpt_full_pdf; + +/* "hddm_wfpt/pdf.pxi":104 + * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) + * + * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< + * z, double sz, double t, double st, double err, int + * n_st=2, int n_sz=2, bint use_adaptive=1, double + */ +struct __pyx_opt_args_4wfpt_full_pdf { + int __pyx_n; + int n_st; + int n_sz; + int use_adaptive; + double simps_err; +}; +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* ErrOccurredWithGIL.proto */ +static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* BufferGetAndValidate.proto */ +#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ + ((obj == Py_None || obj == NULL) ?\ + (__Pyx_ZeroBuffer(buf), 0) :\ + __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) +static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static void __Pyx_ZeroBuffer(Py_buffer* buf); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +/* BufferFallbackError.proto */ +static void __Pyx_RaiseBufferFallbackError(void); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* PyIntCompare.proto */ +static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) +#endif + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_0 +#define __PYX_HAVE_RT_ImportType_proto_3_0_0 +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#include +#endif +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_3_0_0 { + __Pyx_ImportType_CheckSize_Error_3_0_0 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_0 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_0 = 2 +}; +static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 check_size); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ +static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/ + +/* Module declarations from "libc.string" */ + +/* Module declarations from "libc.stdio" */ + +/* Module declarations from "__builtin__" */ + +/* Module declarations from "cpython.type" */ + +/* Module declarations from "cpython" */ + +/* Module declarations from "cpython.object" */ + +/* Module declarations from "cpython.ref" */ + +/* Module declarations from "numpy" */ + +/* Module declarations from "numpy" */ + +/* Module declarations from "cython" */ + +/* Module declarations from "wfpt" */ +static double __pyx_f_4wfpt_ftt_01w(double, double, double); /*proto*/ +static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double, double, double); /*proto*/ +static double __pyx_f_4wfpt_pdf(double, double, double, double, double); /*proto*/ +static double __pyx_f_4wfpt_pdf_sv(double, double, double, double, double, double); /*proto*/ +static double __pyx_f_4wfpt_full_pdf(double, double, double, double, double, double, double, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4wfpt_full_pdf *__pyx_optional_args); /*proto*/ +static double __pyx_f_4wfpt_simpson_1D(double, double, double, double, double, double, double, double, double, int, double, double, int); /*proto*/ +static double __pyx_f_4wfpt_simpson_2D(double, double, double, double, double, double, double, double, double, int, double, double, int); /*proto*/ +static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, int); /*proto*/ +static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double, double, double, double, double, double, double, double, double, double, double, double, int); /*proto*/ +static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, int, int); /*proto*/ +static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double, double, double, double, double, double, double, double, double, double, double, double, int, int); /*proto*/ +static CYTHON_INLINE int __pyx_f_4wfpt_p_outlier_in_range(double); /*proto*/ +/* #### Code section: typeinfo ### */ +static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_long = { "long", NULL, sizeof(long), { 0 }, 0, __PYX_IS_UNSIGNED(long) ? 'U' : 'I', __PYX_IS_UNSIGNED(long), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 }; +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "wfpt" +extern int __pyx_module_is_main_wfpt; +int __pyx_module_is_main_wfpt = 0; + +/* Implementation of "wfpt" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_ImportError; +/* #### Code section: string_decls ### */ +static const char __pyx_k_N[] = "N"; +static const char __pyx_k_a[] = "a"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_j[] = "j"; +static const char __pyx_k_p[] = "p"; +static const char __pyx_k_q[] = "q"; +static const char __pyx_k_s[] = "s"; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_y[] = "y"; +static const char __pyx_k_z[] = "z"; +static const char __pyx_k_ij[] = "ij"; +static const char __pyx_k_lb[] = "lb"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_qs[] = "qs"; +static const char __pyx_k_st[] = "st"; +static const char __pyx_k_sv[] = "sv"; +static const char __pyx_k_sz[] = "sz"; +static const char __pyx_k_ub[] = "ub"; +static const char __pyx_k_xs[] = "xs"; +static const char __pyx_k__23[] = "*"; +static const char __pyx_k__24[] = "."; +static const char __pyx_k__40[] = "?"; +static const char __pyx_k_err[] = "err"; +static const char __pyx_k_exp[] = "exp"; +static const char __pyx_k_i_p[] = "i_p"; +static const char __pyx_k_idx[] = "idx"; +static const char __pyx_k_inf[] = "inf"; +static const char __pyx_k_log[] = "log"; +static const char __pyx_k_max[] = "max"; +static const char __pyx_k_min[] = "min"; +static const char __pyx_k_sum[] = "sum"; +static const char __pyx_k_alfa[] = "alfa"; +static const char __pyx_k_axis[] = "axis"; +static const char __pyx_k_copy[] = "copy"; +static const char __pyx_k_core[] = "core"; +static const char __pyx_k_data[] = "data"; +static const char __pyx_k_diff[] = "diff"; +static const char __pyx_k_logp[] = "logp"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_n_st[] = "n_st"; +static const char __pyx_k_n_sz[] = "n_sz"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_tile[] = "tile"; +static const char __pyx_k_time[] = "time"; +static const char __pyx_k_wfpt[] = "wfpt"; +static const char __pyx_k_x_lb[] = "x_lb"; +static const char __pyx_k_x_ub[] = "x_ub"; +static const char __pyx_k_alpha[] = "alpha"; +static const char __pyx_k_array[] = "array"; +static const char __pyx_k_drift[] = "drift"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_empty[] = "empty"; +static const char __pyx_k_log_p[] = "log_p"; +static const char __pyx_k_model[] = "model"; +static const char __pyx_k_multi[] = "multi"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_param[] = "param"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_scipy[] = "scipy"; +static const char __pyx_k_stack[] = "stack"; +static const char __pyx_k_t_max[] = "t_max"; +static const char __pyx_k_t_min[] = "t_min"; +static const char __pyx_k_umath[] = "umath"; +static const char __pyx_k_zeros[] = "zeros"; +static const char __pyx_k_arange[] = "arange"; +static const char __pyx_k_astype[] = "astype"; +static const char __pyx_k_cont_x[] = "cont_x"; +static const char __pyx_k_cumsum[] = "cumsum"; +static const char __pyx_k_double[] = "double"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_ll_min[] = "ll_min"; +static const char __pyx_k_n_cont[] = "n_cont"; +static const char __pyx_k_params[] = "params"; +static const char __pyx_k_rl_arr[] = "rl_arr"; +static const char __pyx_k_s_size[] = "s_size"; +static const char __pyx_k_unique[] = "unique"; +static const char __pyx_k_float32[] = "float32"; +static const char __pyx_k_maximum[] = "maximum"; +static const char __pyx_k_network[] = "network"; +static const char __pyx_k_squeeze[] = "squeeze"; +static const char __pyx_k_cumtrapz[] = "cumtrapz"; +static const char __pyx_k_feedback[] = "feedback"; +static const char __pyx_k_full_pdf[] = "full_pdf"; +static const char __pyx_k_linspace[] = "linspace"; +static const char __pyx_k_n_params[] = "n_params"; +static const char __pyx_k_pos_alfa[] = "pos_alfa"; +static const char __pyx_k_pos_cont[] = "pos_cont"; +static const char __pyx_k_response[] = "response"; +static const char __pyx_k_rl_alpha[] = "rl_alpha"; +static const char __pyx_k_split_by[] = "split_by"; +static const char __pyx_k_sum_logp[] = "sum_logp"; +static const char __pyx_k_tp_scale[] = "tp_scale"; +static const char __pyx_k_cdf_array[] = "cdf_array"; +static const char __pyx_k_data_copy[] = "data_copy"; +static const char __pyx_k_feedbacks[] = "feedbacks"; +static const char __pyx_k_integrate[] = "integrate"; +static const char __pyx_k_lower_bnd[] = "lower_bnd"; +static const char __pyx_k_p_outlier[] = "p_outlier"; +static const char __pyx_k_params_rl[] = "params_rl"; +static const char __pyx_k_pdf_array[] = "pdf_array"; +static const char __pyx_k_pos_alpha[] = "pos_alpha"; +static const char __pyx_k_responses[] = "responses"; +static const char __pyx_k_simps_err[] = "simps_err"; +static const char __pyx_k_split_cdf[] = "split_cdf"; +static const char __pyx_k_upper_bnd[] = "upper_bnd"; +static const char __pyx_k_w_outlier[] = "w_outlier"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_params_ssm[] = "params_ssm"; +static const char __pyx_k_wp_outlier[] = "wp_outlier"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_concatenate[] = "concatenate"; +static const char __pyx_k_cumm_s_size[] = "cumm_s_size"; +static const char __pyx_k_params_bnds[] = "params_bnds"; +static const char __pyx_k_params_iter[] = "params_iter"; +static const char __pyx_k_wiener_like[] = "wiener_like"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_responses_qs[] = "responses_qs"; +static const char __pyx_k_use_adaptive[] = "use_adaptive"; +static const char __pyx_k_class_getitem[] = "__class_getitem__"; +static const char __pyx_k_wiener_like_rl[] = "wiener_like_rl"; +static const char __pyx_k_scipy_integrate[] = "scipy.integrate"; +static const char __pyx_k_predict_on_batch[] = "predict_on_batch"; +static const char __pyx_k_gen_cdf_using_pdf[] = "gen_cdf_using_pdf"; +static const char __pyx_k_hddm_wfpt_pdf_pxi[] = "hddm_wfpt/pdf.pxi"; +static const char __pyx_k_wiener_like_multi[] = "wiener_like_multi"; +static const char __pyx_k_wiener_like_rlddm[] = "wiener_like_rlddm"; +static const char __pyx_k_wiener_logp_array[] = "wiener_logp_array"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_hddm_wfpt_wfpt_pyx[] = "hddm_wfpt/wfpt.pyx"; +static const char __pyx_k_wiener_like_rlssm_nn[] = "wiener_like_rlssm_nn"; +static const char __pyx_k_wiener_like_contaminant[] = "wiener_like_contaminant"; +static const char __pyx_k_wiener_like_multi_rlddm[] = "wiener_like_multi_rlddm"; +static const char __pyx_k_wiener_like_multi_nn_mlp[] = "wiener_like_multi_nn_mlp"; +static const char __pyx_k_wiener_like_rlssm_nn_reg[] = "wiener_like_rlssm_nn_reg"; +static const char __pyx_k_wiener_like_multi_nn_mlp_pdf[] = "wiener_like_multi_nn_mlp_pdf"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_at_least_one_of_the_parameters_i[] = "at least one of the parameters is out of the support"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_4wfpt_full_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err); /* proto */ +static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_logp, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_sv, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_z, PyArrayObject *__pyx_v_sz, PyArrayObject *__pyx_v_t, PyArrayObject *__pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_model, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_ssm, PyArrayObject *__pyx_v_params_rl, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ +static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_err, CYTHON_UNUSED int __pyx_v_n_st, CYTHON_UNUSED int __pyx_v_n_sz, CYTHON_UNUSED int __pyx_v_use_adaptive, CYTHON_UNUSED double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, PyObject *__pyx_v_alpha, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_rl_arr, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ +static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_cont_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_t_min, double __pyx_v_t_max, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err); /* proto */ +static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_N, double __pyx_v_time, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_data); /* proto */ +static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ +static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyTypeObject *__pyx_ptype_7cpython_4type_type; + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyTypeObject *__pyx_ptype_5numpy_dtype; + PyTypeObject *__pyx_ptype_5numpy_flatiter; + PyTypeObject *__pyx_ptype_5numpy_broadcast; + PyTypeObject *__pyx_ptype_5numpy_ndarray; + PyTypeObject *__pyx_ptype_5numpy_generic; + PyTypeObject *__pyx_ptype_5numpy_number; + PyTypeObject *__pyx_ptype_5numpy_integer; + PyTypeObject *__pyx_ptype_5numpy_signedinteger; + PyTypeObject *__pyx_ptype_5numpy_unsignedinteger; + PyTypeObject *__pyx_ptype_5numpy_inexact; + PyTypeObject *__pyx_ptype_5numpy_floating; + PyTypeObject *__pyx_ptype_5numpy_complexfloating; + PyTypeObject *__pyx_ptype_5numpy_flexible; + PyTypeObject *__pyx_ptype_5numpy_character; + PyTypeObject *__pyx_ptype_5numpy_ufunc; + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_n_s_ImportError; + PyObject *__pyx_n_s_N; + PyObject *__pyx_n_s_ValueError; + PyObject *__pyx_n_s__23; + PyObject *__pyx_kp_u__24; + PyObject *__pyx_n_s__40; + PyObject *__pyx_n_s_a; + PyObject *__pyx_n_u_a; + PyObject *__pyx_n_s_alfa; + PyObject *__pyx_n_s_alpha; + PyObject *__pyx_n_u_alpha; + PyObject *__pyx_n_s_arange; + PyObject *__pyx_n_s_array; + PyObject *__pyx_n_s_astype; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_kp_u_at_least_one_of_the_parameters_i; + PyObject *__pyx_n_s_axis; + PyObject *__pyx_n_s_cdf_array; + PyObject *__pyx_n_s_class_getitem; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_concatenate; + PyObject *__pyx_n_s_cont_x; + PyObject *__pyx_n_s_copy; + PyObject *__pyx_n_s_core; + PyObject *__pyx_n_s_cumm_s_size; + PyObject *__pyx_n_s_cumsum; + PyObject *__pyx_n_s_cumtrapz; + PyObject *__pyx_n_s_data; + PyObject *__pyx_n_s_data_copy; + PyObject *__pyx_n_s_diff; + PyObject *__pyx_n_s_double; + PyObject *__pyx_n_s_drift; + PyObject *__pyx_n_s_dtype; + PyObject *__pyx_n_s_empty; + PyObject *__pyx_n_s_err; + PyObject *__pyx_n_s_exp; + PyObject *__pyx_n_s_feedback; + PyObject *__pyx_n_s_feedbacks; + PyObject *__pyx_n_s_float32; + PyObject *__pyx_n_s_full_pdf; + PyObject *__pyx_n_s_gen_cdf_using_pdf; + PyObject *__pyx_kp_s_hddm_wfpt_pdf_pxi; + PyObject *__pyx_kp_s_hddm_wfpt_wfpt_pyx; + PyObject *__pyx_n_s_i; + PyObject *__pyx_n_s_i_p; + PyObject *__pyx_n_s_idx; + PyObject *__pyx_n_s_ij; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_inf; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_integrate; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_s_j; + PyObject *__pyx_n_s_lb; + PyObject *__pyx_n_s_linspace; + PyObject *__pyx_n_s_ll_min; + PyObject *__pyx_n_s_log; + PyObject *__pyx_n_s_log_p; + PyObject *__pyx_n_s_logp; + PyObject *__pyx_n_s_lower_bnd; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_max; + PyObject *__pyx_n_s_maximum; + PyObject *__pyx_n_s_min; + PyObject *__pyx_n_s_model; + PyObject *__pyx_n_s_multi; + PyObject *__pyx_n_s_n_cont; + PyObject *__pyx_n_s_n_params; + PyObject *__pyx_n_s_n_st; + PyObject *__pyx_n_s_n_sz; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_network; + PyObject *__pyx_n_s_np; + PyObject *__pyx_n_s_numpy; + PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; + PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; + PyObject *__pyx_n_s_p; + PyObject *__pyx_n_s_p_outlier; + PyObject *__pyx_n_s_param; + PyObject *__pyx_n_s_params; + PyObject *__pyx_n_s_params_bnds; + PyObject *__pyx_n_s_params_iter; + PyObject *__pyx_n_s_params_rl; + PyObject *__pyx_n_s_params_ssm; + PyObject *__pyx_n_s_pdf_array; + PyObject *__pyx_n_s_pos_alfa; + PyObject *__pyx_n_s_pos_alpha; + PyObject *__pyx_n_s_pos_cont; + PyObject *__pyx_n_s_predict_on_batch; + PyObject *__pyx_n_s_q; + PyObject *__pyx_n_s_qs; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_response; + PyObject *__pyx_n_s_responses; + PyObject *__pyx_n_s_responses_qs; + PyObject *__pyx_n_s_rl_alpha; + PyObject *__pyx_n_s_rl_arr; + PyObject *__pyx_n_s_s; + PyObject *__pyx_n_s_s_size; + PyObject *__pyx_n_s_scipy; + PyObject *__pyx_n_s_scipy_integrate; + PyObject *__pyx_n_s_simps_err; + PyObject *__pyx_n_s_size; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_split_by; + PyObject *__pyx_n_s_split_cdf; + PyObject *__pyx_n_s_squeeze; + PyObject *__pyx_n_s_st; + PyObject *__pyx_n_u_st; + PyObject *__pyx_n_s_stack; + PyObject *__pyx_n_s_sum; + PyObject *__pyx_n_s_sum_logp; + PyObject *__pyx_n_s_sv; + PyObject *__pyx_n_u_sv; + PyObject *__pyx_n_s_sz; + PyObject *__pyx_n_u_sz; + PyObject *__pyx_n_s_t; + PyObject *__pyx_n_u_t; + PyObject *__pyx_n_s_t_max; + PyObject *__pyx_n_s_t_min; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_tile; + PyObject *__pyx_n_s_time; + PyObject *__pyx_n_s_tp_scale; + PyObject *__pyx_n_s_ub; + PyObject *__pyx_n_s_umath; + PyObject *__pyx_n_s_unique; + PyObject *__pyx_n_s_upper_bnd; + PyObject *__pyx_n_s_use_adaptive; + PyObject *__pyx_n_s_v; + PyObject *__pyx_n_u_v; + PyObject *__pyx_n_s_w_outlier; + PyObject *__pyx_n_s_wfpt; + PyObject *__pyx_n_s_wiener_like; + PyObject *__pyx_n_s_wiener_like_contaminant; + PyObject *__pyx_n_s_wiener_like_multi; + PyObject *__pyx_n_s_wiener_like_multi_nn_mlp; + PyObject *__pyx_n_s_wiener_like_multi_nn_mlp_pdf; + PyObject *__pyx_n_s_wiener_like_multi_rlddm; + PyObject *__pyx_n_s_wiener_like_rl; + PyObject *__pyx_n_s_wiener_like_rlddm; + PyObject *__pyx_n_s_wiener_like_rlssm_nn; + PyObject *__pyx_n_s_wiener_like_rlssm_nn_reg; + PyObject *__pyx_n_s_wiener_logp_array; + PyObject *__pyx_n_s_wp_outlier; + PyObject *__pyx_n_s_x; + PyObject *__pyx_n_s_x_lb; + PyObject *__pyx_n_s_x_ub; + PyObject *__pyx_n_s_xs; + PyObject *__pyx_n_s_y; + PyObject *__pyx_n_s_z; + PyObject *__pyx_n_u_z; + PyObject *__pyx_n_s_zeros; + PyObject *__pyx_float_1eneg_3; + PyObject *__pyx_float_2_718281828459; + PyObject *__pyx_int_0; + PyObject *__pyx_int_1; + PyObject *__pyx_int_2; + PyObject *__pyx_int_neg_1; + PyObject *__pyx_tuple_; + PyObject *__pyx_slice__7; + PyObject *__pyx_tuple__2; + PyObject *__pyx_slice__10; + PyObject *__pyx_slice__19; + PyObject *__pyx_tuple__17; + PyObject *__pyx_tuple__22; + PyObject *__pyx_tuple__25; + PyObject *__pyx_tuple__26; + PyObject *__pyx_tuple__27; + PyObject *__pyx_tuple__28; + PyObject *__pyx_tuple__29; + PyObject *__pyx_tuple__30; + PyObject *__pyx_tuple__31; + PyObject *__pyx_tuple__32; + PyObject *__pyx_tuple__33; + PyObject *__pyx_tuple__34; + PyObject *__pyx_tuple__35; + PyObject *__pyx_tuple__36; + PyObject *__pyx_tuple__37; + PyObject *__pyx_tuple__38; + PyObject *__pyx_tuple__39; + PyObject *__pyx_codeobj__3; + PyObject *__pyx_codeobj__4; + PyObject *__pyx_codeobj__5; + PyObject *__pyx_codeobj__6; + PyObject *__pyx_codeobj__8; + PyObject *__pyx_codeobj__9; + PyObject *__pyx_codeobj__11; + PyObject *__pyx_codeobj__12; + PyObject *__pyx_codeobj__13; + PyObject *__pyx_codeobj__14; + PyObject *__pyx_codeobj__15; + PyObject *__pyx_codeobj__16; + PyObject *__pyx_codeobj__18; + PyObject *__pyx_codeobj__20; + PyObject *__pyx_codeobj__21; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc); + Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); + Py_CLEAR(clear_module_state->__pyx_n_s_N); + Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); + Py_CLEAR(clear_module_state->__pyx_n_s__23); + Py_CLEAR(clear_module_state->__pyx_kp_u__24); + Py_CLEAR(clear_module_state->__pyx_n_s__40); + Py_CLEAR(clear_module_state->__pyx_n_s_a); + Py_CLEAR(clear_module_state->__pyx_n_u_a); + Py_CLEAR(clear_module_state->__pyx_n_s_alfa); + Py_CLEAR(clear_module_state->__pyx_n_s_alpha); + Py_CLEAR(clear_module_state->__pyx_n_u_alpha); + Py_CLEAR(clear_module_state->__pyx_n_s_arange); + Py_CLEAR(clear_module_state->__pyx_n_s_array); + Py_CLEAR(clear_module_state->__pyx_n_s_astype); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_kp_u_at_least_one_of_the_parameters_i); + Py_CLEAR(clear_module_state->__pyx_n_s_axis); + Py_CLEAR(clear_module_state->__pyx_n_s_cdf_array); + Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_concatenate); + Py_CLEAR(clear_module_state->__pyx_n_s_cont_x); + Py_CLEAR(clear_module_state->__pyx_n_s_copy); + Py_CLEAR(clear_module_state->__pyx_n_s_core); + Py_CLEAR(clear_module_state->__pyx_n_s_cumm_s_size); + Py_CLEAR(clear_module_state->__pyx_n_s_cumsum); + Py_CLEAR(clear_module_state->__pyx_n_s_cumtrapz); + Py_CLEAR(clear_module_state->__pyx_n_s_data); + Py_CLEAR(clear_module_state->__pyx_n_s_data_copy); + Py_CLEAR(clear_module_state->__pyx_n_s_diff); + Py_CLEAR(clear_module_state->__pyx_n_s_double); + Py_CLEAR(clear_module_state->__pyx_n_s_drift); + Py_CLEAR(clear_module_state->__pyx_n_s_dtype); + Py_CLEAR(clear_module_state->__pyx_n_s_empty); + Py_CLEAR(clear_module_state->__pyx_n_s_err); + Py_CLEAR(clear_module_state->__pyx_n_s_exp); + Py_CLEAR(clear_module_state->__pyx_n_s_feedback); + Py_CLEAR(clear_module_state->__pyx_n_s_feedbacks); + Py_CLEAR(clear_module_state->__pyx_n_s_float32); + Py_CLEAR(clear_module_state->__pyx_n_s_full_pdf); + Py_CLEAR(clear_module_state->__pyx_n_s_gen_cdf_using_pdf); + Py_CLEAR(clear_module_state->__pyx_kp_s_hddm_wfpt_pdf_pxi); + Py_CLEAR(clear_module_state->__pyx_kp_s_hddm_wfpt_wfpt_pyx); + Py_CLEAR(clear_module_state->__pyx_n_s_i); + Py_CLEAR(clear_module_state->__pyx_n_s_i_p); + Py_CLEAR(clear_module_state->__pyx_n_s_idx); + Py_CLEAR(clear_module_state->__pyx_n_s_ij); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_inf); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_integrate); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_s_j); + Py_CLEAR(clear_module_state->__pyx_n_s_lb); + Py_CLEAR(clear_module_state->__pyx_n_s_linspace); + Py_CLEAR(clear_module_state->__pyx_n_s_ll_min); + Py_CLEAR(clear_module_state->__pyx_n_s_log); + Py_CLEAR(clear_module_state->__pyx_n_s_log_p); + Py_CLEAR(clear_module_state->__pyx_n_s_logp); + Py_CLEAR(clear_module_state->__pyx_n_s_lower_bnd); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_max); + Py_CLEAR(clear_module_state->__pyx_n_s_maximum); + Py_CLEAR(clear_module_state->__pyx_n_s_min); + Py_CLEAR(clear_module_state->__pyx_n_s_model); + Py_CLEAR(clear_module_state->__pyx_n_s_multi); + Py_CLEAR(clear_module_state->__pyx_n_s_n_cont); + Py_CLEAR(clear_module_state->__pyx_n_s_n_params); + Py_CLEAR(clear_module_state->__pyx_n_s_n_st); + Py_CLEAR(clear_module_state->__pyx_n_s_n_sz); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_network); + Py_CLEAR(clear_module_state->__pyx_n_s_np); + Py_CLEAR(clear_module_state->__pyx_n_s_numpy); + Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); + Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); + Py_CLEAR(clear_module_state->__pyx_n_s_p); + Py_CLEAR(clear_module_state->__pyx_n_s_p_outlier); + Py_CLEAR(clear_module_state->__pyx_n_s_param); + Py_CLEAR(clear_module_state->__pyx_n_s_params); + Py_CLEAR(clear_module_state->__pyx_n_s_params_bnds); + Py_CLEAR(clear_module_state->__pyx_n_s_params_iter); + Py_CLEAR(clear_module_state->__pyx_n_s_params_rl); + Py_CLEAR(clear_module_state->__pyx_n_s_params_ssm); + Py_CLEAR(clear_module_state->__pyx_n_s_pdf_array); + Py_CLEAR(clear_module_state->__pyx_n_s_pos_alfa); + Py_CLEAR(clear_module_state->__pyx_n_s_pos_alpha); + Py_CLEAR(clear_module_state->__pyx_n_s_pos_cont); + Py_CLEAR(clear_module_state->__pyx_n_s_predict_on_batch); + Py_CLEAR(clear_module_state->__pyx_n_s_q); + Py_CLEAR(clear_module_state->__pyx_n_s_qs); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_response); + Py_CLEAR(clear_module_state->__pyx_n_s_responses); + Py_CLEAR(clear_module_state->__pyx_n_s_responses_qs); + Py_CLEAR(clear_module_state->__pyx_n_s_rl_alpha); + Py_CLEAR(clear_module_state->__pyx_n_s_rl_arr); + Py_CLEAR(clear_module_state->__pyx_n_s_s); + Py_CLEAR(clear_module_state->__pyx_n_s_s_size); + Py_CLEAR(clear_module_state->__pyx_n_s_scipy); + Py_CLEAR(clear_module_state->__pyx_n_s_scipy_integrate); + Py_CLEAR(clear_module_state->__pyx_n_s_simps_err); + Py_CLEAR(clear_module_state->__pyx_n_s_size); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_split_by); + Py_CLEAR(clear_module_state->__pyx_n_s_split_cdf); + Py_CLEAR(clear_module_state->__pyx_n_s_squeeze); + Py_CLEAR(clear_module_state->__pyx_n_s_st); + Py_CLEAR(clear_module_state->__pyx_n_u_st); + Py_CLEAR(clear_module_state->__pyx_n_s_stack); + Py_CLEAR(clear_module_state->__pyx_n_s_sum); + Py_CLEAR(clear_module_state->__pyx_n_s_sum_logp); + Py_CLEAR(clear_module_state->__pyx_n_s_sv); + Py_CLEAR(clear_module_state->__pyx_n_u_sv); + Py_CLEAR(clear_module_state->__pyx_n_s_sz); + Py_CLEAR(clear_module_state->__pyx_n_u_sz); + Py_CLEAR(clear_module_state->__pyx_n_s_t); + Py_CLEAR(clear_module_state->__pyx_n_u_t); + Py_CLEAR(clear_module_state->__pyx_n_s_t_max); + Py_CLEAR(clear_module_state->__pyx_n_s_t_min); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_tile); + Py_CLEAR(clear_module_state->__pyx_n_s_time); + Py_CLEAR(clear_module_state->__pyx_n_s_tp_scale); + Py_CLEAR(clear_module_state->__pyx_n_s_ub); + Py_CLEAR(clear_module_state->__pyx_n_s_umath); + Py_CLEAR(clear_module_state->__pyx_n_s_unique); + Py_CLEAR(clear_module_state->__pyx_n_s_upper_bnd); + Py_CLEAR(clear_module_state->__pyx_n_s_use_adaptive); + Py_CLEAR(clear_module_state->__pyx_n_s_v); + Py_CLEAR(clear_module_state->__pyx_n_u_v); + Py_CLEAR(clear_module_state->__pyx_n_s_w_outlier); + Py_CLEAR(clear_module_state->__pyx_n_s_wfpt); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_contaminant); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_multi); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_multi_nn_mlp); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_multi_nn_mlp_pdf); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_multi_rlddm); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_rl); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_rlddm); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_rlssm_nn); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_rlssm_nn_reg); + Py_CLEAR(clear_module_state->__pyx_n_s_wiener_logp_array); + Py_CLEAR(clear_module_state->__pyx_n_s_wp_outlier); + Py_CLEAR(clear_module_state->__pyx_n_s_x); + Py_CLEAR(clear_module_state->__pyx_n_s_x_lb); + Py_CLEAR(clear_module_state->__pyx_n_s_x_ub); + Py_CLEAR(clear_module_state->__pyx_n_s_xs); + Py_CLEAR(clear_module_state->__pyx_n_s_y); + Py_CLEAR(clear_module_state->__pyx_n_s_z); + Py_CLEAR(clear_module_state->__pyx_n_u_z); + Py_CLEAR(clear_module_state->__pyx_n_s_zeros); + Py_CLEAR(clear_module_state->__pyx_float_1eneg_3); + Py_CLEAR(clear_module_state->__pyx_float_2_718281828459); + Py_CLEAR(clear_module_state->__pyx_int_0); + Py_CLEAR(clear_module_state->__pyx_int_1); + Py_CLEAR(clear_module_state->__pyx_int_2); + Py_CLEAR(clear_module_state->__pyx_int_neg_1); + Py_CLEAR(clear_module_state->__pyx_tuple_); + Py_CLEAR(clear_module_state->__pyx_slice__7); + Py_CLEAR(clear_module_state->__pyx_tuple__2); + Py_CLEAR(clear_module_state->__pyx_slice__10); + Py_CLEAR(clear_module_state->__pyx_slice__19); + Py_CLEAR(clear_module_state->__pyx_tuple__17); + Py_CLEAR(clear_module_state->__pyx_tuple__22); + Py_CLEAR(clear_module_state->__pyx_tuple__25); + Py_CLEAR(clear_module_state->__pyx_tuple__26); + Py_CLEAR(clear_module_state->__pyx_tuple__27); + Py_CLEAR(clear_module_state->__pyx_tuple__28); + Py_CLEAR(clear_module_state->__pyx_tuple__29); + Py_CLEAR(clear_module_state->__pyx_tuple__30); + Py_CLEAR(clear_module_state->__pyx_tuple__31); + Py_CLEAR(clear_module_state->__pyx_tuple__32); + Py_CLEAR(clear_module_state->__pyx_tuple__33); + Py_CLEAR(clear_module_state->__pyx_tuple__34); + Py_CLEAR(clear_module_state->__pyx_tuple__35); + Py_CLEAR(clear_module_state->__pyx_tuple__36); + Py_CLEAR(clear_module_state->__pyx_tuple__37); + Py_CLEAR(clear_module_state->__pyx_tuple__38); + Py_CLEAR(clear_module_state->__pyx_tuple__39); + Py_CLEAR(clear_module_state->__pyx_codeobj__3); + Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_codeobj__5); + Py_CLEAR(clear_module_state->__pyx_codeobj__6); + Py_CLEAR(clear_module_state->__pyx_codeobj__8); + Py_CLEAR(clear_module_state->__pyx_codeobj__9); + Py_CLEAR(clear_module_state->__pyx_codeobj__11); + Py_CLEAR(clear_module_state->__pyx_codeobj__12); + Py_CLEAR(clear_module_state->__pyx_codeobj__13); + Py_CLEAR(clear_module_state->__pyx_codeobj__14); + Py_CLEAR(clear_module_state->__pyx_codeobj__15); + Py_CLEAR(clear_module_state->__pyx_codeobj__16); + Py_CLEAR(clear_module_state->__pyx_codeobj__18); + Py_CLEAR(clear_module_state->__pyx_codeobj__20); + Py_CLEAR(clear_module_state->__pyx_codeobj__21); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc); + Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); + Py_VISIT(traverse_module_state->__pyx_n_s_N); + Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); + Py_VISIT(traverse_module_state->__pyx_n_s__23); + Py_VISIT(traverse_module_state->__pyx_kp_u__24); + Py_VISIT(traverse_module_state->__pyx_n_s__40); + Py_VISIT(traverse_module_state->__pyx_n_s_a); + Py_VISIT(traverse_module_state->__pyx_n_u_a); + Py_VISIT(traverse_module_state->__pyx_n_s_alfa); + Py_VISIT(traverse_module_state->__pyx_n_s_alpha); + Py_VISIT(traverse_module_state->__pyx_n_u_alpha); + Py_VISIT(traverse_module_state->__pyx_n_s_arange); + Py_VISIT(traverse_module_state->__pyx_n_s_array); + Py_VISIT(traverse_module_state->__pyx_n_s_astype); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_kp_u_at_least_one_of_the_parameters_i); + Py_VISIT(traverse_module_state->__pyx_n_s_axis); + Py_VISIT(traverse_module_state->__pyx_n_s_cdf_array); + Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_concatenate); + Py_VISIT(traverse_module_state->__pyx_n_s_cont_x); + Py_VISIT(traverse_module_state->__pyx_n_s_copy); + Py_VISIT(traverse_module_state->__pyx_n_s_core); + Py_VISIT(traverse_module_state->__pyx_n_s_cumm_s_size); + Py_VISIT(traverse_module_state->__pyx_n_s_cumsum); + Py_VISIT(traverse_module_state->__pyx_n_s_cumtrapz); + Py_VISIT(traverse_module_state->__pyx_n_s_data); + Py_VISIT(traverse_module_state->__pyx_n_s_data_copy); + Py_VISIT(traverse_module_state->__pyx_n_s_diff); + Py_VISIT(traverse_module_state->__pyx_n_s_double); + Py_VISIT(traverse_module_state->__pyx_n_s_drift); + Py_VISIT(traverse_module_state->__pyx_n_s_dtype); + Py_VISIT(traverse_module_state->__pyx_n_s_empty); + Py_VISIT(traverse_module_state->__pyx_n_s_err); + Py_VISIT(traverse_module_state->__pyx_n_s_exp); + Py_VISIT(traverse_module_state->__pyx_n_s_feedback); + Py_VISIT(traverse_module_state->__pyx_n_s_feedbacks); + Py_VISIT(traverse_module_state->__pyx_n_s_float32); + Py_VISIT(traverse_module_state->__pyx_n_s_full_pdf); + Py_VISIT(traverse_module_state->__pyx_n_s_gen_cdf_using_pdf); + Py_VISIT(traverse_module_state->__pyx_kp_s_hddm_wfpt_pdf_pxi); + Py_VISIT(traverse_module_state->__pyx_kp_s_hddm_wfpt_wfpt_pyx); + Py_VISIT(traverse_module_state->__pyx_n_s_i); + Py_VISIT(traverse_module_state->__pyx_n_s_i_p); + Py_VISIT(traverse_module_state->__pyx_n_s_idx); + Py_VISIT(traverse_module_state->__pyx_n_s_ij); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_inf); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_integrate); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_s_j); + Py_VISIT(traverse_module_state->__pyx_n_s_lb); + Py_VISIT(traverse_module_state->__pyx_n_s_linspace); + Py_VISIT(traverse_module_state->__pyx_n_s_ll_min); + Py_VISIT(traverse_module_state->__pyx_n_s_log); + Py_VISIT(traverse_module_state->__pyx_n_s_log_p); + Py_VISIT(traverse_module_state->__pyx_n_s_logp); + Py_VISIT(traverse_module_state->__pyx_n_s_lower_bnd); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_max); + Py_VISIT(traverse_module_state->__pyx_n_s_maximum); + Py_VISIT(traverse_module_state->__pyx_n_s_min); + Py_VISIT(traverse_module_state->__pyx_n_s_model); + Py_VISIT(traverse_module_state->__pyx_n_s_multi); + Py_VISIT(traverse_module_state->__pyx_n_s_n_cont); + Py_VISIT(traverse_module_state->__pyx_n_s_n_params); + Py_VISIT(traverse_module_state->__pyx_n_s_n_st); + Py_VISIT(traverse_module_state->__pyx_n_s_n_sz); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_network); + Py_VISIT(traverse_module_state->__pyx_n_s_np); + Py_VISIT(traverse_module_state->__pyx_n_s_numpy); + Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); + Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); + Py_VISIT(traverse_module_state->__pyx_n_s_p); + Py_VISIT(traverse_module_state->__pyx_n_s_p_outlier); + Py_VISIT(traverse_module_state->__pyx_n_s_param); + Py_VISIT(traverse_module_state->__pyx_n_s_params); + Py_VISIT(traverse_module_state->__pyx_n_s_params_bnds); + Py_VISIT(traverse_module_state->__pyx_n_s_params_iter); + Py_VISIT(traverse_module_state->__pyx_n_s_params_rl); + Py_VISIT(traverse_module_state->__pyx_n_s_params_ssm); + Py_VISIT(traverse_module_state->__pyx_n_s_pdf_array); + Py_VISIT(traverse_module_state->__pyx_n_s_pos_alfa); + Py_VISIT(traverse_module_state->__pyx_n_s_pos_alpha); + Py_VISIT(traverse_module_state->__pyx_n_s_pos_cont); + Py_VISIT(traverse_module_state->__pyx_n_s_predict_on_batch); + Py_VISIT(traverse_module_state->__pyx_n_s_q); + Py_VISIT(traverse_module_state->__pyx_n_s_qs); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_response); + Py_VISIT(traverse_module_state->__pyx_n_s_responses); + Py_VISIT(traverse_module_state->__pyx_n_s_responses_qs); + Py_VISIT(traverse_module_state->__pyx_n_s_rl_alpha); + Py_VISIT(traverse_module_state->__pyx_n_s_rl_arr); + Py_VISIT(traverse_module_state->__pyx_n_s_s); + Py_VISIT(traverse_module_state->__pyx_n_s_s_size); + Py_VISIT(traverse_module_state->__pyx_n_s_scipy); + Py_VISIT(traverse_module_state->__pyx_n_s_scipy_integrate); + Py_VISIT(traverse_module_state->__pyx_n_s_simps_err); + Py_VISIT(traverse_module_state->__pyx_n_s_size); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_split_by); + Py_VISIT(traverse_module_state->__pyx_n_s_split_cdf); + Py_VISIT(traverse_module_state->__pyx_n_s_squeeze); + Py_VISIT(traverse_module_state->__pyx_n_s_st); + Py_VISIT(traverse_module_state->__pyx_n_u_st); + Py_VISIT(traverse_module_state->__pyx_n_s_stack); + Py_VISIT(traverse_module_state->__pyx_n_s_sum); + Py_VISIT(traverse_module_state->__pyx_n_s_sum_logp); + Py_VISIT(traverse_module_state->__pyx_n_s_sv); + Py_VISIT(traverse_module_state->__pyx_n_u_sv); + Py_VISIT(traverse_module_state->__pyx_n_s_sz); + Py_VISIT(traverse_module_state->__pyx_n_u_sz); + Py_VISIT(traverse_module_state->__pyx_n_s_t); + Py_VISIT(traverse_module_state->__pyx_n_u_t); + Py_VISIT(traverse_module_state->__pyx_n_s_t_max); + Py_VISIT(traverse_module_state->__pyx_n_s_t_min); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_tile); + Py_VISIT(traverse_module_state->__pyx_n_s_time); + Py_VISIT(traverse_module_state->__pyx_n_s_tp_scale); + Py_VISIT(traverse_module_state->__pyx_n_s_ub); + Py_VISIT(traverse_module_state->__pyx_n_s_umath); + Py_VISIT(traverse_module_state->__pyx_n_s_unique); + Py_VISIT(traverse_module_state->__pyx_n_s_upper_bnd); + Py_VISIT(traverse_module_state->__pyx_n_s_use_adaptive); + Py_VISIT(traverse_module_state->__pyx_n_s_v); + Py_VISIT(traverse_module_state->__pyx_n_u_v); + Py_VISIT(traverse_module_state->__pyx_n_s_w_outlier); + Py_VISIT(traverse_module_state->__pyx_n_s_wfpt); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_contaminant); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_multi); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_multi_nn_mlp); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_multi_nn_mlp_pdf); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_multi_rlddm); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_rl); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_rlddm); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_rlssm_nn); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_rlssm_nn_reg); + Py_VISIT(traverse_module_state->__pyx_n_s_wiener_logp_array); + Py_VISIT(traverse_module_state->__pyx_n_s_wp_outlier); + Py_VISIT(traverse_module_state->__pyx_n_s_x); + Py_VISIT(traverse_module_state->__pyx_n_s_x_lb); + Py_VISIT(traverse_module_state->__pyx_n_s_x_ub); + Py_VISIT(traverse_module_state->__pyx_n_s_xs); + Py_VISIT(traverse_module_state->__pyx_n_s_y); + Py_VISIT(traverse_module_state->__pyx_n_s_z); + Py_VISIT(traverse_module_state->__pyx_n_u_z); + Py_VISIT(traverse_module_state->__pyx_n_s_zeros); + Py_VISIT(traverse_module_state->__pyx_float_1eneg_3); + Py_VISIT(traverse_module_state->__pyx_float_2_718281828459); + Py_VISIT(traverse_module_state->__pyx_int_0); + Py_VISIT(traverse_module_state->__pyx_int_1); + Py_VISIT(traverse_module_state->__pyx_int_2); + Py_VISIT(traverse_module_state->__pyx_int_neg_1); + Py_VISIT(traverse_module_state->__pyx_tuple_); + Py_VISIT(traverse_module_state->__pyx_slice__7); + Py_VISIT(traverse_module_state->__pyx_tuple__2); + Py_VISIT(traverse_module_state->__pyx_slice__10); + Py_VISIT(traverse_module_state->__pyx_slice__19); + Py_VISIT(traverse_module_state->__pyx_tuple__17); + Py_VISIT(traverse_module_state->__pyx_tuple__22); + Py_VISIT(traverse_module_state->__pyx_tuple__25); + Py_VISIT(traverse_module_state->__pyx_tuple__26); + Py_VISIT(traverse_module_state->__pyx_tuple__27); + Py_VISIT(traverse_module_state->__pyx_tuple__28); + Py_VISIT(traverse_module_state->__pyx_tuple__29); + Py_VISIT(traverse_module_state->__pyx_tuple__30); + Py_VISIT(traverse_module_state->__pyx_tuple__31); + Py_VISIT(traverse_module_state->__pyx_tuple__32); + Py_VISIT(traverse_module_state->__pyx_tuple__33); + Py_VISIT(traverse_module_state->__pyx_tuple__34); + Py_VISIT(traverse_module_state->__pyx_tuple__35); + Py_VISIT(traverse_module_state->__pyx_tuple__36); + Py_VISIT(traverse_module_state->__pyx_tuple__37); + Py_VISIT(traverse_module_state->__pyx_tuple__38); + Py_VISIT(traverse_module_state->__pyx_tuple__39); + Py_VISIT(traverse_module_state->__pyx_codeobj__3); + Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_codeobj__5); + Py_VISIT(traverse_module_state->__pyx_codeobj__6); + Py_VISIT(traverse_module_state->__pyx_codeobj__8); + Py_VISIT(traverse_module_state->__pyx_codeobj__9); + Py_VISIT(traverse_module_state->__pyx_codeobj__11); + Py_VISIT(traverse_module_state->__pyx_codeobj__12); + Py_VISIT(traverse_module_state->__pyx_codeobj__13); + Py_VISIT(traverse_module_state->__pyx_codeobj__14); + Py_VISIT(traverse_module_state->__pyx_codeobj__15); + Py_VISIT(traverse_module_state->__pyx_codeobj__16); + Py_VISIT(traverse_module_state->__pyx_codeobj__18); + Py_VISIT(traverse_module_state->__pyx_codeobj__20); + Py_VISIT(traverse_module_state->__pyx_codeobj__21); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype +#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter +#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast +#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray +#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic +#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number +#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer +#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger +#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger +#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact +#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating +#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating +#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible +#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character +#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError +#define __pyx_n_s_N __pyx_mstate_global->__pyx_n_s_N +#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError +#define __pyx_n_s__23 __pyx_mstate_global->__pyx_n_s__23 +#define __pyx_kp_u__24 __pyx_mstate_global->__pyx_kp_u__24 +#define __pyx_n_s__40 __pyx_mstate_global->__pyx_n_s__40 +#define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a +#define __pyx_n_u_a __pyx_mstate_global->__pyx_n_u_a +#define __pyx_n_s_alfa __pyx_mstate_global->__pyx_n_s_alfa +#define __pyx_n_s_alpha __pyx_mstate_global->__pyx_n_s_alpha +#define __pyx_n_u_alpha __pyx_mstate_global->__pyx_n_u_alpha +#define __pyx_n_s_arange __pyx_mstate_global->__pyx_n_s_arange +#define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array +#define __pyx_n_s_astype __pyx_mstate_global->__pyx_n_s_astype +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_kp_u_at_least_one_of_the_parameters_i __pyx_mstate_global->__pyx_kp_u_at_least_one_of_the_parameters_i +#define __pyx_n_s_axis __pyx_mstate_global->__pyx_n_s_axis +#define __pyx_n_s_cdf_array __pyx_mstate_global->__pyx_n_s_cdf_array +#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_concatenate __pyx_mstate_global->__pyx_n_s_concatenate +#define __pyx_n_s_cont_x __pyx_mstate_global->__pyx_n_s_cont_x +#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy +#define __pyx_n_s_core __pyx_mstate_global->__pyx_n_s_core +#define __pyx_n_s_cumm_s_size __pyx_mstate_global->__pyx_n_s_cumm_s_size +#define __pyx_n_s_cumsum __pyx_mstate_global->__pyx_n_s_cumsum +#define __pyx_n_s_cumtrapz __pyx_mstate_global->__pyx_n_s_cumtrapz +#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data +#define __pyx_n_s_data_copy __pyx_mstate_global->__pyx_n_s_data_copy +#define __pyx_n_s_diff __pyx_mstate_global->__pyx_n_s_diff +#define __pyx_n_s_double __pyx_mstate_global->__pyx_n_s_double +#define __pyx_n_s_drift __pyx_mstate_global->__pyx_n_s_drift +#define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype +#define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty +#define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err +#define __pyx_n_s_exp __pyx_mstate_global->__pyx_n_s_exp +#define __pyx_n_s_feedback __pyx_mstate_global->__pyx_n_s_feedback +#define __pyx_n_s_feedbacks __pyx_mstate_global->__pyx_n_s_feedbacks +#define __pyx_n_s_float32 __pyx_mstate_global->__pyx_n_s_float32 +#define __pyx_n_s_full_pdf __pyx_mstate_global->__pyx_n_s_full_pdf +#define __pyx_n_s_gen_cdf_using_pdf __pyx_mstate_global->__pyx_n_s_gen_cdf_using_pdf +#define __pyx_kp_s_hddm_wfpt_pdf_pxi __pyx_mstate_global->__pyx_kp_s_hddm_wfpt_pdf_pxi +#define __pyx_kp_s_hddm_wfpt_wfpt_pyx __pyx_mstate_global->__pyx_kp_s_hddm_wfpt_wfpt_pyx +#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i +#define __pyx_n_s_i_p __pyx_mstate_global->__pyx_n_s_i_p +#define __pyx_n_s_idx __pyx_mstate_global->__pyx_n_s_idx +#define __pyx_n_s_ij __pyx_mstate_global->__pyx_n_s_ij +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_inf __pyx_mstate_global->__pyx_n_s_inf +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_integrate __pyx_mstate_global->__pyx_n_s_integrate +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j +#define __pyx_n_s_lb __pyx_mstate_global->__pyx_n_s_lb +#define __pyx_n_s_linspace __pyx_mstate_global->__pyx_n_s_linspace +#define __pyx_n_s_ll_min __pyx_mstate_global->__pyx_n_s_ll_min +#define __pyx_n_s_log __pyx_mstate_global->__pyx_n_s_log +#define __pyx_n_s_log_p __pyx_mstate_global->__pyx_n_s_log_p +#define __pyx_n_s_logp __pyx_mstate_global->__pyx_n_s_logp +#define __pyx_n_s_lower_bnd __pyx_mstate_global->__pyx_n_s_lower_bnd +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max +#define __pyx_n_s_maximum __pyx_mstate_global->__pyx_n_s_maximum +#define __pyx_n_s_min __pyx_mstate_global->__pyx_n_s_min +#define __pyx_n_s_model __pyx_mstate_global->__pyx_n_s_model +#define __pyx_n_s_multi __pyx_mstate_global->__pyx_n_s_multi +#define __pyx_n_s_n_cont __pyx_mstate_global->__pyx_n_s_n_cont +#define __pyx_n_s_n_params __pyx_mstate_global->__pyx_n_s_n_params +#define __pyx_n_s_n_st __pyx_mstate_global->__pyx_n_s_n_st +#define __pyx_n_s_n_sz __pyx_mstate_global->__pyx_n_s_n_sz +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_network __pyx_mstate_global->__pyx_n_s_network +#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np +#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy +#define __pyx_kp_u_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy_core_multiarray_failed_to +#define __pyx_kp_u_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_u_numpy_core_umath_failed_to_impor +#define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p +#define __pyx_n_s_p_outlier __pyx_mstate_global->__pyx_n_s_p_outlier +#define __pyx_n_s_param __pyx_mstate_global->__pyx_n_s_param +#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params +#define __pyx_n_s_params_bnds __pyx_mstate_global->__pyx_n_s_params_bnds +#define __pyx_n_s_params_iter __pyx_mstate_global->__pyx_n_s_params_iter +#define __pyx_n_s_params_rl __pyx_mstate_global->__pyx_n_s_params_rl +#define __pyx_n_s_params_ssm __pyx_mstate_global->__pyx_n_s_params_ssm +#define __pyx_n_s_pdf_array __pyx_mstate_global->__pyx_n_s_pdf_array +#define __pyx_n_s_pos_alfa __pyx_mstate_global->__pyx_n_s_pos_alfa +#define __pyx_n_s_pos_alpha __pyx_mstate_global->__pyx_n_s_pos_alpha +#define __pyx_n_s_pos_cont __pyx_mstate_global->__pyx_n_s_pos_cont +#define __pyx_n_s_predict_on_batch __pyx_mstate_global->__pyx_n_s_predict_on_batch +#define __pyx_n_s_q __pyx_mstate_global->__pyx_n_s_q +#define __pyx_n_s_qs __pyx_mstate_global->__pyx_n_s_qs +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_response __pyx_mstate_global->__pyx_n_s_response +#define __pyx_n_s_responses __pyx_mstate_global->__pyx_n_s_responses +#define __pyx_n_s_responses_qs __pyx_mstate_global->__pyx_n_s_responses_qs +#define __pyx_n_s_rl_alpha __pyx_mstate_global->__pyx_n_s_rl_alpha +#define __pyx_n_s_rl_arr __pyx_mstate_global->__pyx_n_s_rl_arr +#define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s +#define __pyx_n_s_s_size __pyx_mstate_global->__pyx_n_s_s_size +#define __pyx_n_s_scipy __pyx_mstate_global->__pyx_n_s_scipy +#define __pyx_n_s_scipy_integrate __pyx_mstate_global->__pyx_n_s_scipy_integrate +#define __pyx_n_s_simps_err __pyx_mstate_global->__pyx_n_s_simps_err +#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_split_by __pyx_mstate_global->__pyx_n_s_split_by +#define __pyx_n_s_split_cdf __pyx_mstate_global->__pyx_n_s_split_cdf +#define __pyx_n_s_squeeze __pyx_mstate_global->__pyx_n_s_squeeze +#define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st +#define __pyx_n_u_st __pyx_mstate_global->__pyx_n_u_st +#define __pyx_n_s_stack __pyx_mstate_global->__pyx_n_s_stack +#define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum +#define __pyx_n_s_sum_logp __pyx_mstate_global->__pyx_n_s_sum_logp +#define __pyx_n_s_sv __pyx_mstate_global->__pyx_n_s_sv +#define __pyx_n_u_sv __pyx_mstate_global->__pyx_n_u_sv +#define __pyx_n_s_sz __pyx_mstate_global->__pyx_n_s_sz +#define __pyx_n_u_sz __pyx_mstate_global->__pyx_n_u_sz +#define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t +#define __pyx_n_u_t __pyx_mstate_global->__pyx_n_u_t +#define __pyx_n_s_t_max __pyx_mstate_global->__pyx_n_s_t_max +#define __pyx_n_s_t_min __pyx_mstate_global->__pyx_n_s_t_min +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_tile __pyx_mstate_global->__pyx_n_s_tile +#define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time +#define __pyx_n_s_tp_scale __pyx_mstate_global->__pyx_n_s_tp_scale +#define __pyx_n_s_ub __pyx_mstate_global->__pyx_n_s_ub +#define __pyx_n_s_umath __pyx_mstate_global->__pyx_n_s_umath +#define __pyx_n_s_unique __pyx_mstate_global->__pyx_n_s_unique +#define __pyx_n_s_upper_bnd __pyx_mstate_global->__pyx_n_s_upper_bnd +#define __pyx_n_s_use_adaptive __pyx_mstate_global->__pyx_n_s_use_adaptive +#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v +#define __pyx_n_u_v __pyx_mstate_global->__pyx_n_u_v +#define __pyx_n_s_w_outlier __pyx_mstate_global->__pyx_n_s_w_outlier +#define __pyx_n_s_wfpt __pyx_mstate_global->__pyx_n_s_wfpt +#define __pyx_n_s_wiener_like __pyx_mstate_global->__pyx_n_s_wiener_like +#define __pyx_n_s_wiener_like_contaminant __pyx_mstate_global->__pyx_n_s_wiener_like_contaminant +#define __pyx_n_s_wiener_like_multi __pyx_mstate_global->__pyx_n_s_wiener_like_multi +#define __pyx_n_s_wiener_like_multi_nn_mlp __pyx_mstate_global->__pyx_n_s_wiener_like_multi_nn_mlp +#define __pyx_n_s_wiener_like_multi_nn_mlp_pdf __pyx_mstate_global->__pyx_n_s_wiener_like_multi_nn_mlp_pdf +#define __pyx_n_s_wiener_like_multi_rlddm __pyx_mstate_global->__pyx_n_s_wiener_like_multi_rlddm +#define __pyx_n_s_wiener_like_rl __pyx_mstate_global->__pyx_n_s_wiener_like_rl +#define __pyx_n_s_wiener_like_rlddm __pyx_mstate_global->__pyx_n_s_wiener_like_rlddm +#define __pyx_n_s_wiener_like_rlssm_nn __pyx_mstate_global->__pyx_n_s_wiener_like_rlssm_nn +#define __pyx_n_s_wiener_like_rlssm_nn_reg __pyx_mstate_global->__pyx_n_s_wiener_like_rlssm_nn_reg +#define __pyx_n_s_wiener_logp_array __pyx_mstate_global->__pyx_n_s_wiener_logp_array +#define __pyx_n_s_wp_outlier __pyx_mstate_global->__pyx_n_s_wp_outlier +#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x +#define __pyx_n_s_x_lb __pyx_mstate_global->__pyx_n_s_x_lb +#define __pyx_n_s_x_ub __pyx_mstate_global->__pyx_n_s_x_ub +#define __pyx_n_s_xs __pyx_mstate_global->__pyx_n_s_xs +#define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y +#define __pyx_n_s_z __pyx_mstate_global->__pyx_n_s_z +#define __pyx_n_u_z __pyx_mstate_global->__pyx_n_u_z +#define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros +#define __pyx_float_1eneg_3 __pyx_mstate_global->__pyx_float_1eneg_3 +#define __pyx_float_2_718281828459 __pyx_mstate_global->__pyx_float_2_718281828459 +#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 +#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 +#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 +#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 +#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ +#define __pyx_slice__7 __pyx_mstate_global->__pyx_slice__7 +#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 +#define __pyx_slice__10 __pyx_mstate_global->__pyx_slice__10 +#define __pyx_slice__19 __pyx_mstate_global->__pyx_slice__19 +#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 +#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 +#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 +#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 +#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 +#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 +#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 +#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 +#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 +#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 +#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 +#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 +#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 +#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 +#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 +#define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 +#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 +#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 +#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 +#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 +#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 +#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 +#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 +#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 +#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 +#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 +#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 +#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 +#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 +#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 +#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 +/* #### Code section: module_code ### */ + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + * + * @property + * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { + PyObject *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("base", __pyx_f[1], 245, 1, __PYX_ERR(1, 245, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248 + * """Returns a borrowed reference to the object owning the data/memory. + * """ + * return PyArray_BASE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(248,1,__PYX_ERR(1, 248, __pyx_L1_error)) + __pyx_r = PyArray_BASE(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + * + * @property + * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.base.base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + +static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) { + PyArray_Descr *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyArray_Descr *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("descr", 0); + __Pyx_TraceCall("descr", __pyx_f[1], 251, 0, __PYX_ERR(1, 251, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254 + * """Returns an owned reference to the dtype of the array. + * """ + * return PyArray_DESCR(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error)) + __Pyx_XDECREF((PyObject *)__pyx_r); + __pyx_t_1 = PyArray_DESCR(__pyx_v_self); + __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1)); + __pyx_r = ((PyArray_Descr *)__pyx_t_1); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.ndarray.descr.descr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + * + * @property + * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + +static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { + int __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("ndim", __pyx_f[1], 257, 1, __PYX_ERR(1, 257, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260 + * """Returns the number of dimensions in the array. + * """ + * return PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(260,1,__PYX_ERR(1, 260, __pyx_L1_error)) + __pyx_r = PyArray_NDIM(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + * + * @property + * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.ndim.ndim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + * + * @property + * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { + npy_intp *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("shape", __pyx_f[1], 263, 1, __PYX_ERR(1, 263, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268 + * Can return NULL for 0-dimensional arrays. + * """ + * return PyArray_DIMS(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(268,1,__PYX_ERR(1, 268, __pyx_L1_error)) + __pyx_r = PyArray_DIMS(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + * + * @property + * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.shape.shape", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + * + * @property + * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { + npy_intp *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("strides", __pyx_f[1], 271, 1, __PYX_ERR(1, 271, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275 + * The number of elements matches the number of dimensions of the array (ndim). + * """ + * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(275,1,__PYX_ERR(1, 275, __pyx_L1_error)) + __pyx_r = PyArray_STRIDES(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + * + * @property + * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.strides.strides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + * + * @property + * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { + npy_intp __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("size", __pyx_f[1], 278, 1, __PYX_ERR(1, 278, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281 + * """Returns the total size (in number of elements) of the array. + * """ + * return PyArray_SIZE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_TraceLine(281,1,__PYX_ERR(1, 281, __pyx_L1_error)) + __pyx_r = PyArray_SIZE(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + * + * @property + * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.size.size", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + * + * @property + * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { + char *__pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("data", __pyx_f[1], 284, 1, __PYX_ERR(1, 284, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290 + * of `PyArray_DATA()` instead, which returns a 'void*'. + * """ + * return PyArray_BYTES(self) # <<<<<<<<<<<<<< + * + * ctypedef unsigned char npy_bool + */ + __Pyx_TraceLine(290,1,__PYX_ERR(1, 290, __pyx_L1_error)) + __pyx_r = PyArray_BYTES(__pyx_v_self); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + * + * @property + * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.ndarray.data.data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[1], 773, 0, __PYX_ERR(1, 773, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[1], 776, 0, __PYX_ERR(1, 776, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[1], 779, 0, __PYX_ERR(1, 779, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __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(1, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +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) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[1], 782, 0, __PYX_ERR(1, 782, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __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(1, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +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) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[1], 785, 0, __PYX_ERR(1, 785, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + */ + __Pyx_TraceLine(786,0,__PYX_ERR(1, 786, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __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(1, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[1], 788, 0, __PYX_ERR(1, 788, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __Pyx_TraceLine(789,0,__PYX_ERR(1, 789, __pyx_L1_error)) + __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); + if (__pyx_t_1) { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":790 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_TraceLine(790,0,__PYX_ERR(1, 790, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(792,0,__PYX_ERR(1, 792, __pyx_L1_error)) + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_array_base", 0); + __Pyx_TraceCall("set_array_base", __pyx_f[1], 967, 0, __PYX_ERR(1, 967, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 + * + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< + * PyArray_SetBaseObject(arr, base) + * + */ + __Pyx_TraceLine(968,0,__PYX_ERR(1, 968, __pyx_L1_error)) + Py_INCREF(__pyx_v_base); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __Pyx_TraceLine(969,0,__PYX_ERR(1, 969, __pyx_L1_error)) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_v_base; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_array_base", 0); + __Pyx_TraceCall("get_array_base", __pyx_f[1], 971, 0, __PYX_ERR(1, 971, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 + * + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< + * if base is NULL: + * return None + */ + __Pyx_TraceLine(972,0,__PYX_ERR(1, 972, __pyx_L1_error)) + __pyx_v_base = PyArray_BASE(__pyx_v_arr); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + __Pyx_TraceLine(973,0,__PYX_ERR(1, 973, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_base == NULL); + if (__pyx_t_1) { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 + * base = PyArray_BASE(arr) + * if base is NULL: + * return None # <<<<<<<<<<<<<< + * return base + * + */ + __Pyx_TraceLine(974,0,__PYX_ERR(1, 974, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 + * if base is NULL: + * return None + * return base # <<<<<<<<<<<<<< + * + * # Versions of the import_* functions which are more suitable for + */ + __Pyx_TraceLine(975,0,__PYX_ERR(1, 975, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_array", 0); + __Pyx_TraceCall("import_array", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __Pyx_TraceLine(980,0,__PYX_ERR(1, 980, __pyx_L1_error)) + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 + * cdef inline int import_array() except -1: + * try: + * __pyx_import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L3_error)) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 + * try: + * __pyx_import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L5_except_error)) + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 982, __pyx_L5_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L5_except_error)) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 983, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 983, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_umath", 0); + __Pyx_TraceCall("import_umath", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_TraceLine(986,0,__PYX_ERR(1, 986, __pyx_L1_error)) + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L3_error)) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L5_except_error)) + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L5_except_error)) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_ufunc", 0); + __Pyx_TraceCall("import_ufunc", __pyx_f[1], 991, 0, __PYX_ERR(1, 991, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_TraceLine(992,0,__PYX_ERR(1, 992, __pyx_L1_error)) + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L3_error)) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __Pyx_TraceLine(994,0,__PYX_ERR(1, 994, __pyx_L5_except_error)) + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L5_except_error)) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + __Pyx_TraceCall("is_timedelta64_object", __pyx_f[1], 998, 0, __PYX_ERR(1, 998, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1010 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error)) + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + __Pyx_TraceCall("is_datetime64_object", __pyx_f[1], 1013, 0, __PYX_ERR(1, 1013, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1025 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error)) + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("get_datetime64_value", __pyx_f[1], 1028, 1, __PYX_ERR(1, 1028, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1035 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(1035,1,__PYX_ERR(1, 1035, __pyx_L1_error)) + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("get_timedelta64_value", __pyx_f[1], 1038, 1, __PYX_ERR(1, 1038, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1042 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(1042,1,__PYX_ERR(1, 1042, __pyx_L1_error)) + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + __Pyx_TraceDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("get_datetime64_unit", __pyx_f[1], 1045, 1, __PYX_ERR(1, 1045, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1049 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __Pyx_TraceLine(1049,1,__PYX_ERR(1, 1049, __pyx_L1_error)) + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = (NPY_DATETIMEUNIT) 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/pdf.pxi":28 + * T max[T](T a, T b) + * + * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< + * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method + * and implementation of Navarro & Fuss, 2009. + */ + +static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_v_err) { + double __pyx_v_kl; + double __pyx_v_ks; + double __pyx_v_p; + int __pyx_v_k; + int __pyx_v_K; + int __pyx_v_lower; + int __pyx_v_upper; + double __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("ftt_01w", __pyx_f[2], 28, 1, __PYX_ERR(2, 28, __pyx_L1_error)); + + /* "hddm_wfpt/pdf.pxi":36 + * + * # calculate number of terms needed for large t + * if M_PI*tt*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< + * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound + * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met + */ + __Pyx_TraceLine(36,1,__PYX_ERR(2, 36, __pyx_L1_error)) + __pyx_t_1 = (((M_PI * __pyx_v_tt) * __pyx_v_err) < 1.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":37 + * # calculate number of terms needed for large t + * if M_PI*tt*err<1: # if error threshold is set low enough + * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound # <<<<<<<<<<<<<< + * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met + * else: # if error threshold set too high + */ + __Pyx_TraceLine(37,1,__PYX_ERR(2, 37, __pyx_L1_error)) + __pyx_v_kl = sqrt(((-2.0 * log(((M_PI * __pyx_v_tt) * __pyx_v_err))) / (pow(M_PI, 2.0) * __pyx_v_tt))); + + /* "hddm_wfpt/pdf.pxi":38 + * if M_PI*tt*err<1: # if error threshold is set low enough + * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound + * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met # <<<<<<<<<<<<<< + * else: # if error threshold set too high + * kl=1./(M_PI*sqrt(tt)) # set to boundary condition + */ + __Pyx_TraceLine(38,1,__PYX_ERR(2, 38, __pyx_L1_error)) + __pyx_v_kl = std::max(__pyx_v_kl, (1. / (M_PI * sqrt(__pyx_v_tt)))); + + /* "hddm_wfpt/pdf.pxi":36 + * + * # calculate number of terms needed for large t + * if M_PI*tt*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< + * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound + * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met + */ + goto __pyx_L3; + } + + /* "hddm_wfpt/pdf.pxi":40 + * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met + * else: # if error threshold set too high + * kl=1./(M_PI*sqrt(tt)) # set to boundary condition # <<<<<<<<<<<<<< + * + * # calculate number of terms needed for small t + */ + __Pyx_TraceLine(40,1,__PYX_ERR(2, 40, __pyx_L1_error)) + /*else*/ { + __pyx_v_kl = (1. / (M_PI * sqrt(__pyx_v_tt))); + } + __pyx_L3:; + + /* "hddm_wfpt/pdf.pxi":43 + * + * # calculate number of terms needed for small t + * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< + * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound + * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met + */ + __Pyx_TraceLine(43,1,__PYX_ERR(2, 43, __pyx_L1_error)) + __pyx_t_1 = (((2.0 * sqrt(((2.0 * M_PI) * __pyx_v_tt))) * __pyx_v_err) < 1.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":44 + * # calculate number of terms needed for small t + * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough + * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound # <<<<<<<<<<<<<< + * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met + * else: # if error threshold was set too high + */ + __Pyx_TraceLine(44,1,__PYX_ERR(2, 44, __pyx_L1_error)) + __pyx_v_ks = (2.0 + sqrt(((-2.0 * __pyx_v_tt) * log(((2.0 * sqrt(((2.0 * M_PI) * __pyx_v_tt))) * __pyx_v_err))))); + + /* "hddm_wfpt/pdf.pxi":45 + * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough + * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound + * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met # <<<<<<<<<<<<<< + * else: # if error threshold was set too high + * ks=2 # minimal kappa for that case + */ + __Pyx_TraceLine(45,1,__PYX_ERR(2, 45, __pyx_L1_error)) + __pyx_v_ks = std::max(__pyx_v_ks, (sqrt(__pyx_v_tt) + 1.0)); + + /* "hddm_wfpt/pdf.pxi":43 + * + * # calculate number of terms needed for small t + * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< + * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound + * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met + */ + goto __pyx_L4; + } + + /* "hddm_wfpt/pdf.pxi":47 + * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met + * else: # if error threshold was set too high + * ks=2 # minimal kappa for that case # <<<<<<<<<<<<<< + * + * # compute f(tt|0,1,w) + */ + __Pyx_TraceLine(47,1,__PYX_ERR(2, 47, __pyx_L1_error)) + /*else*/ { + __pyx_v_ks = 2.0; + } + __pyx_L4:; + + /* "hddm_wfpt/pdf.pxi":50 + * + * # compute f(tt|0,1,w) + * p=0 #initialize density # <<<<<<<<<<<<<< + * if ks(ceil(ks)) # round to smallest integer meeting error + */ + __Pyx_TraceLine(50,1,__PYX_ERR(2, 50, __pyx_L1_error)) + __pyx_v_p = 0.0; + + /* "hddm_wfpt/pdf.pxi":51 + * # compute f(tt|0,1,w) + * p=0 #initialize density + * if ks(ceil(ks)) # round to smallest integer meeting error + * lower = (-floor((K-1)/2.)) + */ + __Pyx_TraceLine(51,1,__PYX_ERR(2, 51, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_ks < __pyx_v_kl); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":52 + * p=0 #initialize density + * if ks(ceil(ks)) # round to smallest integer meeting error # <<<<<<<<<<<<<< + * lower = (-floor((K-1)/2.)) + * upper = (ceil((K-1)/2.)) + */ + __Pyx_TraceLine(52,1,__PYX_ERR(2, 52, __pyx_L1_error)) + __pyx_v_K = ((int)ceil(__pyx_v_ks)); + + /* "hddm_wfpt/pdf.pxi":53 + * if ks(ceil(ks)) # round to smallest integer meeting error + * lower = (-floor((K-1)/2.)) # <<<<<<<<<<<<<< + * upper = (ceil((K-1)/2.)) + * for k from lower <= k <= upper: # loop over k + */ + __Pyx_TraceLine(53,1,__PYX_ERR(2, 53, __pyx_L1_error)) + __pyx_v_lower = ((int)(-floor((((double)(__pyx_v_K - 1)) / 2.)))); + + /* "hddm_wfpt/pdf.pxi":54 + * K=(ceil(ks)) # round to smallest integer meeting error + * lower = (-floor((K-1)/2.)) + * upper = (ceil((K-1)/2.)) # <<<<<<<<<<<<<< + * for k from lower <= k <= upper: # loop over k + * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum + */ + __Pyx_TraceLine(54,1,__PYX_ERR(2, 54, __pyx_L1_error)) + __pyx_v_upper = ((int)ceil((((double)(__pyx_v_K - 1)) / 2.))); + + /* "hddm_wfpt/pdf.pxi":55 + * lower = (-floor((K-1)/2.)) + * upper = (ceil((K-1)/2.)) + * for k from lower <= k <= upper: # loop over k # <<<<<<<<<<<<<< + * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum + * p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term + */ + __Pyx_TraceLine(55,1,__PYX_ERR(2, 55, __pyx_L1_error)) + __pyx_t_2 = __pyx_v_upper; + for (__pyx_v_k = __pyx_v_lower; __pyx_v_k <= __pyx_t_2; __pyx_v_k++) { + + /* "hddm_wfpt/pdf.pxi":56 + * upper = (ceil((K-1)/2.)) + * for k from lower <= k <= upper: # loop over k + * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum # <<<<<<<<<<<<<< + * p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term + * + */ + __Pyx_TraceLine(56,1,__PYX_ERR(2, 56, __pyx_L1_error)) + __pyx_v_p = (__pyx_v_p + ((__pyx_v_w + (2 * __pyx_v_k)) * exp((((-pow((__pyx_v_w + (2 * __pyx_v_k)), 2.0)) / 2.0) / __pyx_v_tt)))); + } + + /* "hddm_wfpt/pdf.pxi":57 + * for k from lower <= k <= upper: # loop over k + * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum + * p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term # <<<<<<<<<<<<<< + * + * else: # if large t is better... + */ + __Pyx_TraceLine(57,1,__PYX_ERR(2, 57, __pyx_L1_error)) + __pyx_v_p = (__pyx_v_p / sqrt(((2.0 * M_PI) * pow(__pyx_v_tt, 3.0)))); + + /* "hddm_wfpt/pdf.pxi":51 + * # compute f(tt|0,1,w) + * p=0 #initialize density + * if ks(ceil(ks)) # round to smallest integer meeting error + * lower = (-floor((K-1)/2.)) + */ + goto __pyx_L5; + } + + /* "hddm_wfpt/pdf.pxi":60 + * + * else: # if large t is better... + * K=(ceil(kl)) # round to smallest integer meeting error # <<<<<<<<<<<<<< + * for k from 1 <= k <= K: + * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum + */ + __Pyx_TraceLine(60,1,__PYX_ERR(2, 60, __pyx_L1_error)) + /*else*/ { + __pyx_v_K = ((int)ceil(__pyx_v_kl)); + + /* "hddm_wfpt/pdf.pxi":61 + * else: # if large t is better... + * K=(ceil(kl)) # round to smallest integer meeting error + * for k from 1 <= k <= K: # <<<<<<<<<<<<<< + * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum + * p*=M_PI # add con_stant term + */ + __Pyx_TraceLine(61,1,__PYX_ERR(2, 61, __pyx_L1_error)) + __pyx_t_2 = __pyx_v_K; + for (__pyx_v_k = 1; __pyx_v_k <= __pyx_t_2; __pyx_v_k++) { + + /* "hddm_wfpt/pdf.pxi":62 + * K=(ceil(kl)) # round to smallest integer meeting error + * for k from 1 <= k <= K: + * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum # <<<<<<<<<<<<<< + * p*=M_PI # add con_stant term + * + */ + __Pyx_TraceLine(62,1,__PYX_ERR(2, 62, __pyx_L1_error)) + __pyx_v_p = (__pyx_v_p + ((__pyx_v_k * exp(((((-pow(__pyx_v_k, 2.0)) * pow(M_PI, 2.0)) * __pyx_v_tt) / 2.0))) * sin(((__pyx_v_k * M_PI) * __pyx_v_w)))); + } + + /* "hddm_wfpt/pdf.pxi":63 + * for k from 1 <= k <= K: + * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum + * p*=M_PI # add con_stant term # <<<<<<<<<<<<<< + * + * return p + */ + __Pyx_TraceLine(63,1,__PYX_ERR(2, 63, __pyx_L1_error)) + __pyx_v_p = (__pyx_v_p * M_PI); + } + __pyx_L5:; + + /* "hddm_wfpt/pdf.pxi":65 + * p*=M_PI # add con_stant term + * + * return p # <<<<<<<<<<<<<< + * + * cdef inline double prob_ub(double v, double a, double z) nogil: + */ + __Pyx_TraceLine(65,1,__PYX_ERR(2, 65, __pyx_L1_error)) + __pyx_r = __pyx_v_p; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":28 + * T max[T](T a, T b) + * + * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< + * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method + * and implementation of Navarro & Fuss, 2009. + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.ftt_01w", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/pdf.pxi":67 + * return p + * + * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< + * """Probability of hitting upper boundary.""" + * if v == 0: + */ + +static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx_v_a, double __pyx_v_z) { + double __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("prob_ub", __pyx_f[2], 67, 1, __PYX_ERR(2, 67, __pyx_L1_error)); + + /* "hddm_wfpt/pdf.pxi":69 + * cdef inline double prob_ub(double v, double a, double z) nogil: + * """Probability of hitting upper boundary.""" + * if v == 0: # <<<<<<<<<<<<<< + * return z + * else: + */ + __Pyx_TraceLine(69,1,__PYX_ERR(2, 69, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_v == 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":70 + * """Probability of hitting upper boundary.""" + * if v == 0: + * return z # <<<<<<<<<<<<<< + * else: + * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) + */ + __Pyx_TraceLine(70,1,__PYX_ERR(2, 70, __pyx_L1_error)) + __pyx_r = __pyx_v_z; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":69 + * cdef inline double prob_ub(double v, double a, double z) nogil: + * """Probability of hitting upper boundary.""" + * if v == 0: # <<<<<<<<<<<<<< + * return z + * else: + */ + } + + /* "hddm_wfpt/pdf.pxi":72 + * return z + * else: + * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) # <<<<<<<<<<<<<< + * + * cdef double pdf(double x, double v, double a, double w, double err) nogil: + */ + __Pyx_TraceLine(72,1,__PYX_ERR(2, 72, __pyx_L1_error)) + /*else*/ { + __pyx_r = ((exp((((-2.0 * __pyx_v_a) * __pyx_v_z) * __pyx_v_v)) - 1.0) / (exp(((-2.0 * __pyx_v_a) * __pyx_v_v)) - 1.0)); + goto __pyx_L0; + } + + /* "hddm_wfpt/pdf.pxi":67 + * return p + * + * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< + * """Probability of hitting upper boundary.""" + * if v == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.prob_ub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/pdf.pxi":74 + * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) + * + * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< + * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method + * and implementation of Navarro & Fuss, 2009. + */ + +static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_v_a, double __pyx_v_w, double __pyx_v_err) { + double __pyx_v_tt; + double __pyx_v_p; + double __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + double __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("pdf", __pyx_f[2], 74, 1, __PYX_ERR(2, 74, __pyx_L1_error)); + + /* "hddm_wfpt/pdf.pxi":78 + * and implementation of Navarro & Fuss, 2009. + * """ + * if x <= 0: # <<<<<<<<<<<<<< + * return 0 + * + */ + __Pyx_TraceLine(78,1,__PYX_ERR(2, 78, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_x <= 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":79 + * """ + * if x <= 0: + * return 0 # <<<<<<<<<<<<<< + * + * cdef double tt = x/a**2 # use normalized time + */ + __Pyx_TraceLine(79,1,__PYX_ERR(2, 79, __pyx_L1_error)) + __pyx_r = 0.0; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":78 + * and implementation of Navarro & Fuss, 2009. + * """ + * if x <= 0: # <<<<<<<<<<<<<< + * return 0 + * + */ + } + + /* "hddm_wfpt/pdf.pxi":81 + * return 0 + * + * cdef double tt = x/a**2 # use normalized time # <<<<<<<<<<<<<< + * cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) + * + */ + __Pyx_TraceLine(81,1,__PYX_ERR(2, 81, __pyx_L1_error)) + __pyx_v_tt = (__pyx_v_x / pow(__pyx_v_a, 2.0)); + + /* "hddm_wfpt/pdf.pxi":82 + * + * cdef double tt = x/a**2 # use normalized time + * cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) # <<<<<<<<<<<<<< + * + * # convert to f(t|v,a,w) + */ + __Pyx_TraceLine(82,1,__PYX_ERR(2, 82, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_ftt_01w(__pyx_v_tt, __pyx_v_w, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 82, __pyx_L1_error) + __pyx_v_p = __pyx_t_2; + + /* "hddm_wfpt/pdf.pxi":85 + * + * # convert to f(t|v,a,w) + * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) # <<<<<<<<<<<<<< + * + * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: + */ + __Pyx_TraceLine(85,1,__PYX_ERR(2, 85, __pyx_L1_error)) + __pyx_r = ((__pyx_v_p * exp(((((-__pyx_v_v) * __pyx_v_a) * __pyx_v_w) - ((pow(__pyx_v_v, 2.0) * __pyx_v_x) / 2.)))) / pow(__pyx_v_a, 2.0)); + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":74 + * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) + * + * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< + * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method + * and implementation of Navarro & Fuss, 2009. + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/pdf.pxi":87 + * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) + * + * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< + * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method + * and implementation of Navarro & Fuss, 2009. + */ + +static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_err) { + double __pyx_v_tt; + double __pyx_v_p; + double __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + double __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("pdf_sv", __pyx_f[2], 87, 1, __PYX_ERR(2, 87, __pyx_L1_error)); + + /* "hddm_wfpt/pdf.pxi":92 + * sv is the std of the drift rate + * """ + * if x <= 0: # <<<<<<<<<<<<<< + * return 0 + * + */ + __Pyx_TraceLine(92,1,__PYX_ERR(2, 92, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_x <= 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":93 + * """ + * if x <= 0: + * return 0 # <<<<<<<<<<<<<< + * + * if sv==0: + */ + __Pyx_TraceLine(93,1,__PYX_ERR(2, 93, __pyx_L1_error)) + __pyx_r = 0.0; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":92 + * sv is the std of the drift rate + * """ + * if x <= 0: # <<<<<<<<<<<<<< + * return 0 + * + */ + } + + /* "hddm_wfpt/pdf.pxi":95 + * return 0 + * + * if sv==0: # <<<<<<<<<<<<<< + * return pdf(x, v, a, z, err) + * + */ + __Pyx_TraceLine(95,1,__PYX_ERR(2, 95, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_sv == 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":96 + * + * if sv==0: + * return pdf(x, v, a, z, err) # <<<<<<<<<<<<<< + * + * cdef double tt = x/(pow(a,2)) # use normalized time + */ + __Pyx_TraceLine(96,1,__PYX_ERR(2, 96, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_pdf(__pyx_v_x, __pyx_v_v, __pyx_v_a, __pyx_v_z, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 96, __pyx_L1_error) + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":95 + * return 0 + * + * if sv==0: # <<<<<<<<<<<<<< + * return pdf(x, v, a, z, err) + * + */ + } + + /* "hddm_wfpt/pdf.pxi":98 + * return pdf(x, v, a, z, err) + * + * cdef double tt = x/(pow(a,2)) # use normalized time # <<<<<<<<<<<<<< + * cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) + * + */ + __Pyx_TraceLine(98,1,__PYX_ERR(2, 98, __pyx_L1_error)) + __pyx_v_tt = (__pyx_v_x / pow(__pyx_v_a, 2.0)); + + /* "hddm_wfpt/pdf.pxi":99 + * + * cdef double tt = x/(pow(a,2)) # use normalized time + * cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) # <<<<<<<<<<<<<< + * + * # convert to f(t|v,a,w) + */ + __Pyx_TraceLine(99,1,__PYX_ERR(2, 99, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_ftt_01w(__pyx_v_tt, __pyx_v_z, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 99, __pyx_L1_error) + __pyx_v_p = __pyx_t_2; + + /* "hddm_wfpt/pdf.pxi":102 + * + * # convert to f(t|v,a,w) + * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) # <<<<<<<<<<<<<< + * + * cpdef double full_pdf(double x, double v, double sv, double a, double + */ + __Pyx_TraceLine(102,1,__PYX_ERR(2, 102, __pyx_L1_error)) + __pyx_r = ((exp((log(__pyx_v_p) + (((pow(((__pyx_v_a * __pyx_v_z) * __pyx_v_sv), 2.0) - (((2.0 * __pyx_v_a) * __pyx_v_v) * __pyx_v_z)) - (pow(__pyx_v_v, 2.0) * __pyx_v_x)) / (((2.0 * pow(__pyx_v_sv, 2.0)) * __pyx_v_x) + 2.0)))) / sqrt(((pow(__pyx_v_sv, 2.0) * __pyx_v_x) + 1.0))) / pow(__pyx_v_a, 2.0)); + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":87 + * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) + * + * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< + * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method + * and implementation of Navarro & Fuss, 2009. + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.pdf_sv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/pdf.pxi":104 + * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) + * + * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< + * z, double sz, double t, double st, double err, int + * n_st=2, int n_sz=2, bint use_adaptive=1, double + */ + +static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_4wfpt_full_pdf *__pyx_optional_args) { + int __pyx_v_n_st = ((int)2); + int __pyx_v_n_sz = ((int)2); + int __pyx_v_use_adaptive = ((int)1); + double __pyx_v_simps_err = ((double)1e-3); + double __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + int __pyx_t_2; + double __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceFrameInit(__pyx_codeobj__3) + __Pyx_TraceCall("full_pdf", __pyx_f[2], 104, 1, __PYX_ERR(2, 104, __pyx_L1_error)); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_n_st = __pyx_optional_args->n_st; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_n_sz = __pyx_optional_args->n_sz; + if (__pyx_optional_args->__pyx_n > 2) { + __pyx_v_use_adaptive = __pyx_optional_args->use_adaptive; + if (__pyx_optional_args->__pyx_n > 3) { + __pyx_v_simps_err = __pyx_optional_args->simps_err; + } + } + } + } + } + + /* "hddm_wfpt/pdf.pxi":111 + * + * # Check if parpameters are valid + * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< + * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): + * return 0 + */ + __Pyx_TraceLine(111,1,__PYX_ERR(2, 111, __pyx_L1_error)) + __pyx_t_2 = (__pyx_v_z < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_z > 1.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_a < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_t < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_st < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_sv < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_sz < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_sz > 1.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "hddm_wfpt/pdf.pxi":112 + * # Check if parpameters are valid + * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ + * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): # <<<<<<<<<<<<<< + * return 0 + * + */ + __Pyx_TraceLine(112,1,__PYX_ERR(2, 112, __pyx_L1_error)) + __pyx_t_2 = ((fabs(__pyx_v_x) - (__pyx_v_t - (__pyx_v_st / 2.))) < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_z + (__pyx_v_sz / 2.)) > 1.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_z - (__pyx_v_sz / 2.)) < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_t - (__pyx_v_st / 2.)) < 0.0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "hddm_wfpt/pdf.pxi":111 + * + * # Check if parpameters are valid + * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< + * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): + * return 0 + */ + __Pyx_TraceLine(111,1,__PYX_ERR(2, 111, __pyx_L1_error)) + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":113 + * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ + * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): + * return 0 # <<<<<<<<<<<<<< + * + * # transform x,v,z if x is upper bound response + */ + __Pyx_TraceLine(113,1,__PYX_ERR(2, 113, __pyx_L1_error)) + __pyx_r = 0.0; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":111 + * + * # Check if parpameters are valid + * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< + * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): + * return 0 + */ + } + + /* "hddm_wfpt/pdf.pxi":116 + * + * # transform x,v,z if x is upper bound response + * if x > 0: # <<<<<<<<<<<<<< + * v = -v + * z = 1.-z + */ + __Pyx_TraceLine(116,1,__PYX_ERR(2, 116, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_x > 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":117 + * # transform x,v,z if x is upper bound response + * if x > 0: + * v = -v # <<<<<<<<<<<<<< + * z = 1.-z + * + */ + __Pyx_TraceLine(117,1,__PYX_ERR(2, 117, __pyx_L1_error)) + __pyx_v_v = (-__pyx_v_v); + + /* "hddm_wfpt/pdf.pxi":118 + * if x > 0: + * v = -v + * z = 1.-z # <<<<<<<<<<<<<< + * + * x = fabs(x) + */ + __Pyx_TraceLine(118,1,__PYX_ERR(2, 118, __pyx_L1_error)) + __pyx_v_z = (1. - __pyx_v_z); + + /* "hddm_wfpt/pdf.pxi":116 + * + * # transform x,v,z if x is upper bound response + * if x > 0: # <<<<<<<<<<<<<< + * v = -v + * z = 1.-z + */ + } + + /* "hddm_wfpt/pdf.pxi":120 + * z = 1.-z + * + * x = fabs(x) # <<<<<<<<<<<<<< + * + * if st<1e-3: + */ + __Pyx_TraceLine(120,1,__PYX_ERR(2, 120, __pyx_L1_error)) + __pyx_v_x = fabs(__pyx_v_x); + + /* "hddm_wfpt/pdf.pxi":122 + * x = fabs(x) + * + * if st<1e-3: # <<<<<<<<<<<<<< + * st = 0 + * if sz <1e-3: + */ + __Pyx_TraceLine(122,1,__PYX_ERR(2, 122, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_st < 1e-3); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":123 + * + * if st<1e-3: + * st = 0 # <<<<<<<<<<<<<< + * if sz <1e-3: + * sz = 0 + */ + __Pyx_TraceLine(123,1,__PYX_ERR(2, 123, __pyx_L1_error)) + __pyx_v_st = 0.0; + + /* "hddm_wfpt/pdf.pxi":122 + * x = fabs(x) + * + * if st<1e-3: # <<<<<<<<<<<<<< + * st = 0 + * if sz <1e-3: + */ + } + + /* "hddm_wfpt/pdf.pxi":124 + * if st<1e-3: + * st = 0 + * if sz <1e-3: # <<<<<<<<<<<<<< + * sz = 0 + * + */ + __Pyx_TraceLine(124,1,__PYX_ERR(2, 124, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_sz < 1e-3); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":125 + * st = 0 + * if sz <1e-3: + * sz = 0 # <<<<<<<<<<<<<< + * + * if (sz==0): + */ + __Pyx_TraceLine(125,1,__PYX_ERR(2, 125, __pyx_L1_error)) + __pyx_v_sz = 0.0; + + /* "hddm_wfpt/pdf.pxi":124 + * if st<1e-3: + * st = 0 + * if sz <1e-3: # <<<<<<<<<<<<<< + * sz = 0 + * + */ + } + + /* "hddm_wfpt/pdf.pxi":127 + * sz = 0 + * + * if (sz==0): # <<<<<<<<<<<<<< + * if (st==0): #sv=0,sz=0,st=0 + * return pdf_sv(x - t, v, sv, a, z, err) + */ + __Pyx_TraceLine(127,1,__PYX_ERR(2, 127, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_sz == 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":128 + * + * if (sz==0): + * if (st==0): #sv=0,sz=0,st=0 # <<<<<<<<<<<<<< + * return pdf_sv(x - t, v, sv, a, z, err) + * else: #sv=0,sz=0,st=$ + */ + __Pyx_TraceLine(128,1,__PYX_ERR(2, 128, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_st == 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":129 + * if (sz==0): + * if (st==0): #sv=0,sz=0,st=0 + * return pdf_sv(x - t, v, sv, a, z, err) # <<<<<<<<<<<<<< + * else: #sv=0,sz=0,st=$ + * if use_adaptive>0: + */ + __Pyx_TraceLine(129,1,__PYX_ERR(2, 129, __pyx_L1_error)) + __pyx_t_3 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_err); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 129, __pyx_L1_error) + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":128 + * + * if (sz==0): + * if (st==0): #sv=0,sz=0,st=0 # <<<<<<<<<<<<<< + * return pdf_sv(x - t, v, sv, a, z, err) + * else: #sv=0,sz=0,st=$ + */ + } + + /* "hddm_wfpt/pdf.pxi":131 + * return pdf_sv(x - t, v, sv, a, z, err) + * else: #sv=0,sz=0,st=$ + * if use_adaptive>0: # <<<<<<<<<<<<<< + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) + * else: + */ + __Pyx_TraceLine(131,1,__PYX_ERR(2, 131, __pyx_L1_error)) + /*else*/ { + __pyx_t_1 = (__pyx_v_use_adaptive > 0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":132 + * else: #sv=0,sz=0,st=$ + * if use_adaptive>0: + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) # <<<<<<<<<<<<<< + * else: + * return simpson_1D(x, v, sv, a, z, t, err, z, z, 0, t-st/2., t+st/2., n_st) + */ + __Pyx_TraceLine(132,1,__PYX_ERR(2, 132, __pyx_L1_error)) + __pyx_t_3 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, __pyx_v_z, __pyx_v_z, (__pyx_v_t - (__pyx_v_st / 2.)), (__pyx_v_t + (__pyx_v_st / 2.)), __pyx_v_simps_err, __pyx_v_n_st); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 132, __pyx_L1_error) + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":131 + * return pdf_sv(x - t, v, sv, a, z, err) + * else: #sv=0,sz=0,st=$ + * if use_adaptive>0: # <<<<<<<<<<<<<< + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) + * else: + */ + } + + /* "hddm_wfpt/pdf.pxi":134 + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) + * else: + * return simpson_1D(x, v, sv, a, z, t, err, z, z, 0, t-st/2., t+st/2., n_st) # <<<<<<<<<<<<<< + * + * else: #sz=$ + */ + __Pyx_TraceLine(134,1,__PYX_ERR(2, 134, __pyx_L1_error)) + /*else*/ { + __pyx_t_3 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, __pyx_v_z, __pyx_v_z, 0, (__pyx_v_t - (__pyx_v_st / 2.)), (__pyx_v_t + (__pyx_v_st / 2.)), __pyx_v_n_st); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 134, __pyx_L1_error) + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + } + + /* "hddm_wfpt/pdf.pxi":127 + * sz = 0 + * + * if (sz==0): # <<<<<<<<<<<<<< + * if (st==0): #sv=0,sz=0,st=0 + * return pdf_sv(x - t, v, sv, a, z, err) + */ + } + + /* "hddm_wfpt/pdf.pxi":137 + * + * else: #sz=$ + * if (st==0): #sv=0,sz=$,st=0 # <<<<<<<<<<<<<< + * if use_adaptive: + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) + */ + __Pyx_TraceLine(137,1,__PYX_ERR(2, 137, __pyx_L1_error)) + /*else*/ { + __pyx_t_1 = (__pyx_v_st == 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/pdf.pxi":138 + * else: #sz=$ + * if (st==0): #sv=0,sz=$,st=0 + * if use_adaptive: # <<<<<<<<<<<<<< + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) + * else: + */ + __Pyx_TraceLine(138,1,__PYX_ERR(2, 138, __pyx_L1_error)) + if (__pyx_v_use_adaptive) { + + /* "hddm_wfpt/pdf.pxi":139 + * if (st==0): #sv=0,sz=$,st=0 + * if use_adaptive: + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) # <<<<<<<<<<<<<< + * else: + * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) + */ + __Pyx_TraceLine(139,1,__PYX_ERR(2, 139, __pyx_L1_error)) + __pyx_t_3 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, (__pyx_v_z - (__pyx_v_sz / 2.)), (__pyx_v_z + (__pyx_v_sz / 2.)), __pyx_v_t, __pyx_v_t, __pyx_v_simps_err, __pyx_v_n_sz); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":138 + * else: #sz=$ + * if (st==0): #sv=0,sz=$,st=0 + * if use_adaptive: # <<<<<<<<<<<<<< + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) + * else: + */ + } + + /* "hddm_wfpt/pdf.pxi":141 + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) + * else: + * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) # <<<<<<<<<<<<<< + * else: #sv=0,sz=$,st=$ + * if use_adaptive: + */ + __Pyx_TraceLine(141,1,__PYX_ERR(2, 141, __pyx_L1_error)) + /*else*/ { + __pyx_t_3 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, (__pyx_v_z - (__pyx_v_sz / 2.)), (__pyx_v_z + (__pyx_v_sz / 2.)), __pyx_v_n_sz, __pyx_v_t, __pyx_v_t, 0); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 141, __pyx_L1_error) + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "hddm_wfpt/pdf.pxi":137 + * + * else: #sz=$ + * if (st==0): #sv=0,sz=$,st=0 # <<<<<<<<<<<<<< + * if use_adaptive: + * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) + */ + } + + /* "hddm_wfpt/pdf.pxi":143 + * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) + * else: #sv=0,sz=$,st=$ + * if use_adaptive: # <<<<<<<<<<<<<< + * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) + * else: + */ + __Pyx_TraceLine(143,1,__PYX_ERR(2, 143, __pyx_L1_error)) + /*else*/ { + if (__pyx_v_use_adaptive) { + + /* "hddm_wfpt/pdf.pxi":144 + * else: #sv=0,sz=$,st=$ + * if use_adaptive: + * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) # <<<<<<<<<<<<<< + * else: + * return simpson_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t-st/2., t+st/2., n_st) + */ + __Pyx_TraceLine(144,1,__PYX_ERR(2, 144, __pyx_L1_error)) + __pyx_t_3 = __pyx_f_4wfpt_adaptiveSimpsons_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, (__pyx_v_z - (__pyx_v_sz / 2.)), (__pyx_v_z + (__pyx_v_sz / 2.)), (__pyx_v_t - (__pyx_v_st / 2.)), (__pyx_v_t + (__pyx_v_st / 2.)), __pyx_v_simps_err, __pyx_v_n_sz, __pyx_v_n_st); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 144, __pyx_L1_error) + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "hddm_wfpt/pdf.pxi":143 + * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) + * else: #sv=0,sz=$,st=$ + * if use_adaptive: # <<<<<<<<<<<<<< + * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) + * else: + */ + } + + /* "hddm_wfpt/pdf.pxi":146 + * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) + * else: + * return simpson_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t-st/2., t+st/2., n_st) # <<<<<<<<<<<<<< + */ + __Pyx_TraceLine(146,1,__PYX_ERR(2, 146, __pyx_L1_error)) + /*else*/ { + __pyx_t_3 = __pyx_f_4wfpt_simpson_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, (__pyx_v_z - (__pyx_v_sz / 2.)), (__pyx_v_z + (__pyx_v_sz / 2.)), __pyx_v_n_sz, (__pyx_v_t - (__pyx_v_st / 2.)), (__pyx_v_t + (__pyx_v_st / 2.)), __pyx_v_n_st); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 146, __pyx_L1_error) + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + } + } + + /* "hddm_wfpt/pdf.pxi":104 + * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) + * + * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< + * z, double sz, double t, double st, double err, int + * n_st=2, int n_sz=2, bint use_adaptive=1, double + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.full_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_full_pdf, "full_pdf(double x, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3) -> double\nfull pdf"); +static PyMethodDef __pyx_mdef_4wfpt_1full_pdf = {"full_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_1full_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_full_pdf}; +static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + double __pyx_v_x; + double __pyx_v_v; + double __pyx_v_sv; + double __pyx_v_a; + double __pyx_v_z; + double __pyx_v_sz; + double __pyx_v_t; + double __pyx_v_st; + double __pyx_v_err; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full_pdf (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,0}; + PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 1); __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 2); __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 3); __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 4); __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 5); __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 6); __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 7); __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 8); __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[11] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[12] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "full_pdf") < 0)) __PYX_ERR(2, 104, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + __pyx_v_v = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) + if (values[9]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)2); + } + if (values[10]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 106, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)2); + } + if (values[11]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 106, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)1); + } + if (values[12]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 106, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)1e-3); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, __pyx_nargs); __PYX_ERR(2, 104, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.full_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4wfpt_full_pdf(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_full_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + double __pyx_t_1; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__3) + __Pyx_RefNannySetupContext("full_pdf", 0); + __Pyx_TraceCall("full_pdf (wrapper)", __pyx_f[2], 104, 0, __PYX_ERR(2, 104, __pyx_L1_error)); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 4; + __pyx_t_2.n_st = __pyx_v_n_st; + __pyx_t_2.n_sz = __pyx_v_n_sz; + __pyx_t_2.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_2.simps_err = __pyx_v_simps_err; + __pyx_t_1 = __pyx_f_4wfpt_full_pdf(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("wfpt.full_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "hddm_wfpt/integrate.pxi":12 + * include 'pdf.pxi' + * + * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< + * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: + * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" + */ + +static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_err, double __pyx_v_lb_z, double __pyx_v_ub_z, int __pyx_v_n_sz, double __pyx_v_lb_t, double __pyx_v_ub_t, int __pyx_v_n_st) { + double __pyx_v_ht; + double __pyx_v_hz; + int __pyx_v_n; + double __pyx_v_S; + double __pyx_v_z_tag; + double __pyx_v_t_tag; + double __pyx_v_y; + int __pyx_v_i; + double __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + double __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("simpson_1D", __pyx_f[3], 12, 1, __PYX_ERR(3, 12, __pyx_L1_error)); + + /* "hddm_wfpt/integrate.pxi":18 + * + * cdef double ht, hz + * cdef int n = max(n_st, n_sz) # <<<<<<<<<<<<<< + * if n_st==0: #integration over z + * hz = (ub_z-lb_z)/n + */ + __Pyx_TraceLine(18,1,__PYX_ERR(3, 18, __pyx_L1_error)) + __pyx_v_n = std::max(__pyx_v_n_st, __pyx_v_n_sz); + + /* "hddm_wfpt/integrate.pxi":19 + * cdef double ht, hz + * cdef int n = max(n_st, n_sz) + * if n_st==0: #integration over z # <<<<<<<<<<<<<< + * hz = (ub_z-lb_z)/n + * ht = 0 + */ + __Pyx_TraceLine(19,1,__PYX_ERR(3, 19, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_n_st == 0); + if (__pyx_t_1) { + + /* "hddm_wfpt/integrate.pxi":20 + * cdef int n = max(n_st, n_sz) + * if n_st==0: #integration over z + * hz = (ub_z-lb_z)/n # <<<<<<<<<<<<<< + * ht = 0 + * lb_t = t + */ + __Pyx_TraceLine(20,1,__PYX_ERR(3, 20, __pyx_L1_error)) + __pyx_v_hz = ((__pyx_v_ub_z - __pyx_v_lb_z) / ((double)__pyx_v_n)); + + /* "hddm_wfpt/integrate.pxi":21 + * if n_st==0: #integration over z + * hz = (ub_z-lb_z)/n + * ht = 0 # <<<<<<<<<<<<<< + * lb_t = t + * ub_t = t + */ + __Pyx_TraceLine(21,1,__PYX_ERR(3, 21, __pyx_L1_error)) + __pyx_v_ht = 0.0; + + /* "hddm_wfpt/integrate.pxi":22 + * hz = (ub_z-lb_z)/n + * ht = 0 + * lb_t = t # <<<<<<<<<<<<<< + * ub_t = t + * else: #integration over t + */ + __Pyx_TraceLine(22,1,__PYX_ERR(3, 22, __pyx_L1_error)) + __pyx_v_lb_t = __pyx_v_t; + + /* "hddm_wfpt/integrate.pxi":23 + * ht = 0 + * lb_t = t + * ub_t = t # <<<<<<<<<<<<<< + * else: #integration over t + * hz = 0 + */ + __Pyx_TraceLine(23,1,__PYX_ERR(3, 23, __pyx_L1_error)) + __pyx_v_ub_t = __pyx_v_t; + + /* "hddm_wfpt/integrate.pxi":19 + * cdef double ht, hz + * cdef int n = max(n_st, n_sz) + * if n_st==0: #integration over z # <<<<<<<<<<<<<< + * hz = (ub_z-lb_z)/n + * ht = 0 + */ + goto __pyx_L3; + } + + /* "hddm_wfpt/integrate.pxi":25 + * ub_t = t + * else: #integration over t + * hz = 0 # <<<<<<<<<<<<<< + * ht = (ub_t-lb_t)/n + * lb_z = z + */ + __Pyx_TraceLine(25,1,__PYX_ERR(3, 25, __pyx_L1_error)) + /*else*/ { + __pyx_v_hz = 0.0; + + /* "hddm_wfpt/integrate.pxi":26 + * else: #integration over t + * hz = 0 + * ht = (ub_t-lb_t)/n # <<<<<<<<<<<<<< + * lb_z = z + * ub_z = z + */ + __Pyx_TraceLine(26,1,__PYX_ERR(3, 26, __pyx_L1_error)) + __pyx_v_ht = ((__pyx_v_ub_t - __pyx_v_lb_t) / ((double)__pyx_v_n)); + + /* "hddm_wfpt/integrate.pxi":27 + * hz = 0 + * ht = (ub_t-lb_t)/n + * lb_z = z # <<<<<<<<<<<<<< + * ub_z = z + * + */ + __Pyx_TraceLine(27,1,__PYX_ERR(3, 27, __pyx_L1_error)) + __pyx_v_lb_z = __pyx_v_z; + + /* "hddm_wfpt/integrate.pxi":28 + * ht = (ub_t-lb_t)/n + * lb_z = z + * ub_z = z # <<<<<<<<<<<<<< + * + * cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) + */ + __Pyx_TraceLine(28,1,__PYX_ERR(3, 28, __pyx_L1_error)) + __pyx_v_ub_z = __pyx_v_z; + } + __pyx_L3:; + + /* "hddm_wfpt/integrate.pxi":30 + * ub_z = z + * + * cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) # <<<<<<<<<<<<<< + * cdef double z_tag, t_tag, y + * cdef int i + */ + __Pyx_TraceLine(30,1,__PYX_ERR(3, 30, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_lb_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_lb_z, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 30, __pyx_L1_error) + __pyx_v_S = __pyx_t_2; + + /* "hddm_wfpt/integrate.pxi":34 + * cdef int i + * + * for i from 1 <= i <= n: # <<<<<<<<<<<<<< + * z_tag = lb_z + hz * i + * t_tag = lb_t + ht * i + */ + __Pyx_TraceLine(34,1,__PYX_ERR(3, 34, __pyx_L1_error)) + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_i = 1; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) { + + /* "hddm_wfpt/integrate.pxi":35 + * + * for i from 1 <= i <= n: + * z_tag = lb_z + hz * i # <<<<<<<<<<<<<< + * t_tag = lb_t + ht * i + * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) + */ + __Pyx_TraceLine(35,1,__PYX_ERR(3, 35, __pyx_L1_error)) + __pyx_v_z_tag = (__pyx_v_lb_z + (__pyx_v_hz * __pyx_v_i)); + + /* "hddm_wfpt/integrate.pxi":36 + * for i from 1 <= i <= n: + * z_tag = lb_z + hz * i + * t_tag = lb_t + ht * i # <<<<<<<<<<<<<< + * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) + * if i&1: #check if i is odd + */ + __Pyx_TraceLine(36,1,__PYX_ERR(3, 36, __pyx_L1_error)) + __pyx_v_t_tag = (__pyx_v_lb_t + (__pyx_v_ht * __pyx_v_i)); + + /* "hddm_wfpt/integrate.pxi":37 + * z_tag = lb_z + hz * i + * t_tag = lb_t + ht * i + * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) # <<<<<<<<<<<<<< + * if i&1: #check if i is odd + * S += (4 * y) + */ + __Pyx_TraceLine(37,1,__PYX_ERR(3, 37, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_tag), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_tag, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 37, __pyx_L1_error) + __pyx_v_y = __pyx_t_2; + + /* "hddm_wfpt/integrate.pxi":38 + * t_tag = lb_t + ht * i + * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) + * if i&1: #check if i is odd # <<<<<<<<<<<<<< + * S += (4 * y) + * else: + */ + __Pyx_TraceLine(38,1,__PYX_ERR(3, 38, __pyx_L1_error)) + __pyx_t_1 = ((__pyx_v_i & 1) != 0); + if (__pyx_t_1) { + + /* "hddm_wfpt/integrate.pxi":39 + * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) + * if i&1: #check if i is odd + * S += (4 * y) # <<<<<<<<<<<<<< + * else: + * S += (2 * y) + */ + __Pyx_TraceLine(39,1,__PYX_ERR(3, 39, __pyx_L1_error)) + __pyx_v_S = (__pyx_v_S + (4.0 * __pyx_v_y)); + + /* "hddm_wfpt/integrate.pxi":38 + * t_tag = lb_t + ht * i + * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) + * if i&1: #check if i is odd # <<<<<<<<<<<<<< + * S += (4 * y) + * else: + */ + goto __pyx_L6; + } + + /* "hddm_wfpt/integrate.pxi":41 + * S += (4 * y) + * else: + * S += (2 * y) # <<<<<<<<<<<<<< + * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y + * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st + */ + __Pyx_TraceLine(41,1,__PYX_ERR(3, 41, __pyx_L1_error)) + /*else*/ { + __pyx_v_S = (__pyx_v_S + (2.0 * __pyx_v_y)); + } + __pyx_L6:; + } + + /* "hddm_wfpt/integrate.pxi":42 + * else: + * S += (2 * y) + * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y # <<<<<<<<<<<<<< + * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st + * + */ + __Pyx_TraceLine(42,1,__PYX_ERR(3, 42, __pyx_L1_error)) + __pyx_v_S = (__pyx_v_S - __pyx_v_y); + + /* "hddm_wfpt/integrate.pxi":43 + * S += (2 * y) + * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y + * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st # <<<<<<<<<<<<<< + * + * return ((ht+hz) * S / 3) + */ + __Pyx_TraceLine(43,1,__PYX_ERR(3, 43, __pyx_L1_error)) + __pyx_v_S = (__pyx_v_S / ((__pyx_v_ub_t - __pyx_v_lb_t) + (__pyx_v_ub_z - __pyx_v_lb_z))); + + /* "hddm_wfpt/integrate.pxi":45 + * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st + * + * return ((ht+hz) * S / 3) # <<<<<<<<<<<<<< + * + * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: + */ + __Pyx_TraceLine(45,1,__PYX_ERR(3, 45, __pyx_L1_error)) + __pyx_r = (((__pyx_v_ht + __pyx_v_hz) * __pyx_v_S) / 3.0); + goto __pyx_L0; + + /* "hddm_wfpt/integrate.pxi":12 + * include 'pdf.pxi' + * + * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< + * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: + * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.simpson_1D", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/integrate.pxi":47 + * return ((ht+hz) * S / 3) + * + * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< + * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" + * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) + */ + +static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_t, double __pyx_v_err, double __pyx_v_lb_z, double __pyx_v_ub_z, int __pyx_v_n_sz, double __pyx_v_lb_t, double __pyx_v_ub_t, int __pyx_v_n_st) { + double __pyx_v_ht; + double __pyx_v_S; + double __pyx_v_t_tag; + double __pyx_v_y; + int __pyx_v_i_t; + double __pyx_r; + __Pyx_TraceDeclarations + double __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("simpson_2D", __pyx_f[3], 47, 1, __PYX_ERR(3, 47, __pyx_L1_error)); + + /* "hddm_wfpt/integrate.pxi":56 + * cdef int i_t + * + * ht = (ub_t-lb_t)/n_st # <<<<<<<<<<<<<< + * + * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) + */ + __Pyx_TraceLine(56,1,__PYX_ERR(3, 56, __pyx_L1_error)) + __pyx_v_ht = ((__pyx_v_ub_t - __pyx_v_lb_t) / ((double)__pyx_v_n_st)); + + /* "hddm_wfpt/integrate.pxi":58 + * ht = (ub_t-lb_t)/n_st + * + * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) # <<<<<<<<<<<<<< + * + * for i_t from 1 <= i_t <= n_st: + */ + __Pyx_TraceLine(58,1,__PYX_ERR(3, 58, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_lb_t, __pyx_v_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_n_sz, 0.0, 0.0, 0); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 58, __pyx_L1_error) + __pyx_v_S = __pyx_t_1; + + /* "hddm_wfpt/integrate.pxi":60 + * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) + * + * for i_t from 1 <= i_t <= n_st: # <<<<<<<<<<<<<< + * t_tag = lb_t + ht * i_t + * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) + */ + __Pyx_TraceLine(60,1,__PYX_ERR(3, 60, __pyx_L1_error)) + __pyx_t_2 = __pyx_v_n_st; + for (__pyx_v_i_t = 1; __pyx_v_i_t <= __pyx_t_2; __pyx_v_i_t++) { + + /* "hddm_wfpt/integrate.pxi":61 + * + * for i_t from 1 <= i_t <= n_st: + * t_tag = lb_t + ht * i_t # <<<<<<<<<<<<<< + * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) + * if i_t&1: #check if i is odd + */ + __Pyx_TraceLine(61,1,__PYX_ERR(3, 61, __pyx_L1_error)) + __pyx_v_t_tag = (__pyx_v_lb_t + (__pyx_v_ht * __pyx_v_i_t)); + + /* "hddm_wfpt/integrate.pxi":62 + * for i_t from 1 <= i_t <= n_st: + * t_tag = lb_t + ht * i_t + * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) # <<<<<<<<<<<<<< + * if i_t&1: #check if i is odd + * S += (4 * y) + */ + __Pyx_TraceLine(62,1,__PYX_ERR(3, 62, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_tag, __pyx_v_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_n_sz, 0.0, 0.0, 0); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 62, __pyx_L1_error) + __pyx_v_y = __pyx_t_1; + + /* "hddm_wfpt/integrate.pxi":63 + * t_tag = lb_t + ht * i_t + * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) + * if i_t&1: #check if i is odd # <<<<<<<<<<<<<< + * S += (4 * y) + * else: + */ + __Pyx_TraceLine(63,1,__PYX_ERR(3, 63, __pyx_L1_error)) + __pyx_t_3 = ((__pyx_v_i_t & 1) != 0); + if (__pyx_t_3) { + + /* "hddm_wfpt/integrate.pxi":64 + * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) + * if i_t&1: #check if i is odd + * S += (4 * y) # <<<<<<<<<<<<<< + * else: + * S += (2 * y) + */ + __Pyx_TraceLine(64,1,__PYX_ERR(3, 64, __pyx_L1_error)) + __pyx_v_S = (__pyx_v_S + (4.0 * __pyx_v_y)); + + /* "hddm_wfpt/integrate.pxi":63 + * t_tag = lb_t + ht * i_t + * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) + * if i_t&1: #check if i is odd # <<<<<<<<<<<<<< + * S += (4 * y) + * else: + */ + goto __pyx_L5; + } + + /* "hddm_wfpt/integrate.pxi":66 + * S += (4 * y) + * else: + * S += (2 * y) # <<<<<<<<<<<<<< + * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y + * S = S/ (ub_t-lb_t) + */ + __Pyx_TraceLine(66,1,__PYX_ERR(3, 66, __pyx_L1_error)) + /*else*/ { + __pyx_v_S = (__pyx_v_S + (2.0 * __pyx_v_y)); + } + __pyx_L5:; + } + + /* "hddm_wfpt/integrate.pxi":67 + * else: + * S += (2 * y) + * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y # <<<<<<<<<<<<<< + * S = S/ (ub_t-lb_t) + * + */ + __Pyx_TraceLine(67,1,__PYX_ERR(3, 67, __pyx_L1_error)) + __pyx_v_S = (__pyx_v_S - __pyx_v_y); + + /* "hddm_wfpt/integrate.pxi":68 + * S += (2 * y) + * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y + * S = S/ (ub_t-lb_t) # <<<<<<<<<<<<<< + * + * return (ht * S / 3) + */ + __Pyx_TraceLine(68,1,__PYX_ERR(3, 68, __pyx_L1_error)) + __pyx_v_S = (__pyx_v_S / (__pyx_v_ub_t - __pyx_v_lb_t)); + + /* "hddm_wfpt/integrate.pxi":70 + * S = S/ (ub_t-lb_t) + * + * return (ht * S / 3) # <<<<<<<<<<<<<< + * + * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, + */ + __Pyx_TraceLine(70,1,__PYX_ERR(3, 70, __pyx_L1_error)) + __pyx_r = ((__pyx_v_ht * __pyx_v_S) / 3.0); + goto __pyx_L0; + + /* "hddm_wfpt/integrate.pxi":47 + * return ((ht+hz) * S / 3) + * + * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< + * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" + * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.simpson_2D", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/integrate.pxi":72 + * return (ht * S / 3) + * + * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< + * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, + * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: + */ + +static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_pdf_err, double __pyx_v_lb_z, double __pyx_v_ub_z, double __pyx_v_lb_t, double __pyx_v_ub_t, double __pyx_v_ZT, double __pyx_v_simps_err, double __pyx_v_S, double __pyx_v_f_beg, double __pyx_v_f_end, double __pyx_v_f_mid, int __pyx_v_bottom) { + double __pyx_v_z_c; + double __pyx_v_z_d; + double __pyx_v_z_e; + double __pyx_v_t_c; + double __pyx_v_t_d; + double __pyx_v_t_e; + double __pyx_v_h; + double __pyx_v_fd; + double __pyx_v_fe; + double __pyx_v_Sleft; + double __pyx_v_Sright; + double __pyx_v_S2; + double __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + double __pyx_t_2; + int __pyx_t_3; + double __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("adaptiveSimpsonsAux", __pyx_f[3], 72, 1, __PYX_ERR(3, 72, __pyx_L1_error)); + + /* "hddm_wfpt/integrate.pxi":81 + * #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) + * + * if (ub_t-lb_t) == 0: #integration over sz # <<<<<<<<<<<<<< + * h = ub_z - lb_z + * z_c = (ub_z + lb_z)/2. + */ + __Pyx_TraceLine(81,1,__PYX_ERR(3, 81, __pyx_L1_error)) + __pyx_t_1 = ((__pyx_v_ub_t - __pyx_v_lb_t) == 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/integrate.pxi":82 + * + * if (ub_t-lb_t) == 0: #integration over sz + * h = ub_z - lb_z # <<<<<<<<<<<<<< + * z_c = (ub_z + lb_z)/2. + * z_d = (lb_z + z_c)/2. + */ + __Pyx_TraceLine(82,1,__PYX_ERR(3, 82, __pyx_L1_error)) + __pyx_v_h = (__pyx_v_ub_z - __pyx_v_lb_z); + + /* "hddm_wfpt/integrate.pxi":83 + * if (ub_t-lb_t) == 0: #integration over sz + * h = ub_z - lb_z + * z_c = (ub_z + lb_z)/2. # <<<<<<<<<<<<<< + * z_d = (lb_z + z_c)/2. + * z_e = (z_c + ub_z)/2. + */ + __Pyx_TraceLine(83,1,__PYX_ERR(3, 83, __pyx_L1_error)) + __pyx_v_z_c = ((__pyx_v_ub_z + __pyx_v_lb_z) / 2.); + + /* "hddm_wfpt/integrate.pxi":84 + * h = ub_z - lb_z + * z_c = (ub_z + lb_z)/2. + * z_d = (lb_z + z_c)/2. # <<<<<<<<<<<<<< + * z_e = (z_c + ub_z)/2. + * t_c = t + */ + __Pyx_TraceLine(84,1,__PYX_ERR(3, 84, __pyx_L1_error)) + __pyx_v_z_d = ((__pyx_v_lb_z + __pyx_v_z_c) / 2.); + + /* "hddm_wfpt/integrate.pxi":85 + * z_c = (ub_z + lb_z)/2. + * z_d = (lb_z + z_c)/2. + * z_e = (z_c + ub_z)/2. # <<<<<<<<<<<<<< + * t_c = t + * t_d = t + */ + __Pyx_TraceLine(85,1,__PYX_ERR(3, 85, __pyx_L1_error)) + __pyx_v_z_e = ((__pyx_v_z_c + __pyx_v_ub_z) / 2.); + + /* "hddm_wfpt/integrate.pxi":86 + * z_d = (lb_z + z_c)/2. + * z_e = (z_c + ub_z)/2. + * t_c = t # <<<<<<<<<<<<<< + * t_d = t + * t_e = t + */ + __Pyx_TraceLine(86,1,__PYX_ERR(3, 86, __pyx_L1_error)) + __pyx_v_t_c = __pyx_v_t; + + /* "hddm_wfpt/integrate.pxi":87 + * z_e = (z_c + ub_z)/2. + * t_c = t + * t_d = t # <<<<<<<<<<<<<< + * t_e = t + * + */ + __Pyx_TraceLine(87,1,__PYX_ERR(3, 87, __pyx_L1_error)) + __pyx_v_t_d = __pyx_v_t; + + /* "hddm_wfpt/integrate.pxi":88 + * t_c = t + * t_d = t + * t_e = t # <<<<<<<<<<<<<< + * + * else: #integration over t + */ + __Pyx_TraceLine(88,1,__PYX_ERR(3, 88, __pyx_L1_error)) + __pyx_v_t_e = __pyx_v_t; + + /* "hddm_wfpt/integrate.pxi":81 + * #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) + * + * if (ub_t-lb_t) == 0: #integration over sz # <<<<<<<<<<<<<< + * h = ub_z - lb_z + * z_c = (ub_z + lb_z)/2. + */ + goto __pyx_L3; + } + + /* "hddm_wfpt/integrate.pxi":91 + * + * else: #integration over t + * h = ub_t - lb_t # <<<<<<<<<<<<<< + * t_c = (ub_t + lb_t)/2. + * t_d = (lb_t + t_c)/2. + */ + __Pyx_TraceLine(91,1,__PYX_ERR(3, 91, __pyx_L1_error)) + /*else*/ { + __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); + + /* "hddm_wfpt/integrate.pxi":92 + * else: #integration over t + * h = ub_t - lb_t + * t_c = (ub_t + lb_t)/2. # <<<<<<<<<<<<<< + * t_d = (lb_t + t_c)/2. + * t_e = (t_c + ub_t)/2. + */ + __Pyx_TraceLine(92,1,__PYX_ERR(3, 92, __pyx_L1_error)) + __pyx_v_t_c = ((__pyx_v_ub_t + __pyx_v_lb_t) / 2.); + + /* "hddm_wfpt/integrate.pxi":93 + * h = ub_t - lb_t + * t_c = (ub_t + lb_t)/2. + * t_d = (lb_t + t_c)/2. # <<<<<<<<<<<<<< + * t_e = (t_c + ub_t)/2. + * z_c = z + */ + __Pyx_TraceLine(93,1,__PYX_ERR(3, 93, __pyx_L1_error)) + __pyx_v_t_d = ((__pyx_v_lb_t + __pyx_v_t_c) / 2.); + + /* "hddm_wfpt/integrate.pxi":94 + * t_c = (ub_t + lb_t)/2. + * t_d = (lb_t + t_c)/2. + * t_e = (t_c + ub_t)/2. # <<<<<<<<<<<<<< + * z_c = z + * z_d = z + */ + __Pyx_TraceLine(94,1,__PYX_ERR(3, 94, __pyx_L1_error)) + __pyx_v_t_e = ((__pyx_v_t_c + __pyx_v_ub_t) / 2.); + + /* "hddm_wfpt/integrate.pxi":95 + * t_d = (lb_t + t_c)/2. + * t_e = (t_c + ub_t)/2. + * z_c = z # <<<<<<<<<<<<<< + * z_d = z + * z_e = z + */ + __Pyx_TraceLine(95,1,__PYX_ERR(3, 95, __pyx_L1_error)) + __pyx_v_z_c = __pyx_v_z; + + /* "hddm_wfpt/integrate.pxi":96 + * t_e = (t_c + ub_t)/2. + * z_c = z + * z_d = z # <<<<<<<<<<<<<< + * z_e = z + * + */ + __Pyx_TraceLine(96,1,__PYX_ERR(3, 96, __pyx_L1_error)) + __pyx_v_z_d = __pyx_v_z; + + /* "hddm_wfpt/integrate.pxi":97 + * z_c = z + * z_d = z + * z_e = z # <<<<<<<<<<<<<< + * + * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT + */ + __Pyx_TraceLine(97,1,__PYX_ERR(3, 97, __pyx_L1_error)) + __pyx_v_z_e = __pyx_v_z; + } + __pyx_L3:; + + /* "hddm_wfpt/integrate.pxi":99 + * z_e = z + * + * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT # <<<<<<<<<<<<<< + * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT + * + */ + __Pyx_TraceLine(99,1,__PYX_ERR(3, 99, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_d), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_d, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 99, __pyx_L1_error) + __pyx_v_fd = (__pyx_t_2 / __pyx_v_ZT); + + /* "hddm_wfpt/integrate.pxi":100 + * + * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT + * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT # <<<<<<<<<<<<<< + * + * Sleft = (h/12)*(f_beg + 4*fd + f_mid) + */ + __Pyx_TraceLine(100,1,__PYX_ERR(3, 100, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_e), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_e, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 100, __pyx_L1_error) + __pyx_v_fe = (__pyx_t_2 / __pyx_v_ZT); + + /* "hddm_wfpt/integrate.pxi":102 + * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT + * + * Sleft = (h/12)*(f_beg + 4*fd + f_mid) # <<<<<<<<<<<<<< + * Sright = (h/12)*(f_mid + 4*fe + f_end) + * S2 = Sleft + Sright + */ + __Pyx_TraceLine(102,1,__PYX_ERR(3, 102, __pyx_L1_error)) + __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_fd)) + __pyx_v_f_mid)); + + /* "hddm_wfpt/integrate.pxi":103 + * + * Sleft = (h/12)*(f_beg + 4*fd + f_mid) + * Sright = (h/12)*(f_mid + 4*fe + f_end) # <<<<<<<<<<<<<< + * S2 = Sleft + Sright + * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): + */ + __Pyx_TraceLine(103,1,__PYX_ERR(3, 103, __pyx_L1_error)) + __pyx_v_Sright = ((__pyx_v_h / 12.0) * ((__pyx_v_f_mid + (4.0 * __pyx_v_fe)) + __pyx_v_f_end)); + + /* "hddm_wfpt/integrate.pxi":104 + * Sleft = (h/12)*(f_beg + 4*fd + f_mid) + * Sright = (h/12)*(f_mid + 4*fe + f_end) + * S2 = Sleft + Sright # <<<<<<<<<<<<<< + * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): + * return S2 + (S2 - S)/15 + */ + __Pyx_TraceLine(104,1,__PYX_ERR(3, 104, __pyx_L1_error)) + __pyx_v_S2 = (__pyx_v_Sleft + __pyx_v_Sright); + + /* "hddm_wfpt/integrate.pxi":105 + * Sright = (h/12)*(f_mid + 4*fe + f_end) + * S2 = Sleft + Sright + * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): # <<<<<<<<<<<<<< + * return S2 + (S2 - S)/15 + * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + */ + __Pyx_TraceLine(105,1,__PYX_ERR(3, 105, __pyx_L1_error)) + __pyx_t_3 = (__pyx_v_bottom <= 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_3 = (fabs((__pyx_v_S2 - __pyx_v_S)) <= (15.0 * __pyx_v_simps_err)); + __pyx_t_1 = __pyx_t_3; + __pyx_L5_bool_binop_done:; + if (__pyx_t_1) { + + /* "hddm_wfpt/integrate.pxi":106 + * S2 = Sleft + Sright + * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): + * return S2 + (S2 - S)/15 # <<<<<<<<<<<<<< + * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, + */ + __Pyx_TraceLine(106,1,__PYX_ERR(3, 106, __pyx_L1_error)) + __pyx_r = (__pyx_v_S2 + ((__pyx_v_S2 - __pyx_v_S) / 15.0)); + goto __pyx_L0; + + /* "hddm_wfpt/integrate.pxi":105 + * Sright = (h/12)*(f_mid + 4*fe + f_end) + * S2 = Sleft + Sright + * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): # <<<<<<<<<<<<<< + * return S2 + (S2 - S)/15 + * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + */ + } + + /* "hddm_wfpt/integrate.pxi":107 + * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): + * return S2 + (S2 - S)/15 + * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< + * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, + * Sleft, f_beg, f_mid, fd, bottom-1) + \ + */ + __Pyx_TraceLine(107,1,__PYX_ERR(3, 107, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_z_c, __pyx_v_lb_t, __pyx_v_t_c, __pyx_v_ZT, (__pyx_v_simps_err / 2.0), __pyx_v_Sleft, __pyx_v_f_beg, __pyx_v_f_mid, __pyx_v_fd, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 107, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":110 + * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, + * Sleft, f_beg, f_mid, fd, bottom-1) + \ + * adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< + * z_c, ub_z, t_c, ub_t, ZT, simps_err/2, + * Sright, f_mid, f_end, fe, bottom-1) + */ + __Pyx_TraceLine(110,1,__PYX_ERR(3, 110, __pyx_L1_error)) + __pyx_t_4 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_z_c, __pyx_v_ub_z, __pyx_v_t_c, __pyx_v_ub_t, __pyx_v_ZT, (__pyx_v_simps_err / 2.0), __pyx_v_Sright, __pyx_v_f_mid, __pyx_v_f_end, __pyx_v_fe, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_4 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 110, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":109 + * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, + * Sleft, f_beg, f_mid, fd, bottom-1) + \ # <<<<<<<<<<<<<< + * adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + * z_c, ub_z, t_c, ub_t, ZT, simps_err/2, + */ + __Pyx_TraceLine(109,1,__PYX_ERR(3, 109, __pyx_L1_error)) + __pyx_r = (__pyx_t_2 + __pyx_t_4); + goto __pyx_L0; + + /* "hddm_wfpt/integrate.pxi":72 + * return (ht * S / 3) + * + * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< + * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, + * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.adaptiveSimpsonsAux", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/integrate.pxi":114 + * Sright, f_mid, f_end, fe, bottom-1) + * + * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< + * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, + * double simps_err, int maxRecursionDepth) nogil: + */ + +static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_pdf_err, double __pyx_v_lb_z, double __pyx_v_ub_z, double __pyx_v_lb_t, double __pyx_v_ub_t, double __pyx_v_simps_err, int __pyx_v_maxRecursionDepth) { + double __pyx_v_h; + double __pyx_v_ZT; + double __pyx_v_c_t; + double __pyx_v_c_z; + double __pyx_v_f_beg; + double __pyx_v_f_end; + double __pyx_v_f_mid; + double __pyx_v_S; + double __pyx_v_res; + double __pyx_r; + __Pyx_TraceDeclarations + int __pyx_t_1; + double __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("adaptiveSimpsons_1D", __pyx_f[3], 114, 1, __PYX_ERR(3, 114, __pyx_L1_error)); + + /* "hddm_wfpt/integrate.pxi":120 + * cdef double h + * + * if (ub_t - lb_t) == 0: #integration over z # <<<<<<<<<<<<<< + * lb_t = t + * ub_t = t + */ + __Pyx_TraceLine(120,1,__PYX_ERR(3, 120, __pyx_L1_error)) + __pyx_t_1 = ((__pyx_v_ub_t - __pyx_v_lb_t) == 0.0); + if (__pyx_t_1) { + + /* "hddm_wfpt/integrate.pxi":121 + * + * if (ub_t - lb_t) == 0: #integration over z + * lb_t = t # <<<<<<<<<<<<<< + * ub_t = t + * h = ub_z - lb_z + */ + __Pyx_TraceLine(121,1,__PYX_ERR(3, 121, __pyx_L1_error)) + __pyx_v_lb_t = __pyx_v_t; + + /* "hddm_wfpt/integrate.pxi":122 + * if (ub_t - lb_t) == 0: #integration over z + * lb_t = t + * ub_t = t # <<<<<<<<<<<<<< + * h = ub_z - lb_z + * else: #integration over t + */ + __Pyx_TraceLine(122,1,__PYX_ERR(3, 122, __pyx_L1_error)) + __pyx_v_ub_t = __pyx_v_t; + + /* "hddm_wfpt/integrate.pxi":123 + * lb_t = t + * ub_t = t + * h = ub_z - lb_z # <<<<<<<<<<<<<< + * else: #integration over t + * h = (ub_t-lb_t) + */ + __Pyx_TraceLine(123,1,__PYX_ERR(3, 123, __pyx_L1_error)) + __pyx_v_h = (__pyx_v_ub_z - __pyx_v_lb_z); + + /* "hddm_wfpt/integrate.pxi":120 + * cdef double h + * + * if (ub_t - lb_t) == 0: #integration over z # <<<<<<<<<<<<<< + * lb_t = t + * ub_t = t + */ + goto __pyx_L3; + } + + /* "hddm_wfpt/integrate.pxi":125 + * h = ub_z - lb_z + * else: #integration over t + * h = (ub_t-lb_t) # <<<<<<<<<<<<<< + * lb_z = z + * ub_z = z + */ + __Pyx_TraceLine(125,1,__PYX_ERR(3, 125, __pyx_L1_error)) + /*else*/ { + __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); + + /* "hddm_wfpt/integrate.pxi":126 + * else: #integration over t + * h = (ub_t-lb_t) + * lb_z = z # <<<<<<<<<<<<<< + * ub_z = z + * + */ + __Pyx_TraceLine(126,1,__PYX_ERR(3, 126, __pyx_L1_error)) + __pyx_v_lb_z = __pyx_v_z; + + /* "hddm_wfpt/integrate.pxi":127 + * h = (ub_t-lb_t) + * lb_z = z + * ub_z = z # <<<<<<<<<<<<<< + * + * cdef double ZT = h + */ + __Pyx_TraceLine(127,1,__PYX_ERR(3, 127, __pyx_L1_error)) + __pyx_v_ub_z = __pyx_v_z; + } + __pyx_L3:; + + /* "hddm_wfpt/integrate.pxi":129 + * ub_z = z + * + * cdef double ZT = h # <<<<<<<<<<<<<< + * cdef double c_t = (lb_t + ub_t)/2. + * cdef double c_z = (lb_z + ub_z)/2. + */ + __Pyx_TraceLine(129,1,__PYX_ERR(3, 129, __pyx_L1_error)) + __pyx_v_ZT = __pyx_v_h; + + /* "hddm_wfpt/integrate.pxi":130 + * + * cdef double ZT = h + * cdef double c_t = (lb_t + ub_t)/2. # <<<<<<<<<<<<<< + * cdef double c_z = (lb_z + ub_z)/2. + * + */ + __Pyx_TraceLine(130,1,__PYX_ERR(3, 130, __pyx_L1_error)) + __pyx_v_c_t = ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.); + + /* "hddm_wfpt/integrate.pxi":131 + * cdef double ZT = h + * cdef double c_t = (lb_t + ub_t)/2. + * cdef double c_z = (lb_z + ub_z)/2. # <<<<<<<<<<<<<< + * + * cdef double f_beg, f_end, f_mid, S + */ + __Pyx_TraceLine(131,1,__PYX_ERR(3, 131, __pyx_L1_error)) + __pyx_v_c_z = ((__pyx_v_lb_z + __pyx_v_ub_z) / 2.); + + /* "hddm_wfpt/integrate.pxi":134 + * + * cdef double f_beg, f_end, f_mid, S + * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT # <<<<<<<<<<<<<< + * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT + * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT + */ + __Pyx_TraceLine(134,1,__PYX_ERR(3, 134, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_lb_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_lb_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 134, __pyx_L1_error) + __pyx_v_f_beg = (__pyx_t_2 / __pyx_v_ZT); + + /* "hddm_wfpt/integrate.pxi":135 + * cdef double f_beg, f_end, f_mid, S + * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT + * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT # <<<<<<<<<<<<<< + * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT + * S = (h/6)*(f_beg + 4*f_mid + f_end) + */ + __Pyx_TraceLine(135,1,__PYX_ERR(3, 135, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_ub_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_ub_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 135, __pyx_L1_error) + __pyx_v_f_end = (__pyx_t_2 / __pyx_v_ZT); + + /* "hddm_wfpt/integrate.pxi":136 + * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT + * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT + * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT # <<<<<<<<<<<<<< + * S = (h/6)*(f_beg + 4*f_mid + f_end) + * cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + */ + __Pyx_TraceLine(136,1,__PYX_ERR(3, 136, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_c_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_c_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 136, __pyx_L1_error) + __pyx_v_f_mid = (__pyx_t_2 / __pyx_v_ZT); + + /* "hddm_wfpt/integrate.pxi":137 + * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT + * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT + * S = (h/6)*(f_beg + 4*f_mid + f_end) # <<<<<<<<<<<<<< + * cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, + * lb_z, ub_z, lb_t, ub_t, ZT, simps_err, + */ + __Pyx_TraceLine(137,1,__PYX_ERR(3, 137, __pyx_L1_error)) + __pyx_v_S = ((__pyx_v_h / 6.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_f_mid)) + __pyx_v_f_end)); + + /* "hddm_wfpt/integrate.pxi":138 + * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT + * S = (h/6)*(f_beg + 4*f_mid + f_end) + * cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< + * lb_z, ub_z, lb_t, ub_t, ZT, simps_err, + * S, f_beg, f_end, f_mid, maxRecursionDepth) + */ + __Pyx_TraceLine(138,1,__PYX_ERR(3, 138, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_ub_t, __pyx_v_ZT, __pyx_v_simps_err, __pyx_v_S, __pyx_v_f_beg, __pyx_v_f_end, __pyx_v_f_mid, __pyx_v_maxRecursionDepth); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 138, __pyx_L1_error) + __pyx_v_res = __pyx_t_2; + + /* "hddm_wfpt/integrate.pxi":141 + * lb_z, ub_z, lb_t, ub_t, ZT, simps_err, + * S, f_beg, f_end, f_mid, maxRecursionDepth) + * return res # <<<<<<<<<<<<<< + * + * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, + */ + __Pyx_TraceLine(141,1,__PYX_ERR(3, 141, __pyx_L1_error)) + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "hddm_wfpt/integrate.pxi":114 + * Sright, f_mid, f_end, fe, bottom-1) + * + * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< + * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, + * double simps_err, int maxRecursionDepth) nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.adaptiveSimpsons_1D", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/integrate.pxi":143 + * return res + * + * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< + * double a, double z, double t, double + * pdf_err, double err_1d, double lb_z, + */ + +static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_pdf_err, double __pyx_v_err_1d, double __pyx_v_lb_z, double __pyx_v_ub_z, double __pyx_v_lb_t, double __pyx_v_ub_t, double __pyx_v_st, double __pyx_v_err_2d, double __pyx_v_S, double __pyx_v_f_beg, double __pyx_v_f_end, double __pyx_v_f_mid, int __pyx_v_maxRecursionDepth_sz, int __pyx_v_bottom) { + double __pyx_v_fd; + double __pyx_v_fe; + double __pyx_v_Sleft; + double __pyx_v_Sright; + double __pyx_v_S2; + double __pyx_v_t_c; + double __pyx_v_t_d; + double __pyx_v_t_e; + double __pyx_v_h; + double __pyx_r; + __Pyx_TraceDeclarations + double __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + double __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("adaptiveSimpsonsAux_2D", __pyx_f[3], 143, 1, __PYX_ERR(3, 143, __pyx_L1_error)); + + /* "hddm_wfpt/integrate.pxi":156 + * #print "in AdaptiveSimpsAux_2D: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) + * + * cdef double t_c = (ub_t + lb_t)/2. # <<<<<<<<<<<<<< + * cdef double t_d = (lb_t + t_c)/2. + * cdef double t_e = (t_c + ub_t)/2. + */ + __Pyx_TraceLine(156,1,__PYX_ERR(3, 156, __pyx_L1_error)) + __pyx_v_t_c = ((__pyx_v_ub_t + __pyx_v_lb_t) / 2.); + + /* "hddm_wfpt/integrate.pxi":157 + * + * cdef double t_c = (ub_t + lb_t)/2. + * cdef double t_d = (lb_t + t_c)/2. # <<<<<<<<<<<<<< + * cdef double t_e = (t_c + ub_t)/2. + * cdef double h = ub_t - lb_t + */ + __Pyx_TraceLine(157,1,__PYX_ERR(3, 157, __pyx_L1_error)) + __pyx_v_t_d = ((__pyx_v_lb_t + __pyx_v_t_c) / 2.); + + /* "hddm_wfpt/integrate.pxi":158 + * cdef double t_c = (ub_t + lb_t)/2. + * cdef double t_d = (lb_t + t_c)/2. + * cdef double t_e = (t_c + ub_t)/2. # <<<<<<<<<<<<<< + * cdef double h = ub_t - lb_t + * + */ + __Pyx_TraceLine(158,1,__PYX_ERR(3, 158, __pyx_L1_error)) + __pyx_v_t_e = ((__pyx_v_t_c + __pyx_v_ub_t) / 2.); + + /* "hddm_wfpt/integrate.pxi":159 + * cdef double t_d = (lb_t + t_c)/2. + * cdef double t_e = (t_c + ub_t)/2. + * cdef double h = ub_t - lb_t # <<<<<<<<<<<<<< + * + * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, + */ + __Pyx_TraceLine(159,1,__PYX_ERR(3, 159, __pyx_L1_error)) + __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); + + /* "hddm_wfpt/integrate.pxi":161 + * cdef double h = ub_t - lb_t + * + * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, + */ + __Pyx_TraceLine(161,1,__PYX_ERR(3, 161, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_d, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 161, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":162 + * + * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< + * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st + */ + __Pyx_TraceLine(162,1,__PYX_ERR(3, 162, __pyx_L1_error)) + __pyx_v_fd = (__pyx_t_1 / __pyx_v_st); + + /* "hddm_wfpt/integrate.pxi":163 + * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * + */ + __Pyx_TraceLine(163,1,__PYX_ERR(3, 163, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_e, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 163, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":164 + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< + * + * Sleft = (h/12)*(f_beg + 4*fd + f_mid) + */ + __Pyx_TraceLine(164,1,__PYX_ERR(3, 164, __pyx_L1_error)) + __pyx_v_fe = (__pyx_t_1 / __pyx_v_st); + + /* "hddm_wfpt/integrate.pxi":166 + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * + * Sleft = (h/12)*(f_beg + 4*fd + f_mid) # <<<<<<<<<<<<<< + * Sright = (h/12)*(f_mid + 4*fe + f_end) + * S2 = Sleft + Sright + */ + __Pyx_TraceLine(166,1,__PYX_ERR(3, 166, __pyx_L1_error)) + __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_fd)) + __pyx_v_f_mid)); + + /* "hddm_wfpt/integrate.pxi":167 + * + * Sleft = (h/12)*(f_beg + 4*fd + f_mid) + * Sright = (h/12)*(f_mid + 4*fe + f_end) # <<<<<<<<<<<<<< + * S2 = Sleft + Sright + * + */ + __Pyx_TraceLine(167,1,__PYX_ERR(3, 167, __pyx_L1_error)) + __pyx_v_Sright = ((__pyx_v_h / 12.0) * ((__pyx_v_f_mid + (4.0 * __pyx_v_fe)) + __pyx_v_f_end)); + + /* "hddm_wfpt/integrate.pxi":168 + * Sleft = (h/12)*(f_beg + 4*fd + f_mid) + * Sright = (h/12)*(f_mid + 4*fe + f_end) + * S2 = Sleft + Sright # <<<<<<<<<<<<<< + * + * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): + */ + __Pyx_TraceLine(168,1,__PYX_ERR(3, 168, __pyx_L1_error)) + __pyx_v_S2 = (__pyx_v_Sleft + __pyx_v_Sright); + + /* "hddm_wfpt/integrate.pxi":170 + * S2 = Sleft + Sright + * + * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): # <<<<<<<<<<<<<< + * return S2 + (S2 - S)/15; + * + */ + __Pyx_TraceLine(170,1,__PYX_ERR(3, 170, __pyx_L1_error)) + __pyx_t_3 = (__pyx_v_bottom <= 0); + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (fabs((__pyx_v_S2 - __pyx_v_S)) <= (15.0 * __pyx_v_err_2d)); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "hddm_wfpt/integrate.pxi":171 + * + * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): + * return S2 + (S2 - S)/15; # <<<<<<<<<<<<<< + * + * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, + */ + __Pyx_TraceLine(171,1,__PYX_ERR(3, 171, __pyx_L1_error)) + __pyx_r = (__pyx_v_S2 + ((__pyx_v_S2 - __pyx_v_S) / 15.0)); + goto __pyx_L0; + + /* "hddm_wfpt/integrate.pxi":170 + * S2 = Sleft + Sright + * + * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): # <<<<<<<<<<<<<< + * return S2 + (S2 - S)/15; + * + */ + } + + /* "hddm_wfpt/integrate.pxi":173 + * return S2 + (S2 - S)/15; + * + * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< + * lb_z, ub_z, lb_t, t_c, st, err_2d/2, + * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ + */ + __Pyx_TraceLine(173,1,__PYX_ERR(3, 173, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_t_c, __pyx_v_st, (__pyx_v_err_2d / 2.0), __pyx_v_Sleft, __pyx_v_f_beg, __pyx_v_f_mid, __pyx_v_fd, __pyx_v_maxRecursionDepth_sz, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 173, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":176 + * lb_z, ub_z, lb_t, t_c, st, err_2d/2, + * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ + * adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< + * lb_z, ub_z, t_c, ub_t, st, err_2d/2, + * Sright, f_mid, f_end, fe, maxRecursionDepth_sz, bottom-1) + */ + __Pyx_TraceLine(176,1,__PYX_ERR(3, 176, __pyx_L1_error)) + __pyx_t_4 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_t_c, __pyx_v_ub_t, __pyx_v_st, (__pyx_v_err_2d / 2.0), __pyx_v_Sright, __pyx_v_f_mid, __pyx_v_f_end, __pyx_v_fe, __pyx_v_maxRecursionDepth_sz, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_4 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 176, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":175 + * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, + * lb_z, ub_z, lb_t, t_c, st, err_2d/2, + * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ # <<<<<<<<<<<<<< + * adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, + * lb_z, ub_z, t_c, ub_t, st, err_2d/2, + */ + __Pyx_TraceLine(175,1,__PYX_ERR(3, 175, __pyx_L1_error)) + __pyx_r = (__pyx_t_1 + __pyx_t_4); + goto __pyx_L0; + + /* "hddm_wfpt/integrate.pxi":143 + * return res + * + * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< + * double a, double z, double t, double + * pdf_err, double err_1d, double lb_z, + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.adaptiveSimpsonsAux_2D", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "hddm_wfpt/integrate.pxi":181 + * + * + * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< + * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, + * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: + */ + +static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_pdf_err, double __pyx_v_lb_z, double __pyx_v_ub_z, double __pyx_v_lb_t, double __pyx_v_ub_t, double __pyx_v_simps_err, int __pyx_v_maxRecursionDepth_sz, int __pyx_v_maxRecursionDepth_st) { + double __pyx_v_h; + double __pyx_v_st; + CYTHON_UNUSED double __pyx_v_c_t; + CYTHON_UNUSED double __pyx_v_c_z; + double __pyx_v_f_beg; + double __pyx_v_f_end; + double __pyx_v_f_mid; + double __pyx_v_S; + double __pyx_v_err_1d; + double __pyx_v_err_2d; + double __pyx_v_res; + double __pyx_r; + __Pyx_TraceDeclarations + double __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_TraceCall("adaptiveSimpsons_2D", __pyx_f[3], 181, 1, __PYX_ERR(3, 181, __pyx_L1_error)); + + /* "hddm_wfpt/integrate.pxi":185 + * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: + * + * cdef double h = (ub_t-lb_t) # <<<<<<<<<<<<<< + * + * cdef double st = (ub_t - lb_t) + */ + __Pyx_TraceLine(185,1,__PYX_ERR(3, 185, __pyx_L1_error)) + __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); + + /* "hddm_wfpt/integrate.pxi":187 + * cdef double h = (ub_t-lb_t) + * + * cdef double st = (ub_t - lb_t) # <<<<<<<<<<<<<< + * cdef double c_t = (lb_t + ub_t)/2. + * cdef double c_z = (lb_z + ub_z)/2. + */ + __Pyx_TraceLine(187,1,__PYX_ERR(3, 187, __pyx_L1_error)) + __pyx_v_st = (__pyx_v_ub_t - __pyx_v_lb_t); + + /* "hddm_wfpt/integrate.pxi":188 + * + * cdef double st = (ub_t - lb_t) + * cdef double c_t = (lb_t + ub_t)/2. # <<<<<<<<<<<<<< + * cdef double c_z = (lb_z + ub_z)/2. + * + */ + __Pyx_TraceLine(188,1,__PYX_ERR(3, 188, __pyx_L1_error)) + __pyx_v_c_t = ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.); + + /* "hddm_wfpt/integrate.pxi":189 + * cdef double st = (ub_t - lb_t) + * cdef double c_t = (lb_t + ub_t)/2. + * cdef double c_z = (lb_z + ub_z)/2. # <<<<<<<<<<<<<< + * + * cdef double f_beg, f_end, f_mid, S + */ + __Pyx_TraceLine(189,1,__PYX_ERR(3, 189, __pyx_L1_error)) + __pyx_v_c_z = ((__pyx_v_lb_z + __pyx_v_ub_z) / 2.); + + /* "hddm_wfpt/integrate.pxi":192 + * + * cdef double f_beg, f_end, f_mid, S + * cdef double err_1d = simps_err # <<<<<<<<<<<<<< + * cdef double err_2d = simps_err + * + */ + __Pyx_TraceLine(192,1,__PYX_ERR(3, 192, __pyx_L1_error)) + __pyx_v_err_1d = __pyx_v_simps_err; + + /* "hddm_wfpt/integrate.pxi":193 + * cdef double f_beg, f_end, f_mid, S + * cdef double err_1d = simps_err + * cdef double err_2d = simps_err # <<<<<<<<<<<<<< + * + * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, + */ + __Pyx_TraceLine(193,1,__PYX_ERR(3, 193, __pyx_L1_error)) + __pyx_v_err_2d = __pyx_v_simps_err; + + /* "hddm_wfpt/integrate.pxi":195 + * cdef double err_2d = simps_err + * + * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * + */ + __Pyx_TraceLine(195,1,__PYX_ERR(3, 195, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_lb_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 195, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":196 + * + * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< + * + * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, + */ + __Pyx_TraceLine(196,1,__PYX_ERR(3, 196, __pyx_L1_error)) + __pyx_v_f_beg = (__pyx_t_1 / __pyx_v_st); + + /* "hddm_wfpt/integrate.pxi":198 + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * + * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, + */ + __Pyx_TraceLine(198,1,__PYX_ERR(3, 198, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_ub_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 198, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":199 + * + * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< + * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st + */ + __Pyx_TraceLine(199,1,__PYX_ERR(3, 199, __pyx_L1_error)) + __pyx_v_f_end = (__pyx_t_1 / __pyx_v_st); + + /* "hddm_wfpt/integrate.pxi":200 + * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * S = (h/6)*(f_beg + 4*f_mid + f_end) + */ + __Pyx_TraceLine(200,1,__PYX_ERR(3, 200, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.0), __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 200, __pyx_L1_error) + + /* "hddm_wfpt/integrate.pxi":201 + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< + * S = (h/6)*(f_beg + 4*f_mid + f_end) + * cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, + */ + __Pyx_TraceLine(201,1,__PYX_ERR(3, 201, __pyx_L1_error)) + __pyx_v_f_mid = (__pyx_t_1 / __pyx_v_st); + + /* "hddm_wfpt/integrate.pxi":202 + * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * S = (h/6)*(f_beg + 4*f_mid + f_end) # <<<<<<<<<<<<<< + * cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, + * lb_z, ub_z, lb_t, ub_t, st, err_2d, + */ + __Pyx_TraceLine(202,1,__PYX_ERR(3, 202, __pyx_L1_error)) + __pyx_v_S = ((__pyx_v_h / 6.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_f_mid)) + __pyx_v_f_end)); + + /* "hddm_wfpt/integrate.pxi":203 + * 0, 0, err_1d, maxRecursionDepth_sz)/st + * S = (h/6)*(f_beg + 4*f_mid + f_end) + * cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< + * lb_z, ub_z, lb_t, ub_t, st, err_2d, + * S, f_beg, f_end, f_mid, maxRecursionDepth_sz, maxRecursionDepth_st) + */ + __Pyx_TraceLine(203,1,__PYX_ERR(3, 203, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_ub_t, __pyx_v_st, __pyx_v_err_2d, __pyx_v_S, __pyx_v_f_beg, __pyx_v_f_end, __pyx_v_f_mid, __pyx_v_maxRecursionDepth_sz, __pyx_v_maxRecursionDepth_st); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 203, __pyx_L1_error) + __pyx_v_res = __pyx_t_1; + + /* "hddm_wfpt/integrate.pxi":206 + * lb_z, ub_z, lb_t, ub_t, st, err_2d, + * S, f_beg, f_end, f_mid, maxRecursionDepth_sz, maxRecursionDepth_st) + * return res # <<<<<<<<<<<<<< + */ + __Pyx_TraceLine(206,1,__PYX_ERR(3, 206, __pyx_L1_error)) + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "hddm_wfpt/integrate.pxi":181 + * + * + * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< + * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, + * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("wfpt.adaptiveSimpsons_2D", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 1); + return __pyx_r; +} + +/* "wfpt.pyx":32 + * include 'integrate.pxi' + * + * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< + * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, + * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_3pdf_array(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_2pdf_array, "pdf_array(ndarray x, double v, double sv, double a, double z, double sz, double t, double st, double err=1e-4, bool logp=0, int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_3pdf_array = {"pdf_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_3pdf_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_2pdf_array}; +static PyObject *__pyx_pw_4wfpt_3pdf_array(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + double __pyx_v_v; + double __pyx_v_sv; + double __pyx_v_a; + double __pyx_v_z; + double __pyx_v_sz; + double __pyx_v_t; + double __pyx_v_st; + double __pyx_v_err; + int __pyx_v_logp; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pdf_array (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_logp,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 1); __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 2); __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 3); __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 4); __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 5); __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 6); __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 7); __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err); + if (value) { values[8] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_logp); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[11] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[12] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[13] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[14] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[15] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pdf_array") < 0)) __PYX_ERR(0, 32, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_v = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) + if (values[8]) { + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) + } else { + __pyx_v_err = ((double)((double)1e-4)); + } + if (values[9]) { + __pyx_v_logp = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_logp == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) + } else { + __pyx_v_logp = ((int)((int)0)); + } + if (values[10]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)2)); + } + if (values[11]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)2)); + } + if (values[12]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[13]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-3)); + } + if (values[14]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[15]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.pdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_2pdf_array(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_logp, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_logp, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_y = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + double __pyx_t_12; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_13; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__4) + __Pyx_RefNannySetupContext("pdf_array", 0); + __Pyx_TraceCall("pdf_array", __pyx_f[0], 32, 0, __PYX_ERR(0, 32, __pyx_L1_error)); + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 32, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":36 + * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): + * + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) + */ + __Pyx_TraceLine(36,0,__PYX_ERR(0, 36, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":38 + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t i + * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< + * + * for i in prange(size, nogil=True): + */ + __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 38, __pyx_L1_error) + } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_y = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "wfpt.pyx":40 + * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) + * + * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< + * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) + */ + __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error)) + { + #ifdef WITH_THREAD + PyThreadState *_save; + _save = NULL; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_8 = __pyx_v_size; + { + Py_ssize_t __pyx_parallel_temp0 = ((Py_ssize_t)0xbad0bad0); + const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0; + PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL; + int __pyx_parallel_why; + __pyx_parallel_why = 0; + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_10 = (__pyx_t_8 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_10 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_11, __pyx_t_12, __pyx_t_13) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + Py_BEGIN_ALLOW_THREADS + #endif /* _OPENMP */ + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) + #endif /* _OPENMP */ + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_10; __pyx_t_9++){ + if (__pyx_parallel_why < 2) + { + __pyx_v_i = (Py_ssize_t)(0 + 1 * __pyx_t_9); + + /* "wfpt.pyx":41 + * + * for i in prange(size, nogil=True): + * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< + * n_st, n_sz, use_adaptive, simps_err) + * + */ + __Pyx_TraceLine(41,1,__PYX_ERR(0, 41, __pyx_L8_error)) + __pyx_t_11 = __pyx_v_i; + + /* "wfpt.pyx":42 + * for i in prange(size, nogil=True): + * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< + * + * y = y * (1 - p_outlier) + (w_outlier * p_outlier) + */ + __Pyx_TraceLine(42,1,__PYX_ERR(0, 42, __pyx_L8_error)) + __pyx_t_13.__pyx_n = 4; + __pyx_t_13.n_st = __pyx_v_n_st; + __pyx_t_13.n_sz = __pyx_v_n_sz; + __pyx_t_13.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_13.simps_err = __pyx_v_simps_err; + __pyx_t_12 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_13); if (unlikely(__pyx_t_12 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 41, __pyx_L8_error) + + /* "wfpt.pyx":41 + * + * for i in prange(size, nogil=True): + * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< + * n_st, n_sz, use_adaptive, simps_err) + * + */ + __Pyx_TraceLine(41,1,__PYX_ERR(0, 41, __pyx_L8_error)) + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_12; + goto __pyx_L11; + __pyx_L8_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + #ifdef _OPENMP + #pragma omp flush(__pyx_parallel_exc_type) + #endif /* _OPENMP */ + if (!__pyx_parallel_exc_type) { + __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb); + __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno; + __Pyx_GOTREF(__pyx_parallel_exc_type); + } + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_parallel_why = 4; + goto __pyx_L10; + __pyx_L10:; + #ifdef _OPENMP + #pragma omp critical(__pyx_parallel_lastprivates0) + #endif /* _OPENMP */ + { + __pyx_parallel_temp0 = __pyx_v_i; + } + __pyx_L11:; + #ifdef _OPENMP + #pragma omp flush(__pyx_parallel_why) + #endif /* _OPENMP */ + } + } + #ifdef _OPENMP + Py_END_ALLOW_THREADS + #else +{ +#ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + #endif /* _OPENMP */ + /* Clean up any temporaries */ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + #ifndef _OPENMP +} +#endif /* _OPENMP */ + } + } + if (__pyx_parallel_exc_type) { + /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */ + __pyx_parallel_why = 4; + } + if (__pyx_parallel_why) { + __pyx_v_i = __pyx_parallel_temp0; + switch (__pyx_parallel_why) { + case 4: + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_GIVEREF(__pyx_parallel_exc_type); + __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); + __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + goto __pyx_L4_error; + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "wfpt.pyx":40 + * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) + * + * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< + * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) + */ + __Pyx_TraceLine(40,1,__PYX_ERR(0, 40, __pyx_L4_error)) + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L4_error: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L1_error; + } + __pyx_L5:; + } + } + + /* "wfpt.pyx":44 + * n_st, n_sz, use_adaptive, simps_err) + * + * y = y * (1 - p_outlier) + (w_outlier * p_outlier) # <<<<<<<<<<<<<< + * if logp == 1: + * return np.log(y) + */ + __Pyx_TraceLine(44,0,__PYX_ERR(0, 44, __pyx_L1_error)) + __pyx_t_6 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_y), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_14 < 0)) { + PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0; + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 44, __pyx_L1_error) + } + __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "wfpt.pyx":45 + * + * y = y * (1 - p_outlier) + (w_outlier * p_outlier) + * if logp == 1: # <<<<<<<<<<<<<< + * return np.log(y) + * else: + */ + __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error)) + __pyx_t_18 = (__pyx_v_logp == 1); + if (__pyx_t_18) { + + /* "wfpt.pyx":46 + * y = y * (1 - p_outlier) + (w_outlier * p_outlier) + * if logp == 1: + * return np.log(y) # <<<<<<<<<<<<<< + * else: + * return y + */ + __Pyx_TraceLine(46,0,__PYX_ERR(0, 46, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_14 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_14 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_y)}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":45 + * + * y = y * (1 - p_outlier) + (w_outlier * p_outlier) + * if logp == 1: # <<<<<<<<<<<<<< + * return np.log(y) + * else: + */ + } + + /* "wfpt.pyx":48 + * return np.log(y) + * else: + * return y # <<<<<<<<<<<<<< + * + * cdef inline bint p_outlier_in_range(double p_outlier): + */ + __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error)) + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_y); + __pyx_r = ((PyObject *)__pyx_v_y); + goto __pyx_L0; + } + + /* "wfpt.pyx":32 + * include 'integrate.pxi' + * + * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< + * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, + * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.pdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":50 + * return y + * + * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< + * return (p_outlier >= 0) & (p_outlier <= 1) + * + */ + +static CYTHON_INLINE int __pyx_f_4wfpt_p_outlier_in_range(double __pyx_v_p_outlier) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("p_outlier_in_range", 0); + __Pyx_TraceCall("p_outlier_in_range", __pyx_f[0], 50, 0, __PYX_ERR(0, 50, __pyx_L1_error)); + + /* "wfpt.pyx":51 + * + * cdef inline bint p_outlier_in_range(double p_outlier): + * return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error)) + __pyx_r = ((__pyx_v_p_outlier >= 0.0) & (__pyx_v_p_outlier <= 1.0)); + goto __pyx_L0; + + /* "wfpt.pyx":50 + * return y + * + * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< + * return (p_outlier >= 0) & (p_outlier <= 1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("wfpt.p_outlier_in_range", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":54 + * + * + * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0.1): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_5wiener_like(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_4wiener_like, "wiener_like(ndarray x, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0.1)"); +static PyMethodDef __pyx_mdef_4wfpt_5wiener_like = {"wiener_like", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_5wiener_like, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_4wiener_like}; +static PyObject *__pyx_pw_4wfpt_5wiener_like(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + double __pyx_v_v; + double __pyx_v_sv; + double __pyx_v_a; + double __pyx_v_z; + double __pyx_v_sz; + double __pyx_v_t; + double __pyx_v_st; + double __pyx_v_err; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 1); __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 2); __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 3); __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 4); __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 5); __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 6); __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 7); __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 8); __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[11] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[12] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[13] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[14] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like") < 0)) __PYX_ERR(0, 54, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_v = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) + if (values[9]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)10)); + } + if (values[10]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)10)); + } + if (values[11]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[12]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-8)); + } + if (values[13]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[14]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.1)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_4wiener_like(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + double __pyx_v_p; + double __pyx_v_sum_logp; + double __pyx_v_wp_outlier; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + double __pyx_t_10; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__5) + __Pyx_RefNannySetupContext("wiener_like", 0); + __Pyx_TraceCall("wiener_like", __pyx_f[0], 54, 0, __PYX_ERR(0, 54, __pyx_L1_error)); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":57 + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0.1): + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef double p + */ + __Pyx_TraceLine(57,0,__PYX_ERR(0, 57, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":60 + * cdef Py_ssize_t i + * cdef double p + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef double wp_outlier = w_outlier * p_outlier + * + */ + __Pyx_TraceLine(60,0,__PYX_ERR(0, 60, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":61 + * cdef double p + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * + * if not p_outlier_in_range(p_outlier): + */ + __Pyx_TraceLine(61,0,__PYX_ERR(0, 61, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":63 + * cdef double wp_outlier = w_outlier * p_outlier + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(63,0,__PYX_ERR(0, 63, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_3 = (!__pyx_t_2); + if (__pyx_t_3) { + + /* "wfpt.pyx":64 + * + * if not p_outlier_in_range(p_outlier): + * return -np.inf # <<<<<<<<<<<<<< + * + * for i in range(size): + */ + __Pyx_TraceLine(64,0,__PYX_ERR(0, 64, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":63 + * cdef double wp_outlier = w_outlier * p_outlier + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":66 + * return -np.inf + * + * for i in range(size): # <<<<<<<<<<<<<< + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) + */ + __Pyx_TraceLine(66,0,__PYX_ERR(0, 66, __pyx_L1_error)) + __pyx_t_6 = __pyx_v_size; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "wfpt.pyx":67 + * + * for i in range(size): + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< + * n_st, n_sz, use_adaptive, simps_err) + * # If one probability = 0, the log sum will be -Inf + */ + __Pyx_TraceLine(67,0,__PYX_ERR(0, 67, __pyx_L1_error)) + __pyx_t_9 = __pyx_v_i; + + /* "wfpt.pyx":68 + * for i in range(size): + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier + */ + __Pyx_TraceLine(68,0,__PYX_ERR(0, 68, __pyx_L1_error)) + __pyx_t_11.__pyx_n = 4; + __pyx_t_11.n_st = __pyx_v_n_st; + __pyx_t_11.n_sz = __pyx_v_n_sz; + __pyx_t_11.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_11.simps_err = __pyx_v_simps_err; + __pyx_t_10 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_11); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_v_p = __pyx_t_10; + + /* "wfpt.pyx":70 + * n_st, n_sz, use_adaptive, simps_err) + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< + * if p == 0: + * return -np.inf + */ + __Pyx_TraceLine(70,0,__PYX_ERR(0, 70, __pyx_L1_error)) + __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); + + /* "wfpt.pyx":71 + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(71,0,__PYX_ERR(0, 71, __pyx_L1_error)) + __pyx_t_3 = (__pyx_v_p == 0.0); + if (__pyx_t_3) { + + /* "wfpt.pyx":72 + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: + * return -np.inf # <<<<<<<<<<<<<< + * + * sum_logp += log(p) + */ + __Pyx_TraceLine(72,0,__PYX_ERR(0, 72, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":71 + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":74 + * return -np.inf + * + * sum_logp += log(p) # <<<<<<<<<<<<<< + * + * return sum_logp + */ + __Pyx_TraceLine(74,0,__PYX_ERR(0, 74, __pyx_L1_error)) + __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); + } + + /* "wfpt.pyx":76 + * sum_logp += log(p) + * + * return sum_logp # <<<<<<<<<<<<<< + * + * def wiener_logp_array(np.ndarray[double, ndim=1] x, + */ + __Pyx_TraceLine(76,0,__PYX_ERR(0, 76, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":54 + * + * + * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0.1): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":78 + * return sum_logp + * + * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] v, + * np.ndarray[double, ndim=1] sv, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_7wiener_logp_array(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_6wiener_logp_array, "wiener_logp_array(ndarray x, ndarray v, ndarray sv, ndarray a, ndarray z, ndarray sz, ndarray t, ndarray st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0.1)"); +static PyMethodDef __pyx_mdef_4wfpt_7wiener_logp_array = {"wiener_logp_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_7wiener_logp_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_6wiener_logp_array}; +static PyObject *__pyx_pw_4wfpt_7wiener_logp_array(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_v = 0; + PyArrayObject *__pyx_v_sv = 0; + PyArrayObject *__pyx_v_a = 0; + PyArrayObject *__pyx_v_z = 0; + PyArrayObject *__pyx_v_sz = 0; + PyArrayObject *__pyx_v_t = 0; + PyArrayObject *__pyx_v_st = 0; + double __pyx_v_err; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_logp_array (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 1); __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 2); __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 3); __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 4); __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 5); __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 6); __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 7); __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 8); __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[11] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[12] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[13] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[14] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_logp_array") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_v = ((PyArrayObject *)values[1]); + __pyx_v_sv = ((PyArrayObject *)values[2]); + __pyx_v_a = ((PyArrayObject *)values[3]); + __pyx_v_z = ((PyArrayObject *)values[4]); + __pyx_v_sz = ((PyArrayObject *)values[5]); + __pyx_v_t = ((PyArrayObject *)values[6]); + __pyx_v_st = ((PyArrayObject *)values[7]); + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) + if (values[9]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)10)); + } + if (values[10]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)10)); + } + if (values[11]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[12]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-8)); + } + if (values[13]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[14]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.1)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_logp_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 79, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv), __pyx_ptype_5numpy_ndarray, 1, "sv", 0))) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 82, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sz), __pyx_ptype_5numpy_ndarray, 1, "sz", 0))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_t), __pyx_ptype_5numpy_ndarray, 1, "t", 0))) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_st), __pyx_ptype_5numpy_ndarray, 1, "st", 0))) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_6wiener_logp_array(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_sv, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_z, PyArrayObject *__pyx_v_sz, PyArrayObject *__pyx_v_t, PyArrayObject *__pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_logp = 0; + double __pyx_v_p; + double __pyx_v_wp_outlier; + __Pyx_LocalBuf_ND __pyx_pybuffernd_a; + __Pyx_Buffer __pyx_pybuffer_a; + __Pyx_LocalBuf_ND __pyx_pybuffernd_logp; + __Pyx_Buffer __pyx_pybuffer_logp; + __Pyx_LocalBuf_ND __pyx_pybuffernd_st; + __Pyx_Buffer __pyx_pybuffer_st; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sv; + __Pyx_Buffer __pyx_pybuffer_sv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sz; + __Pyx_Buffer __pyx_pybuffer_sz; + __Pyx_LocalBuf_ND __pyx_pybuffernd_t; + __Pyx_Buffer __pyx_pybuffer_t; + __Pyx_LocalBuf_ND __pyx_pybuffernd_v; + __Pyx_Buffer __pyx_pybuffer_v; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_z; + __Pyx_Buffer __pyx_pybuffer_z; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + double __pyx_t_21; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_22; + int __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__6) + __Pyx_RefNannySetupContext("wiener_logp_array", 0); + __Pyx_TraceCall("wiener_logp_array", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error)); + __pyx_pybuffer_logp.pybuffer.buf = NULL; + __pyx_pybuffer_logp.refcount = 0; + __pyx_pybuffernd_logp.data = NULL; + __pyx_pybuffernd_logp.rcbuffer = &__pyx_pybuffer_logp; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_v.pybuffer.buf = NULL; + __pyx_pybuffer_v.refcount = 0; + __pyx_pybuffernd_v.data = NULL; + __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v; + __pyx_pybuffer_sv.pybuffer.buf = NULL; + __pyx_pybuffer_sv.refcount = 0; + __pyx_pybuffernd_sv.data = NULL; + __pyx_pybuffernd_sv.rcbuffer = &__pyx_pybuffer_sv; + __pyx_pybuffer_a.pybuffer.buf = NULL; + __pyx_pybuffer_a.refcount = 0; + __pyx_pybuffernd_a.data = NULL; + __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a; + __pyx_pybuffer_z.pybuffer.buf = NULL; + __pyx_pybuffer_z.refcount = 0; + __pyx_pybuffernd_z.data = NULL; + __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z; + __pyx_pybuffer_sz.pybuffer.buf = NULL; + __pyx_pybuffer_sz.refcount = 0; + __pyx_pybuffernd_sz.data = NULL; + __pyx_pybuffernd_sz.rcbuffer = &__pyx_pybuffer_sz; + __pyx_pybuffer_t.pybuffer.buf = NULL; + __pyx_pybuffer_t.refcount = 0; + __pyx_pybuffernd_t.data = NULL; + __pyx_pybuffernd_t.rcbuffer = &__pyx_pybuffer_t; + __pyx_pybuffer_st.pybuffer.buf = NULL; + __pyx_pybuffer_st.refcount = 0; + __pyx_pybuffernd_st.data = NULL; + __pyx_pybuffernd_st.rcbuffer = &__pyx_pybuffer_st; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __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_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __pyx_pybuffernd_sv.diminfo[0].strides = __pyx_pybuffernd_sv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv.diminfo[0].shape = __pyx_pybuffernd_sv.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __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_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sz.rcbuffer->pybuffer, (PyObject*)__pyx_v_sz, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __pyx_pybuffernd_sz.diminfo[0].strides = __pyx_pybuffernd_sz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sz.diminfo[0].shape = __pyx_pybuffernd_sz.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t.rcbuffer->pybuffer, (PyObject*)__pyx_v_t, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_st.rcbuffer->pybuffer, (PyObject*)__pyx_v_st, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __pyx_pybuffernd_st.diminfo[0].strides = __pyx_pybuffernd_st.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_st.diminfo[0].shape = __pyx_pybuffernd_st.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":94 + * double w_outlier=0.1): + * + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) + */ + __Pyx_TraceLine(94,0,__PYX_ERR(0, 94, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":96 + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t i + * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< + * cdef double p + * cdef double wp_outlier = w_outlier * p_outlier + */ + __Pyx_TraceLine(96,0,__PYX_ERR(0, 96, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_logp.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_logp = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 96, __pyx_L1_error) + } else {__pyx_pybuffernd_logp.diminfo[0].strides = __pyx_pybuffernd_logp.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_logp.diminfo[0].shape = __pyx_pybuffernd_logp.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_logp = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "wfpt.pyx":98 + * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) + * cdef double p + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * + * if not p_outlier_in_range(p_outlier): + */ + __Pyx_TraceLine(98,0,__PYX_ERR(0, 98, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":100 + * cdef double wp_outlier = w_outlier * p_outlier + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * logp[:] = -np.inf + * return logp + */ + __Pyx_TraceLine(100,0,__PYX_ERR(0, 100, __pyx_L1_error)) + __pyx_t_8 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_9 = (!__pyx_t_8); + if (__pyx_t_9) { + + /* "wfpt.pyx":101 + * + * if not p_outlier_in_range(p_outlier): + * logp[:] = -np.inf # <<<<<<<<<<<<<< + * return logp + * + */ + __Pyx_TraceLine(101,0,__PYX_ERR(0, 101, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_logp), __pyx_slice__7, __pyx_t_6) < 0))) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "wfpt.pyx":102 + * if not p_outlier_in_range(p_outlier): + * logp[:] = -np.inf + * return logp # <<<<<<<<<<<<<< + * + * for i in range(size): + */ + __Pyx_TraceLine(102,0,__PYX_ERR(0, 102, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_logp); + __pyx_r = ((PyObject *)__pyx_v_logp); + goto __pyx_L0; + + /* "wfpt.pyx":100 + * cdef double wp_outlier = w_outlier * p_outlier + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * logp[:] = -np.inf + * return logp + */ + } + + /* "wfpt.pyx":104 + * return logp + * + * for i in range(size): # <<<<<<<<<<<<<< + * # print(x[i]) + * # print(v[i]) + */ + __Pyx_TraceLine(104,0,__PYX_ERR(0, 104, __pyx_L1_error)) + __pyx_t_10 = __pyx_v_size; + __pyx_t_11 = __pyx_t_10; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "wfpt.pyx":114 + * # print(st[i]) + * # print('params printed') + * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, # <<<<<<<<<<<<<< + * n_st, n_sz, use_adaptive, simps_err) + * # print(p) + */ + __Pyx_TraceLine(114,0,__PYX_ERR(0, 114, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_i; + + /* "wfpt.pyx":115 + * # print('params printed') + * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, + * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< + * # print(p) + * + */ + __Pyx_TraceLine(115,0,__PYX_ERR(0, 115, __pyx_L1_error)) + __pyx_t_22.__pyx_n = 4; + __pyx_t_22.n_st = __pyx_v_n_st; + __pyx_t_22.n_sz = __pyx_v_n_sz; + __pyx_t_22.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_22.simps_err = __pyx_v_simps_err; + __pyx_t_21 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sv.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_sv.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_z.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sz.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_sz.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_t.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_t.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_st.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_st.diminfo[0].strides)), __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_v_p = __pyx_t_21; + + /* "wfpt.pyx":119 + * + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< + * # print(p) + * if p == 0: + */ + __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error)) + __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); + + /* "wfpt.pyx":121 + * p = p * (1 - p_outlier) + wp_outlier + * # print(p) + * if p == 0: # <<<<<<<<<<<<<< + * logp[i] = -np.inf + * else: + */ + __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error)) + __pyx_t_9 = (__pyx_v_p == 0.0); + if (__pyx_t_9) { + + /* "wfpt.pyx":122 + * # print(p) + * if p == 0: + * logp[i] = -np.inf # <<<<<<<<<<<<<< + * else: + * logp[i] = np.log(p) + */ + __Pyx_TraceLine(122,0,__PYX_ERR(0, 122, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_logp.diminfo[0].strides) = __pyx_t_21; + + /* "wfpt.pyx":121 + * p = p * (1 - p_outlier) + wp_outlier + * # print(p) + * if p == 0: # <<<<<<<<<<<<<< + * logp[i] = -np.inf + * else: + */ + goto __pyx_L6; + } + + /* "wfpt.pyx":124 + * logp[i] = -np.inf + * else: + * logp[i] = np.log(p) # <<<<<<<<<<<<<< + * + * return logp + */ + __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error)) + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_23 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_23 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_23, 1+__pyx_t_23); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_logp.diminfo[0].strides) = __pyx_t_21; + } + __pyx_L6:; + } + + /* "wfpt.pyx":126 + * logp[i] = np.log(p) + * + * return logp # <<<<<<<<<<<<<< + * + * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, + */ + __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_logp); + __pyx_r = ((PyObject *)__pyx_v_logp); + goto __pyx_L0; + + /* "wfpt.pyx":78 + * return sum_logp + * + * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] v, + * np.ndarray[double, ndim=1] sv, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_logp.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_st.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sv.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sz.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_logp_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_logp.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_st.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sv.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sz.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_logp); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":128 + * return logp + * + * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_9wiener_like_rlddm(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_8wiener_like_rlddm, "wiener_like_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_9wiener_like_rlddm = {"wiener_like_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_9wiener_like_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_8wiener_like_rlddm}; +static PyObject *__pyx_pw_4wfpt_9wiener_like_rlddm(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_response = 0; + PyArrayObject *__pyx_v_feedback = 0; + PyArrayObject *__pyx_v_split_by = 0; + double __pyx_v_q; + double __pyx_v_alpha; + double __pyx_v_pos_alpha; + double __pyx_v_v; + double __pyx_v_sv; + double __pyx_v_a; + double __pyx_v_z; + double __pyx_v_sz; + double __pyx_v_t; + double __pyx_v_st; + double __pyx_v_err; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_rlddm (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_alpha,&__pyx_n_s_pos_alpha,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 21: values[20] = __Pyx_Arg_FASTCALL(__pyx_args, 20); + CYTHON_FALLTHROUGH; + case 20: values[19] = __Pyx_Arg_FASTCALL(__pyx_args, 19); + CYTHON_FALLTHROUGH; + case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18); + CYTHON_FALLTHROUGH; + case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); + CYTHON_FALLTHROUGH; + case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 1); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 2); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 3); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 4); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 5); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos_alpha)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 6); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 7); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 8); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 9); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 10); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 11); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 12); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 13); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 14); __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[15] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[16] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 17: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[17] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 18: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[18] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 19: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[19] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 20: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[20] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlddm") < 0)) __PYX_ERR(0, 128, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 21: values[20] = __Pyx_Arg_FASTCALL(__pyx_args, 20); + CYTHON_FALLTHROUGH; + case 20: values[19] = __Pyx_Arg_FASTCALL(__pyx_args, 19); + CYTHON_FALLTHROUGH; + case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18); + CYTHON_FALLTHROUGH; + case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); + CYTHON_FALLTHROUGH; + case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_response = ((PyArrayObject *)values[1]); + __pyx_v_feedback = ((PyArrayObject *)values[2]); + __pyx_v_split_by = ((PyArrayObject *)values[3]); + __pyx_v_q = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) + __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) + __pyx_v_pos_alpha = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_pos_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) + __pyx_v_v = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + if (values[15]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)10)); + } + if (values[16]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)10)); + } + if (values[17]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[18]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[18]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-8)); + } + if (values[19]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[19]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[20]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[20]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, __pyx_nargs); __PYX_ERR(0, 128, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 128, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 129, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 130, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_8wiener_like_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_alpha, __pyx_v_pos_alpha, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + CYTHON_UNUSED Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_s_size; + int __pyx_v_s; + double __pyx_v_p; + double __pyx_v_sum_logp; + double __pyx_v_wp_outlier; + double __pyx_v_alfa; + double __pyx_v_pos_alfa; + PyArrayObject *__pyx_v_qs = 0; + PyArrayObject *__pyx_v_xs = 0; + PyArrayObject *__pyx_v_feedbacks = 0; + PyArrayObject *__pyx_v_responses = 0; + PyArrayObject *__pyx_v_unique = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; + __Pyx_Buffer __pyx_pybuffer_feedback; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedbacks; + __Pyx_Buffer __pyx_pybuffer_feedbacks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; + __Pyx_Buffer __pyx_pybuffer_qs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_response; + __Pyx_Buffer __pyx_pybuffer_response; + __Pyx_LocalBuf_ND __pyx_pybuffernd_responses; + __Pyx_Buffer __pyx_pybuffer_responses; + __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; + __Pyx_Buffer __pyx_pybuffer_split_by; + __Pyx_LocalBuf_ND __pyx_pybuffernd_unique; + __Pyx_Buffer __pyx_pybuffer_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xs; + __Pyx_Buffer __pyx_pybuffer_xs; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + npy_intp __pyx_t_12; + npy_intp __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyArrayObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyArrayObject *__pyx_t_20 = NULL; + PyArrayObject *__pyx_t_21 = NULL; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + double __pyx_t_31; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_32; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__8) + __Pyx_RefNannySetupContext("wiener_like_rlddm", 0); + __Pyx_TraceCall("wiener_like_rlddm", __pyx_f[0], 128, 0, __PYX_ERR(0, 128, __pyx_L1_error)); + __pyx_pybuffer_qs.pybuffer.buf = NULL; + __pyx_pybuffer_qs.refcount = 0; + __pyx_pybuffernd_qs.data = NULL; + __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; + __pyx_pybuffer_xs.pybuffer.buf = NULL; + __pyx_pybuffer_xs.refcount = 0; + __pyx_pybuffernd_xs.data = NULL; + __pyx_pybuffernd_xs.rcbuffer = &__pyx_pybuffer_xs; + __pyx_pybuffer_feedbacks.pybuffer.buf = NULL; + __pyx_pybuffer_feedbacks.refcount = 0; + __pyx_pybuffernd_feedbacks.data = NULL; + __pyx_pybuffernd_feedbacks.rcbuffer = &__pyx_pybuffer_feedbacks; + __pyx_pybuffer_responses.pybuffer.buf = NULL; + __pyx_pybuffer_responses.refcount = 0; + __pyx_pybuffernd_responses.data = NULL; + __pyx_pybuffernd_responses.rcbuffer = &__pyx_pybuffer_responses; + __pyx_pybuffer_unique.pybuffer.buf = NULL; + __pyx_pybuffer_unique.refcount = 0; + __pyx_pybuffernd_unique.data = NULL; + __pyx_pybuffernd_unique.rcbuffer = &__pyx_pybuffer_unique; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_response.pybuffer.buf = NULL; + __pyx_pybuffer_response.refcount = 0; + __pyx_pybuffernd_response.data = NULL; + __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; + __pyx_pybuffer_feedback.pybuffer.buf = NULL; + __pyx_pybuffer_feedback.refcount = 0; + __pyx_pybuffernd_feedback.data = NULL; + __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; + __pyx_pybuffer_split_by.pybuffer.buf = NULL; + __pyx_pybuffer_split_by.refcount = 0; + __pyx_pybuffernd_split_by.data = NULL; + __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 128, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 128, __pyx_L1_error) + } + __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 128, __pyx_L1_error) + } + __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 128, __pyx_L1_error) + } + __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":136 + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j + * cdef Py_ssize_t s_size + */ + __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":141 + * cdef int s + * cdef double p + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef double wp_outlier = w_outlier * p_outlier + * cdef double alfa + */ + __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":142 + * cdef double p + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * cdef double alfa + * cdef double pos_alfa + */ + __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":145 + * cdef double alfa + * cdef double pos_alfa + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim=1] xs + * cdef np.ndarray[double, ndim=1] feedbacks + */ + __Pyx_TraceLine(145,0,__PYX_ERR(0, 145, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 145, __pyx_L1_error) + } else {__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_t_8 = 0; + __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":149 + * cdef np.ndarray[double, ndim=1] feedbacks + * cdef np.ndarray[long, ndim=1] responses + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< + * + * if not p_outlier_in_range(p_outlier): + */ + __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 149, __pyx_L1_error) + } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_9 = 0; + __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":151 + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(151,0,__PYX_ERR(0, 151, __pyx_L1_error)) + __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_10); + if (__pyx_t_11) { + + /* "wfpt.pyx":152 + * + * if not p_outlier_in_range(p_outlier): + * return -np.inf # <<<<<<<<<<<<<< + * + * if pos_alpha==100.00: + */ + __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":151 + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":154 + * return -np.inf + * + * if pos_alpha==100.00: # <<<<<<<<<<<<<< + * pos_alfa = alpha + * else: + */ + __Pyx_TraceLine(154,0,__PYX_ERR(0, 154, __pyx_L1_error)) + __pyx_t_11 = (__pyx_v_pos_alpha == 100.00); + if (__pyx_t_11) { + + /* "wfpt.pyx":155 + * + * if pos_alpha==100.00: + * pos_alfa = alpha # <<<<<<<<<<<<<< + * else: + * pos_alfa = pos_alpha + */ + __Pyx_TraceLine(155,0,__PYX_ERR(0, 155, __pyx_L1_error)) + __pyx_v_pos_alfa = __pyx_v_alpha; + + /* "wfpt.pyx":154 + * return -np.inf + * + * if pos_alpha==100.00: # <<<<<<<<<<<<<< + * pos_alfa = alpha + * else: + */ + goto __pyx_L4; + } + + /* "wfpt.pyx":157 + * pos_alfa = alpha + * else: + * pos_alfa = pos_alpha # <<<<<<<<<<<<<< + * + * # unique represent # of conditions + */ + __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error)) + /*else*/ { + __pyx_v_pos_alfa = __pyx_v_pos_alpha; + } + __pyx_L4:; + + /* "wfpt.pyx":160 + * + * # unique represent # of conditions + * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< + * s = unique[j] + * # select trials for current condition, identified by the split_by-array + */ + __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_1[0]); + __pyx_t_13 = __pyx_t_12; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "wfpt.pyx":161 + * # unique represent # of conditions + * for j in range(unique.shape[0]): + * s = unique[j] # <<<<<<<<<<<<<< + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] + */ + __Pyx_TraceLine(161,0,__PYX_ERR(0, 161, __pyx_L1_error)) + __pyx_t_15 = __pyx_v_j; + __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_unique.diminfo[0].strides)); + + /* "wfpt.pyx":163 + * s = unique[j] + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< + * responses = response[split_by == s] + * xs = x[split_by == s] + */ + __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedbacks, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; + } + __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) + } + __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "wfpt.pyx":164 + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] + * responses = response[split_by == s] # <<<<<<<<<<<<<< + * xs = x[split_by == s] + * s_size = xs.shape[0] + */ + __Pyx_TraceLine(164,0,__PYX_ERR(0, 164, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_20 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_19, __pyx_t_18, __pyx_t_17); + } + __pyx_t_19 = __pyx_t_18 = __pyx_t_17 = 0; + } + __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + } + __pyx_t_20 = 0; + __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "wfpt.pyx":165 + * feedbacks = feedback[split_by == s] + * responses = response[split_by == s] + * xs = x[split_by == s] # <<<<<<<<<<<<<< + * s_size = xs.shape[0] + * qs[0] = q + */ + __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_21 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; + } + __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) + } + __pyx_t_21 = 0; + __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "wfpt.pyx":166 + * responses = response[split_by == s] + * xs = x[split_by == s] + * s_size = xs.shape[0] # <<<<<<<<<<<<<< + * qs[0] = q + * qs[1] = q + */ + __Pyx_TraceLine(166,0,__PYX_ERR(0, 166, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_v_s_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":167 + * xs = x[split_by == s] + * s_size = xs.shape[0] + * qs[0] = q # <<<<<<<<<<<<<< + * qs[1] = q + * + */ + __Pyx_TraceLine(167,0,__PYX_ERR(0, 167, __pyx_L1_error)) + __pyx_t_15 = 0; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":168 + * s_size = xs.shape[0] + * qs[0] = q + * qs[1] = q # <<<<<<<<<<<<<< + * + * # don't calculate pdf for first trial but still update q + */ + __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error)) + __pyx_t_15 = 1; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":171 + * + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error)) + __pyx_t_15 = 0; + __pyx_t_22 = 0; + __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); + __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides))); + if (__pyx_t_11) { + + /* "wfpt.pyx":172 + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses[0]]: + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< + * else: + * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) + */ + __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error)) + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); + + /* "wfpt.pyx":171 + * + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + goto __pyx_L7; + } + + /* "wfpt.pyx":174 + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< + * + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + */ + __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error)) + /*else*/ { + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); + } + __pyx_L7:; + + /* "wfpt.pyx":178 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[0] - qs[responses[0]]) + * + */ + __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error)) + __pyx_t_22 = 0; + __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); + + /* "wfpt.pyx":179 + * # received on current trial. + * qs[responses[0]] = qs[responses[0]] + \ + * alfa * (feedbacks[0] - qs[responses[0]]) # <<<<<<<<<<<<<< + * + * # loop through all trials in current condition + */ + __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error)) + __pyx_t_15 = 0; + __pyx_t_24 = 0; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_responses.diminfo[0].strides)); + + /* "wfpt.pyx":178 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[0] - qs[responses[0]]) + * + */ + __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error)) + __pyx_t_26 = 0; + __pyx_t_27 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_responses.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides))))); + + /* "wfpt.pyx":182 + * + * # loop through all trials in current condition + * for i in range(1, s_size): # <<<<<<<<<<<<<< + * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, + * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) + */ + __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error)) + __pyx_t_28 = __pyx_v_s_size; + __pyx_t_29 = __pyx_t_28; + for (__pyx_t_30 = 1; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) { + __pyx_v_i = __pyx_t_30; + + /* "wfpt.pyx":183 + * # loop through all trials in current condition + * for i in range(1, s_size): + * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, # <<<<<<<<<<<<<< + * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) + * # If one probability = 0, the log sum will be -Inf + */ + __Pyx_TraceLine(183,0,__PYX_ERR(0, 183, __pyx_L1_error)) + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 1; + __pyx_t_15 = 0; + + /* "wfpt.pyx":184 + * for i in range(1, s_size): + * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, + * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier + */ + __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error)) + __pyx_t_32.__pyx_n = 4; + __pyx_t_32.n_st = __pyx_v_n_st; + __pyx_t_32.n_sz = __pyx_v_n_sz; + __pyx_t_32.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_32.simps_err = __pyx_v_simps_err; + __pyx_t_31 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_xs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_xs.diminfo[0].strides)), (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v), __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_32); if (unlikely(__pyx_t_31 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_v_p = __pyx_t_31; + + /* "wfpt.pyx":186 + * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< + * if p == 0: + * return -np.inf + */ + __Pyx_TraceLine(186,0,__PYX_ERR(0, 186, __pyx_L1_error)) + __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); + + /* "wfpt.pyx":187 + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: # <<<<<<<<<<<<<< + * return -np.inf + * sum_logp += log(p) + */ + __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error)) + __pyx_t_11 = (__pyx_v_p == 0.0); + if (__pyx_t_11) { + + /* "wfpt.pyx":188 + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: + * return -np.inf # <<<<<<<<<<<<<< + * sum_logp += log(p) + * + */ + __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":187 + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: # <<<<<<<<<<<<<< + * return -np.inf + * sum_logp += log(p) + */ + } + + /* "wfpt.pyx":189 + * if p == 0: + * return -np.inf + * sum_logp += log(p) # <<<<<<<<<<<<<< + * + * # get learning rate for current trial. if pos_alpha is not in + */ + __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error)) + __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); + + /* "wfpt.pyx":194 + * # include it will be same as alpha so can still use this + * # calculation: + * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error)) + __pyx_t_15 = __pyx_v_i; + __pyx_t_25 = __pyx_v_i; + __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); + __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))); + if (__pyx_t_11) { + + /* "wfpt.pyx":195 + * # calculation: + * if feedbacks[i] > qs[responses[i]]: + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< + * else: + * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) + */ + __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error)) + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); + + /* "wfpt.pyx":194 + * # include it will be same as alpha so can still use this + * # calculation: + * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + goto __pyx_L11; + } + + /* "wfpt.pyx":197 + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< + * + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + */ + __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error)) + /*else*/ { + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); + } + __pyx_L11:; + + /* "wfpt.pyx":201 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[i] - qs[responses[i]]) + * return sum_logp + */ + __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error)) + __pyx_t_25 = __pyx_v_i; + __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); + + /* "wfpt.pyx":202 + * # received on current trial. + * qs[responses[i]] = qs[responses[i]] + \ + * alfa * (feedbacks[i] - qs[responses[i]]) # <<<<<<<<<<<<<< + * return sum_logp + * + */ + __Pyx_TraceLine(202,0,__PYX_ERR(0, 202, __pyx_L1_error)) + __pyx_t_15 = __pyx_v_i; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); + + /* "wfpt.pyx":201 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[i] - qs[responses[i]]) + * return sum_logp + */ + __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error)) + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_responses.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides))))); + } + } + + /* "wfpt.pyx":203 + * qs[responses[i]] = qs[responses[i]] + \ + * alfa * (feedbacks[i] - qs[responses[i]]) + * return sum_logp # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":128 + * return logp + * + * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_qs); + __Pyx_XDECREF((PyObject *)__pyx_v_xs); + __Pyx_XDECREF((PyObject *)__pyx_v_feedbacks); + __Pyx_XDECREF((PyObject *)__pyx_v_responses); + __Pyx_XDECREF((PyObject *)__pyx_v_unique); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":206 + * + * + * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] x, + * np.ndarray[long, ndim=1] response, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_11wiener_like_rlssm_nn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_10wiener_like_rlssm_nn, "wiener_like_rlssm_nn(unicode model, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_ssm, ndarray params_rl, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); +static PyMethodDef __pyx_mdef_4wfpt_11wiener_like_rlssm_nn = {"wiener_like_rlssm_nn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_11wiener_like_rlssm_nn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_10wiener_like_rlssm_nn}; +static PyObject *__pyx_pw_4wfpt_11wiener_like_rlssm_nn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v_model = 0; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_response = 0; + PyArrayObject *__pyx_v_feedback = 0; + PyArrayObject *__pyx_v_split_by = 0; + double __pyx_v_q; + PyArrayObject *__pyx_v_params_ssm = 0; + PyArrayObject *__pyx_v_params_rl = 0; + PyArrayObject *__pyx_v_params_bnds = 0; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + PyObject *__pyx_v_network = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_rlssm_nn (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_model,&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_params_ssm,&__pyx_n_s_params_rl,&__pyx_n_s_params_bnds,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; + PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; + + /* "wfpt.pyx":215 + * np.ndarray[double, ndim=1] params_rl, + * np.ndarray[double, ndim=2] params_bnds, + * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< + * + * cdef double v = params_ssm[0] + */ + values[11] = ((PyObject *)((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_model)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 1); __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 2); __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 3); __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 4); __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 5); __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_ssm)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 6); __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_rl)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 7); __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_bnds)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 8); __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); + if (value) { values[11] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlssm_nn") < 0)) __PYX_ERR(0, 206, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_model = ((PyObject*)values[0]); + __pyx_v_x = ((PyArrayObject *)values[1]); + __pyx_v_response = ((PyArrayObject *)values[2]); + __pyx_v_feedback = ((PyArrayObject *)values[3]); + __pyx_v_split_by = ((PyArrayObject *)values[4]); + __pyx_v_q = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L3_error) + __pyx_v_params_ssm = ((PyArrayObject *)values[6]); + __pyx_v_params_rl = ((PyArrayObject *)values[7]); + __pyx_v_params_bnds = ((PyArrayObject *)values[8]); + if (values[9]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[10]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + __pyx_v_network = values[11]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, __pyx_nargs); __PYX_ERR(0, 206, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model), (&PyUnicode_Type), 1, "model", 1))) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 208, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 210, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_ssm), __pyx_ptype_5numpy_ndarray, 1, "params_ssm", 0))) __PYX_ERR(0, 212, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_rl), __pyx_ptype_5numpy_ndarray, 1, "params_rl", 0))) __PYX_ERR(0, 213, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_bnds), __pyx_ptype_5numpy_ndarray, 1, "params_bnds", 0))) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_10wiener_like_rlssm_nn(__pyx_self, __pyx_v_model, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_ssm, __pyx_v_params_rl, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); + + /* "wfpt.pyx":206 + * + * + * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] x, + * np.ndarray[long, ndim=1] response, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_model, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_ssm, PyArrayObject *__pyx_v_params_rl, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { + double __pyx_v_v; + double __pyx_v_rl_alpha; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_i_p; + Py_ssize_t __pyx_v_s_size; + int __pyx_v_s; + CYTHON_UNUSED double __pyx_v_log_p; + double __pyx_v_sum_logp; + CYTHON_UNUSED double __pyx_v_wp_outlier; + double __pyx_v_alfa; + double __pyx_v_pos_alfa; + PyArrayObject *__pyx_v_qs = 0; + PyArrayObject *__pyx_v_xs = 0; + PyArrayObject *__pyx_v_feedbacks = 0; + PyArrayObject *__pyx_v_responses = 0; + PyArrayObject *__pyx_v_responses_qs = 0; + PyArrayObject *__pyx_v_unique = 0; + Py_ssize_t __pyx_v_n_params; + PyArrayObject *__pyx_v_data = 0; + float __pyx_v_ll_min; + int __pyx_v_cumm_s_size; + PyObject *__pyx_v_lower_bnd = NULL; + PyObject *__pyx_v_upper_bnd = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_data; + __Pyx_Buffer __pyx_pybuffer_data; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; + __Pyx_Buffer __pyx_pybuffer_feedback; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedbacks; + __Pyx_Buffer __pyx_pybuffer_feedbacks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_params_bnds; + __Pyx_Buffer __pyx_pybuffer_params_bnds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_params_rl; + __Pyx_Buffer __pyx_pybuffer_params_rl; + __Pyx_LocalBuf_ND __pyx_pybuffernd_params_ssm; + __Pyx_Buffer __pyx_pybuffer_params_ssm; + __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; + __Pyx_Buffer __pyx_pybuffer_qs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_response; + __Pyx_Buffer __pyx_pybuffer_response; + __Pyx_LocalBuf_ND __pyx_pybuffernd_responses; + __Pyx_Buffer __pyx_pybuffer_responses; + __Pyx_LocalBuf_ND __pyx_pybuffernd_responses_qs; + __Pyx_Buffer __pyx_pybuffer_responses_qs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; + __Pyx_Buffer __pyx_pybuffer_split_by; + __Pyx_LocalBuf_ND __pyx_pybuffernd_unique; + __Pyx_Buffer __pyx_pybuffer_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xs; + __Pyx_Buffer __pyx_pybuffer_xs; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + npy_intp *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyArrayObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + npy_intp __pyx_t_17; + npy_intp __pyx_t_18; + PyArrayObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyArrayObject *__pyx_t_23 = NULL; + PyArrayObject *__pyx_t_24 = NULL; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + PyObject *__pyx_t_33 = NULL; + PyObject *__pyx_t_34 = NULL; + double __pyx_t_35; + PyObject *__pyx_t_36 = NULL; + PyObject *__pyx_t_37 = NULL; + PyObject *__pyx_t_38 = NULL; + PyObject *__pyx_t_39 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__9) + __Pyx_RefNannySetupContext("wiener_like_rlssm_nn", 0); + __Pyx_TraceCall("wiener_like_rlssm_nn", __pyx_f[0], 206, 0, __PYX_ERR(0, 206, __pyx_L1_error)); + __pyx_pybuffer_qs.pybuffer.buf = NULL; + __pyx_pybuffer_qs.refcount = 0; + __pyx_pybuffernd_qs.data = NULL; + __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; + __pyx_pybuffer_xs.pybuffer.buf = NULL; + __pyx_pybuffer_xs.refcount = 0; + __pyx_pybuffernd_xs.data = NULL; + __pyx_pybuffernd_xs.rcbuffer = &__pyx_pybuffer_xs; + __pyx_pybuffer_feedbacks.pybuffer.buf = NULL; + __pyx_pybuffer_feedbacks.refcount = 0; + __pyx_pybuffernd_feedbacks.data = NULL; + __pyx_pybuffernd_feedbacks.rcbuffer = &__pyx_pybuffer_feedbacks; + __pyx_pybuffer_responses.pybuffer.buf = NULL; + __pyx_pybuffer_responses.refcount = 0; + __pyx_pybuffernd_responses.data = NULL; + __pyx_pybuffernd_responses.rcbuffer = &__pyx_pybuffer_responses; + __pyx_pybuffer_responses_qs.pybuffer.buf = NULL; + __pyx_pybuffer_responses_qs.refcount = 0; + __pyx_pybuffernd_responses_qs.data = NULL; + __pyx_pybuffernd_responses_qs.rcbuffer = &__pyx_pybuffer_responses_qs; + __pyx_pybuffer_unique.pybuffer.buf = NULL; + __pyx_pybuffer_unique.refcount = 0; + __pyx_pybuffernd_unique.data = NULL; + __pyx_pybuffernd_unique.rcbuffer = &__pyx_pybuffer_unique; + __pyx_pybuffer_data.pybuffer.buf = NULL; + __pyx_pybuffer_data.refcount = 0; + __pyx_pybuffernd_data.data = NULL; + __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_response.pybuffer.buf = NULL; + __pyx_pybuffer_response.refcount = 0; + __pyx_pybuffernd_response.data = NULL; + __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; + __pyx_pybuffer_feedback.pybuffer.buf = NULL; + __pyx_pybuffer_feedback.refcount = 0; + __pyx_pybuffernd_feedback.data = NULL; + __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; + __pyx_pybuffer_split_by.pybuffer.buf = NULL; + __pyx_pybuffer_split_by.refcount = 0; + __pyx_pybuffernd_split_by.data = NULL; + __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; + __pyx_pybuffer_params_ssm.pybuffer.buf = NULL; + __pyx_pybuffer_params_ssm.refcount = 0; + __pyx_pybuffernd_params_ssm.data = NULL; + __pyx_pybuffernd_params_ssm.rcbuffer = &__pyx_pybuffer_params_ssm; + __pyx_pybuffer_params_rl.pybuffer.buf = NULL; + __pyx_pybuffer_params_rl.refcount = 0; + __pyx_pybuffernd_params_rl.data = NULL; + __pyx_pybuffernd_params_rl.rcbuffer = &__pyx_pybuffer_params_rl; + __pyx_pybuffer_params_bnds.pybuffer.buf = NULL; + __pyx_pybuffer_params_bnds.refcount = 0; + __pyx_pybuffernd_params_bnds.data = NULL; + __pyx_pybuffernd_params_bnds.rcbuffer = &__pyx_pybuffer_params_bnds; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + } + __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + } + __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + } + __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_ssm.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_ssm, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + } + __pyx_pybuffernd_params_ssm.diminfo[0].strides = __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_ssm.diminfo[0].shape = __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_rl.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_rl, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + } + __pyx_pybuffernd_params_rl.diminfo[0].strides = __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_rl.diminfo[0].shape = __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_bnds, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + } + __pyx_pybuffernd_params_bnds.diminfo[0].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_bnds.diminfo[0].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_params_bnds.diminfo[1].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_params_bnds.diminfo[1].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[1]; + + /* "wfpt.pyx":217 + * double p_outlier=0, double w_outlier=0, network = None): + * + * cdef double v = params_ssm[0] # <<<<<<<<<<<<<< + * cdef double rl_alpha = params_rl[0] + * + */ + __Pyx_TraceLine(217,0,__PYX_ERR(0, 217, __pyx_L1_error)) + __pyx_t_1 = 0; + __pyx_v_v = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides)); + + /* "wfpt.pyx":218 + * + * cdef double v = params_ssm[0] + * cdef double rl_alpha = params_rl[0] # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(218,0,__PYX_ERR(0, 218, __pyx_L1_error)) + __pyx_t_1 = 0; + __pyx_v_rl_alpha = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); + + /* "wfpt.pyx":220 + * cdef double rl_alpha = params_rl[0] + * + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, i_p + * cdef Py_ssize_t s_size + */ + __Pyx_TraceLine(220,0,__PYX_ERR(0, 220, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_v_size = (__pyx_t_2[0]); + + /* "wfpt.pyx":224 + * cdef Py_ssize_t s_size + * cdef int s + * cdef double log_p = 0 # <<<<<<<<<<<<<< + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier + */ + __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error)) + __pyx_v_log_p = 0.0; + + /* "wfpt.pyx":225 + * cdef int s + * cdef double log_p = 0 + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef double wp_outlier = w_outlier * p_outlier + * cdef double alfa + */ + __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":226 + * cdef double log_p = 0 + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * cdef double alfa + * cdef double pos_alfa + */ + __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":229 + * cdef double alfa + * cdef double pos_alfa + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim=1] xs + * cdef np.ndarray[double, ndim=1] feedbacks + */ + __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_9 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 229, __pyx_L1_error) + } else {__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_t_9 = 0; + __pyx_v_qs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "wfpt.pyx":234 + * cdef np.ndarray[long, ndim=1] responses + * cdef np.ndarray[long, ndim=1] responses_qs + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< + * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] + * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) + */ + __Pyx_TraceLine(234,0,__PYX_ERR(0, 234, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_unique); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_split_by)}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_10 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 234, __pyx_L1_error) + } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_10 = 0; + __pyx_v_unique = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "wfpt.pyx":235 + * cdef np.ndarray[long, ndim=1] responses_qs + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] # <<<<<<<<<<<<<< + * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) + * cdef float ll_min = -16.11809 + */ + __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_params_ssm)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_v_n_params = (__pyx_t_2[0]); + + /* "wfpt.pyx":236 + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] + * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) # <<<<<<<<<<<<<< + * cdef float ll_min = -16.11809 + * cdef int cumm_s_size = 0 + */ + __Pyx_TraceLine(236,0,__PYX_ERR(0, 236, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_n_params + 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 236, __pyx_L1_error) + } else {__pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_11 = 0; + __pyx_v_data = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "wfpt.pyx":237 + * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] + * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) + * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< + * cdef int cumm_s_size = 0 + * + */ + __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error)) + __pyx_v_ll_min = -16.11809; + + /* "wfpt.pyx":238 + * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) + * cdef float ll_min = -16.11809 + * cdef int cumm_s_size = 0 # <<<<<<<<<<<<<< + * + * if not p_outlier_in_range(p_outlier): + */ + __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error)) + __pyx_v_cumm_s_size = 0; + + /* "wfpt.pyx":240 + * cdef int cumm_s_size = 0 + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(240,0,__PYX_ERR(0, 240, __pyx_L1_error)) + __pyx_t_12 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_12); + if (__pyx_t_13) { + + /* "wfpt.pyx":241 + * + * if not p_outlier_in_range(p_outlier): + * return -np.inf # <<<<<<<<<<<<<< + * + * # Check for boundary violations -- if true, return -np.inf + */ + __Pyx_TraceLine(241,0,__PYX_ERR(0, 241, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":240 + * cdef int cumm_s_size = 0 + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":244 + * + * # Check for boundary violations -- if true, return -np.inf + * for i_p in np.arange(1, len(params_ssm)): # <<<<<<<<<<<<<< + * lower_bnd = params_bnds[0][i_p] + * upper_bnd = params_bnds[1][i_p] + */ + __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_params_ssm)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_int_1, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_14 = 0; + __pyx_t_15 = NULL; + } else { + __pyx_t_14 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 244, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 244, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 244, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_15(__pyx_t_5); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 244, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_i_p = __pyx_t_16; + + /* "wfpt.pyx":245 + * # Check for boundary violations -- if true, return -np.inf + * for i_p in np.arange(1, len(params_ssm)): + * lower_bnd = params_bnds[0][i_p] # <<<<<<<<<<<<<< + * upper_bnd = params_bnds[1][i_p] + * + */ + __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error)) + __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_lower_bnd, __pyx_t_6); + __pyx_t_6 = 0; + + /* "wfpt.pyx":246 + * for i_p in np.arange(1, len(params_ssm)): + * lower_bnd = params_bnds[0][i_p] + * upper_bnd = params_bnds[1][i_p] # <<<<<<<<<<<<<< + * + * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: + */ + __Pyx_TraceLine(246,0,__PYX_ERR(0, 246, __pyx_L1_error)) + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_upper_bnd, __pyx_t_4); + __pyx_t_4 = 0; + + /* "wfpt.pyx":248 + * upper_bnd = params_bnds[1][i_p] + * + * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error)) + __pyx_t_1 = __pyx_v_i_p; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_lower_bnd, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_12) { + } else { + __pyx_t_13 = __pyx_t_12; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_1 = __pyx_v_i_p; + __pyx_t_6 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_upper_bnd, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = __pyx_t_12; + __pyx_L7_bool_binop_done:; + if (__pyx_t_13) { + + /* "wfpt.pyx":249 + * + * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: + * return -np.inf # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(249,0,__PYX_ERR(0, 249, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":248 + * upper_bnd = params_bnds[1][i_p] + * + * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":244 + * + * # Check for boundary violations -- if true, return -np.inf + * for i_p in np.arange(1, len(params_ssm)): # <<<<<<<<<<<<<< + * lower_bnd = params_bnds[0][i_p] + * upper_bnd = params_bnds[1][i_p] + */ + __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error)) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":252 + * + * + * if len(params_rl) == 2: # <<<<<<<<<<<<<< + * pos_alfa = params_rl[1] + * else: + */ + __Pyx_TraceLine(252,0,__PYX_ERR(0, 252, __pyx_L1_error)) + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_params_rl)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_13 = (__pyx_t_14 == 2); + if (__pyx_t_13) { + + /* "wfpt.pyx":253 + * + * if len(params_rl) == 2: + * pos_alfa = params_rl[1] # <<<<<<<<<<<<<< + * else: + * pos_alfa = params_rl[0] + */ + __Pyx_TraceLine(253,0,__PYX_ERR(0, 253, __pyx_L1_error)) + __pyx_t_1 = 1; + __pyx_v_pos_alfa = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); + + /* "wfpt.pyx":252 + * + * + * if len(params_rl) == 2: # <<<<<<<<<<<<<< + * pos_alfa = params_rl[1] + * else: + */ + goto __pyx_L10; + } + + /* "wfpt.pyx":255 + * pos_alfa = params_rl[1] + * else: + * pos_alfa = params_rl[0] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(255,0,__PYX_ERR(0, 255, __pyx_L1_error)) + /*else*/ { + __pyx_t_1 = 0; + __pyx_v_pos_alfa = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); + } + __pyx_L10:; + + /* "wfpt.pyx":259 + * + * # unique represent # of conditions + * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< + * s = unique[j] + * # select trials for current condition, identified by the split_by-array + */ + __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_17 = (__pyx_t_2[0]); + __pyx_t_18 = __pyx_t_17; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_18; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "wfpt.pyx":260 + * # unique represent # of conditions + * for j in range(unique.shape[0]): + * s = unique[j] # <<<<<<<<<<<<<< + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] + */ + __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error)) + __pyx_t_1 = __pyx_v_j; + __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_unique.diminfo[0].strides)); + + /* "wfpt.pyx":262 + * s = unique[j] + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< + * responses = response[split_by == s] + * xs = x[split_by == s] + */ + __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedbacks, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0; + } + __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 262, __pyx_L1_error) + } + __pyx_t_19 = 0; + __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "wfpt.pyx":263 + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] + * responses = response[split_by == s] # <<<<<<<<<<<<<< + * xs = x[split_by == s] + * s_size = xs.shape[0] + */ + __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_23 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20); + } + __pyx_t_22 = __pyx_t_21 = __pyx_t_20 = 0; + } + __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 263, __pyx_L1_error) + } + __pyx_t_23 = 0; + __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "wfpt.pyx":264 + * feedbacks = feedback[split_by == s] + * responses = response[split_by == s] + * xs = x[split_by == s] # <<<<<<<<<<<<<< + * s_size = xs.shape[0] + * qs[0] = q + */ + __Pyx_TraceLine(264,0,__PYX_ERR(0, 264, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_24 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0; + } + __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 264, __pyx_L1_error) + } + __pyx_t_24 = 0; + __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "wfpt.pyx":265 + * responses = response[split_by == s] + * xs = x[split_by == s] + * s_size = xs.shape[0] # <<<<<<<<<<<<<< + * qs[0] = q + * qs[1] = q + */ + __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_v_s_size = (__pyx_t_2[0]); + + /* "wfpt.pyx":266 + * xs = x[split_by == s] + * s_size = xs.shape[0] + * qs[0] = q # <<<<<<<<<<<<<< + * qs[1] = q + * + */ + __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error)) + __pyx_t_1 = 0; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":267 + * s_size = xs.shape[0] + * qs[0] = q + * qs[1] = q # <<<<<<<<<<<<<< + * + * responses_qs = responses + */ + __Pyx_TraceLine(267,0,__PYX_ERR(0, 267, __pyx_L1_error)) + __pyx_t_1 = 1; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":269 + * qs[1] = q + * + * responses_qs = responses # <<<<<<<<<<<<<< + * responses_qs[responses_qs == -1] = 0 + * + */ + __Pyx_TraceLine(269,0,__PYX_ERR(0, 269, __pyx_L1_error)) + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_responses), &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses_qs, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20); + } + __pyx_t_22 = __pyx_t_21 = __pyx_t_20 = 0; + } + __pyx_pybuffernd_responses_qs.diminfo[0].strides = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses_qs.diminfo[0].shape = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 269, __pyx_L1_error) + } + __Pyx_INCREF((PyObject *)__pyx_v_responses); + __Pyx_XDECREF_SET(__pyx_v_responses_qs, ((PyArrayObject *)__pyx_v_responses)); + + /* "wfpt.pyx":270 + * + * responses_qs = responses + * responses_qs[responses_qs == -1] = 0 # <<<<<<<<<<<<<< + * + * # don't calculate pdf for first trial but still update q + */ + __Pyx_TraceLine(270,0,__PYX_ERR(0, 270, __pyx_L1_error)) + __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_responses_qs), __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_responses_qs), __pyx_t_5, __pyx_int_0) < 0))) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":273 + * + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses_qs[0]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + __Pyx_TraceLine(273,0,__PYX_ERR(0, 273, __pyx_L1_error)) + __pyx_t_1 = 0; + __pyx_t_25 = 0; + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides))); + if (__pyx_t_13) { + + /* "wfpt.pyx":274 + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses_qs[0]]: + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< + * else: + * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) + */ + __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error)) + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); + + /* "wfpt.pyx":273 + * + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses_qs[0]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + goto __pyx_L13; + } + + /* "wfpt.pyx":276 + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(276,0,__PYX_ERR(0, 276, __pyx_L1_error)) + /*else*/ { + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); + } + __pyx_L13:; + + /* "wfpt.pyx":281 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses_qs[0]] = qs[responses_qs[0]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[0] - qs[responses_qs[0]]) + * + */ + __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error)) + __pyx_t_25 = 0; + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + + /* "wfpt.pyx":282 + * # received on current trial. + * qs[responses_qs[0]] = qs[responses_qs[0]] + \ + * alfa * (feedbacks[0] - qs[responses_qs[0]]) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error)) + __pyx_t_1 = 0; + __pyx_t_27 = 0; + __pyx_t_28 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + + /* "wfpt.pyx":281 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses_qs[0]] = qs[responses_qs[0]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[0] - qs[responses_qs[0]]) + * + */ + __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error)) + __pyx_t_29 = 0; + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_qs.diminfo[0].strides))))); + + /* "wfpt.pyx":285 + * + * + * data[0, 0] = 0.0 # <<<<<<<<<<<<<< + * # loop through all trials in current condition + * for i in range(1, s_size): + */ + __Pyx_TraceLine(285,0,__PYX_ERR(0, 285, __pyx_L1_error)) + __pyx_t_27 = 0; + __pyx_t_28 = 0; + *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_data.diminfo[1].strides) = 0.0; + + /* "wfpt.pyx":287 + * data[0, 0] = 0.0 + * # loop through all trials in current condition + * for i in range(1, s_size): # <<<<<<<<<<<<<< + * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v + * # Check for boundary violations -- if true, return -np.inf + */ + __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error)) + __pyx_t_16 = __pyx_v_s_size; + __pyx_t_31 = __pyx_t_16; + for (__pyx_t_32 = 1; __pyx_t_32 < __pyx_t_31; __pyx_t_32+=1) { + __pyx_v_i = __pyx_t_32; + + /* "wfpt.pyx":288 + * # loop through all trials in current condition + * for i in range(1, s_size): + * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v # <<<<<<<<<<<<<< + * # Check for boundary violations -- if true, return -np.inf + * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: + */ + __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error)) + __pyx_t_28 = 1; + __pyx_t_27 = 0; + __pyx_t_1 = (__pyx_v_cumm_s_size + __pyx_v_i); + __pyx_t_25 = 0; + *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_data.diminfo[1].strides) = (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v); + + /* "wfpt.pyx":290 + * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v + * # Check for boundary violations -- if true, return -np.inf + * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(290,0,__PYX_ERR(0, 290, __pyx_L1_error)) + __pyx_t_27 = (__pyx_v_cumm_s_size + __pyx_v_i); + __pyx_t_28 = 0; + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_12) { + } else { + __pyx_t_13 = __pyx_t_12; + goto __pyx_L17_bool_binop_done; + } + __pyx_t_28 = (__pyx_v_cumm_s_size + __pyx_v_i); + __pyx_t_27 = 0; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __pyx_t_12; + __pyx_L17_bool_binop_done:; + if (__pyx_t_13) { + + /* "wfpt.pyx":291 + * # Check for boundary violations -- if true, return -np.inf + * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: + * return -np.inf # <<<<<<<<<<<<<< + * + * # get learning rate for current trial. if pos_alpha is not in + */ + __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":290 + * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v + * # Check for boundary violations -- if true, return -np.inf + * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":296 + * # include it will be same as alpha so can still use this + * # calculation: + * if feedbacks[i] > qs[responses_qs[i]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error)) + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_i; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides))); + if (__pyx_t_13) { + + /* "wfpt.pyx":297 + * # calculation: + * if feedbacks[i] > qs[responses_qs[i]]: + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< + * else: + * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) + */ + __Pyx_TraceLine(297,0,__PYX_ERR(0, 297, __pyx_L1_error)) + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); + + /* "wfpt.pyx":296 + * # include it will be same as alpha so can still use this + * # calculation: + * if feedbacks[i] > qs[responses_qs[i]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + goto __pyx_L19; + } + + /* "wfpt.pyx":299 + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< + * + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + */ + __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error)) + /*else*/ { + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); + } + __pyx_L19:; + + /* "wfpt.pyx":303 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[i] - qs[responses_qs[i]]) + * cumm_s_size += s_size + */ + __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) + __pyx_t_28 = __pyx_v_i; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + + /* "wfpt.pyx":304 + * # received on current trial. + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ + * alfa * (feedbacks[i] - qs[responses_qs[i]]) # <<<<<<<<<<<<<< + * cumm_s_size += s_size + * + */ + __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error)) + __pyx_t_27 = __pyx_v_i; + __pyx_t_1 = __pyx_v_i; + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + + /* "wfpt.pyx":303 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[i] - qs[responses_qs[i]]) + * cumm_s_size += s_size + */ + __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides))))); + } + + /* "wfpt.pyx":305 + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ + * alfa * (feedbacks[i] - qs[responses_qs[i]]) + * cumm_s_size += s_size # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(305,0,__PYX_ERR(0, 305, __pyx_L1_error)) + __pyx_v_cumm_s_size = (__pyx_v_cumm_s_size + __pyx_v_s_size); + } + + /* "wfpt.pyx":308 + * + * + * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) # <<<<<<<<<<<<<< + * data[:, n_params:] = np.stack([x, response], axis = 1) + * + */ + __Pyx_TraceLine(308,0,__PYX_ERR(0, 308, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_params_ssm), __pyx_slice__10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_33 = PyTuple_New(2); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_int_1); + __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_33}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_33}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_33 = PySlice_New(__pyx_int_1, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_slice__7); + __Pyx_GIVEREF(__pyx_slice__7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__7); + __Pyx_GIVEREF(__pyx_t_33); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_33); + __pyx_t_33 = 0; + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_t_7, __pyx_t_6) < 0))) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "wfpt.pyx":309 + * + * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) + * data[:, n_params:] = np.stack([x, response], axis = 1) # <<<<<<<<<<<<<< + * + * # Call to network: + */ + __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_stack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF((PyObject *)__pyx_v_x); + __Pyx_GIVEREF((PyObject *)__pyx_v_x); + PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_x)); + __Pyx_INCREF((PyObject *)__pyx_v_response); + __Pyx_GIVEREF((PyObject *)__pyx_v_response); + PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_response)); + __pyx_t_33 = PyTuple_New(1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_33, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_33 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_slice__7); + __Pyx_GIVEREF(__pyx_slice__7); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__7); + __Pyx_GIVEREF(__pyx_t_33); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_33); + __pyx_t_33 = 0; + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_t_6, __pyx_t_5) < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":312 + * + * # Call to network: + * if p_outlier == 0: # <<<<<<<<<<<<<< + * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + */ + __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error)) + __pyx_t_13 = (__pyx_v_p_outlier == 0.0); + if (__pyx_t_13) { + + /* "wfpt.pyx":313 + * # Call to network: + * if p_outlier == 0: + * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< + * else: + * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + */ + __Pyx_TraceLine(313,0,__PYX_ERR(0, 313, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_umath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_maximum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_34 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_34)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_34); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_34, ((PyObject *)__pyx_v_data)}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_34 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_34)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_34); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_34, __pyx_t_7, __pyx_t_3}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_33); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_33, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + } + __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_sum_logp = __pyx_t_35; + + /* "wfpt.pyx":312 + * + * # Call to network: + * if p_outlier == 0: # <<<<<<<<<<<<<< + * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + */ + goto __pyx_L20; + } + + /* "wfpt.pyx":315 + * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< + * + * return sum_logp + */ + __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error)) + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_34); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_36); + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_core); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_37); + __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_umath); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_36); + __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_maximum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_37); + __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_39 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_38))) { + __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_38); + if (likely(__pyx_t_39)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); + __Pyx_INCREF(__pyx_t_39); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_38, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_39, ((PyObject *)__pyx_v_data)}; + __pyx_t_36 = __Pyx_PyObject_FastCall(__pyx_t_38, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_36); + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + } + __pyx_t_38 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_39 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_37))) { + __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_37); + if (likely(__pyx_t_39)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); + __Pyx_INCREF(__pyx_t_39); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_37, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_39, __pyx_t_36, __pyx_t_38}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_37, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + } + __pyx_t_37 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) { + __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_34); + if (likely(__pyx_t_37)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34); + __Pyx_INCREF(__pyx_t_37); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_34, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_37, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_34, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; + } + __pyx_t_34 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_34); + __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_34); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; + __pyx_t_34 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_34); + __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_34); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; + __pyx_t_34 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_34)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_34); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_4}; + __pyx_t_33 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_3 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_33}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_sum_logp = __pyx_t_35; + } + __pyx_L20:; + + /* "wfpt.pyx":317 + * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + * + * return sum_logp # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(317,0,__PYX_ERR(0, 317, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":206 + * + * + * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] x, + * np.ndarray[long, ndim=1] response, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_33); + __Pyx_XDECREF(__pyx_t_34); + __Pyx_XDECREF(__pyx_t_36); + __Pyx_XDECREF(__pyx_t_37); + __Pyx_XDECREF(__pyx_t_38); + __Pyx_XDECREF(__pyx_t_39); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_rl.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_ssm.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_rl.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_ssm.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_qs); + __Pyx_XDECREF((PyObject *)__pyx_v_xs); + __Pyx_XDECREF((PyObject *)__pyx_v_feedbacks); + __Pyx_XDECREF((PyObject *)__pyx_v_responses); + __Pyx_XDECREF((PyObject *)__pyx_v_responses_qs); + __Pyx_XDECREF((PyObject *)__pyx_v_unique); + __Pyx_XDECREF((PyObject *)__pyx_v_data); + __Pyx_XDECREF(__pyx_v_lower_bnd); + __Pyx_XDECREF(__pyx_v_upper_bnd); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":320 + * + * + * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] feedback, + * np.ndarray[long, ndim=1] split_by, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_13wiener_like_rl(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_12wiener_like_rl, "wiener_like_rl(ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double z, double err=1e-4, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_13wiener_like_rl = {"wiener_like_rl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_13wiener_like_rl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_12wiener_like_rl}; +static PyObject *__pyx_pw_4wfpt_13wiener_like_rl(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_response = 0; + PyArrayObject *__pyx_v_feedback = 0; + PyArrayObject *__pyx_v_split_by = 0; + double __pyx_v_q; + double __pyx_v_alpha; + double __pyx_v_pos_alpha; + double __pyx_v_v; + double __pyx_v_z; + CYTHON_UNUSED double __pyx_v_err; + CYTHON_UNUSED int __pyx_v_n_st; + CYTHON_UNUSED int __pyx_v_n_sz; + CYTHON_UNUSED int __pyx_v_use_adaptive; + CYTHON_UNUSED double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_rl (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_alpha,&__pyx_n_s_pos_alpha,&__pyx_n_s_v,&__pyx_n_s_z,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 1); __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 2); __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 3); __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 4); __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos_alpha)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 5); __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 6); __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 7); __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err); + if (value) { values[8] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[11] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[12] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[13] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[14] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rl") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_response = ((PyArrayObject *)values[0]); + __pyx_v_feedback = ((PyArrayObject *)values[1]); + __pyx_v_split_by = ((PyArrayObject *)values[2]); + __pyx_v_q = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) + __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) + __pyx_v_pos_alpha = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_pos_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) + __pyx_v_v = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) + if (values[8]) { + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + } else { + __pyx_v_err = ((double)((double)1e-4)); + } + if (values[9]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)10)); + } + if (values[10]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)10)); + } + if (values[11]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[12]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-8)); + } + if (values[13]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[14]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, __pyx_nargs); __PYX_ERR(0, 320, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_rl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 320, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_12wiener_like_rl(__pyx_self, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_alpha, __pyx_v_pos_alpha, __pyx_v_v, __pyx_v_z, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_err, CYTHON_UNUSED int __pyx_v_n_st, CYTHON_UNUSED int __pyx_v_n_sz, CYTHON_UNUSED int __pyx_v_use_adaptive, CYTHON_UNUSED double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + CYTHON_UNUSED Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_s_size; + int __pyx_v_s; + double __pyx_v_drift; + double __pyx_v_p; + double __pyx_v_sum_logp; + double __pyx_v_wp_outlier; + double __pyx_v_alfa; + double __pyx_v_pos_alfa; + PyArrayObject *__pyx_v_qs = 0; + PyArrayObject *__pyx_v_feedbacks = 0; + PyArrayObject *__pyx_v_responses = 0; + PyArrayObject *__pyx_v_unique = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; + __Pyx_Buffer __pyx_pybuffer_feedback; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedbacks; + __Pyx_Buffer __pyx_pybuffer_feedbacks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; + __Pyx_Buffer __pyx_pybuffer_qs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_response; + __Pyx_Buffer __pyx_pybuffer_response; + __Pyx_LocalBuf_ND __pyx_pybuffernd_responses; + __Pyx_Buffer __pyx_pybuffer_responses; + __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; + __Pyx_Buffer __pyx_pybuffer_split_by; + __Pyx_LocalBuf_ND __pyx_pybuffernd_unique; + __Pyx_Buffer __pyx_pybuffer_unique; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + npy_intp __pyx_t_12; + npy_intp __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyArrayObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyArrayObject *__pyx_t_20 = NULL; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__11) + __Pyx_RefNannySetupContext("wiener_like_rl", 0); + __Pyx_TraceCall("wiener_like_rl", __pyx_f[0], 320, 0, __PYX_ERR(0, 320, __pyx_L1_error)); + __pyx_pybuffer_qs.pybuffer.buf = NULL; + __pyx_pybuffer_qs.refcount = 0; + __pyx_pybuffernd_qs.data = NULL; + __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; + __pyx_pybuffer_feedbacks.pybuffer.buf = NULL; + __pyx_pybuffer_feedbacks.refcount = 0; + __pyx_pybuffernd_feedbacks.data = NULL; + __pyx_pybuffernd_feedbacks.rcbuffer = &__pyx_pybuffer_feedbacks; + __pyx_pybuffer_responses.pybuffer.buf = NULL; + __pyx_pybuffer_responses.refcount = 0; + __pyx_pybuffernd_responses.data = NULL; + __pyx_pybuffernd_responses.rcbuffer = &__pyx_pybuffer_responses; + __pyx_pybuffer_unique.pybuffer.buf = NULL; + __pyx_pybuffer_unique.refcount = 0; + __pyx_pybuffernd_unique.data = NULL; + __pyx_pybuffernd_unique.rcbuffer = &__pyx_pybuffer_unique; + __pyx_pybuffer_response.pybuffer.buf = NULL; + __pyx_pybuffer_response.refcount = 0; + __pyx_pybuffernd_response.data = NULL; + __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; + __pyx_pybuffer_feedback.pybuffer.buf = NULL; + __pyx_pybuffer_feedback.refcount = 0; + __pyx_pybuffernd_feedback.data = NULL; + __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; + __pyx_pybuffer_split_by.pybuffer.buf = NULL; + __pyx_pybuffer_split_by.refcount = 0; + __pyx_pybuffernd_split_by.data = NULL; + __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 320, __pyx_L1_error) + } + __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 320, __pyx_L1_error) + } + __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 320, __pyx_L1_error) + } + __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":326 + * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = response.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j + * cdef Py_ssize_t s_size + */ + __Pyx_TraceLine(326,0,__PYX_ERR(0, 326, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_response)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":332 + * cdef double drift + * cdef double p + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef double wp_outlier = w_outlier * p_outlier + * cdef double alfa + */ + __Pyx_TraceLine(332,0,__PYX_ERR(0, 332, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":333 + * cdef double p + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * cdef double alfa + * cdef double pos_alfa + */ + __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":336 + * cdef double alfa + * cdef double pos_alfa + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim=1] feedbacks + * cdef np.ndarray[long, ndim=1] responses + */ + __Pyx_TraceLine(336,0,__PYX_ERR(0, 336, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 336, __pyx_L1_error) + } else {__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_t_8 = 0; + __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":339 + * cdef np.ndarray[double, ndim=1] feedbacks + * cdef np.ndarray[long, ndim=1] responses + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< + * + * if not p_outlier_in_range(p_outlier): + */ + __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 339, __pyx_L1_error) + } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_9 = 0; + __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":341 + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(341,0,__PYX_ERR(0, 341, __pyx_L1_error)) + __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_10); + if (__pyx_t_11) { + + /* "wfpt.pyx":342 + * + * if not p_outlier_in_range(p_outlier): + * return -np.inf # <<<<<<<<<<<<<< + * + * if pos_alpha==100.00: + */ + __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":341 + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":344 + * return -np.inf + * + * if pos_alpha==100.00: # <<<<<<<<<<<<<< + * pos_alfa = alpha + * else: + */ + __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error)) + __pyx_t_11 = (__pyx_v_pos_alpha == 100.00); + if (__pyx_t_11) { + + /* "wfpt.pyx":345 + * + * if pos_alpha==100.00: + * pos_alfa = alpha # <<<<<<<<<<<<<< + * else: + * pos_alfa = pos_alpha + */ + __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error)) + __pyx_v_pos_alfa = __pyx_v_alpha; + + /* "wfpt.pyx":344 + * return -np.inf + * + * if pos_alpha==100.00: # <<<<<<<<<<<<<< + * pos_alfa = alpha + * else: + */ + goto __pyx_L4; + } + + /* "wfpt.pyx":347 + * pos_alfa = alpha + * else: + * pos_alfa = pos_alpha # <<<<<<<<<<<<<< + * + * # unique represent # of conditions + */ + __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error)) + /*else*/ { + __pyx_v_pos_alfa = __pyx_v_pos_alpha; + } + __pyx_L4:; + + /* "wfpt.pyx":350 + * + * # unique represent # of conditions + * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< + * s = unique[j] + * # select trials for current condition, identified by the split_by-array + */ + __Pyx_TraceLine(350,0,__PYX_ERR(0, 350, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_1[0]); + __pyx_t_13 = __pyx_t_12; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "wfpt.pyx":351 + * # unique represent # of conditions + * for j in range(unique.shape[0]): + * s = unique[j] # <<<<<<<<<<<<<< + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] + */ + __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error)) + __pyx_t_15 = __pyx_v_j; + __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_unique.diminfo[0].strides)); + + /* "wfpt.pyx":353 + * s = unique[j] + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< + * responses = response[split_by == s] + * s_size = responses.shape[0] + */ + __Pyx_TraceLine(353,0,__PYX_ERR(0, 353, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedbacks, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; + } + __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 353, __pyx_L1_error) + } + __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "wfpt.pyx":354 + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] + * responses = response[split_by == s] # <<<<<<<<<<<<<< + * s_size = responses.shape[0] + * qs[0] = q + */ + __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_20 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_19, __pyx_t_18, __pyx_t_17); + } + __pyx_t_19 = __pyx_t_18 = __pyx_t_17 = 0; + } + __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 354, __pyx_L1_error) + } + __pyx_t_20 = 0; + __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "wfpt.pyx":355 + * feedbacks = feedback[split_by == s] + * responses = response[split_by == s] + * s_size = responses.shape[0] # <<<<<<<<<<<<<< + * qs[0] = q + * qs[1] = q + */ + __Pyx_TraceLine(355,0,__PYX_ERR(0, 355, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_responses)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_v_s_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":356 + * responses = response[split_by == s] + * s_size = responses.shape[0] + * qs[0] = q # <<<<<<<<<<<<<< + * qs[1] = q + * + */ + __Pyx_TraceLine(356,0,__PYX_ERR(0, 356, __pyx_L1_error)) + __pyx_t_15 = 0; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":357 + * s_size = responses.shape[0] + * qs[0] = q + * qs[1] = q # <<<<<<<<<<<<<< + * + * # don't calculate pdf for first trial but still update q + */ + __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error)) + __pyx_t_15 = 1; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":360 + * + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error)) + __pyx_t_15 = 0; + __pyx_t_21 = 0; + __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); + __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides))); + if (__pyx_t_11) { + + /* "wfpt.pyx":361 + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses[0]]: + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< + * else: + * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) + */ + __Pyx_TraceLine(361,0,__PYX_ERR(0, 361, __pyx_L1_error)) + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); + + /* "wfpt.pyx":360 + * + * # don't calculate pdf for first trial but still update q + * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + goto __pyx_L7; + } + + /* "wfpt.pyx":363 + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< + * + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + */ + __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error)) + /*else*/ { + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); + } + __pyx_L7:; + + /* "wfpt.pyx":367 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[0] - qs[responses[0]]) + * + */ + __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error)) + __pyx_t_21 = 0; + __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); + + /* "wfpt.pyx":368 + * # received on current trial. + * qs[responses[0]] = qs[responses[0]] + \ + * alfa * (feedbacks[0] - qs[responses[0]]) # <<<<<<<<<<<<<< + * + * # loop through all trials in current condition + */ + __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error)) + __pyx_t_15 = 0; + __pyx_t_23 = 0; + __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); + + /* "wfpt.pyx":367 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[0] - qs[responses[0]]) + * + */ + __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error)) + __pyx_t_25 = 0; + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))))); + + /* "wfpt.pyx":371 + * + * # loop through all trials in current condition + * for i in range(1, s_size): # <<<<<<<<<<<<<< + * + * drift = (qs[1] - qs[0]) * v + */ + __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error)) + __pyx_t_27 = __pyx_v_s_size; + __pyx_t_28 = __pyx_t_27; + for (__pyx_t_29 = 1; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_i = __pyx_t_29; + + /* "wfpt.pyx":373 + * for i in range(1, s_size): + * + * drift = (qs[1] - qs[0]) * v # <<<<<<<<<<<<<< + * + * if drift == 0: + */ + __Pyx_TraceLine(373,0,__PYX_ERR(0, 373, __pyx_L1_error)) + __pyx_t_23 = 1; + __pyx_t_24 = 0; + __pyx_v_drift = (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v); + + /* "wfpt.pyx":375 + * drift = (qs[1] - qs[0]) * v + * + * if drift == 0: # <<<<<<<<<<<<<< + * p = 0.5 + * else: + */ + __Pyx_TraceLine(375,0,__PYX_ERR(0, 375, __pyx_L1_error)) + __pyx_t_11 = (__pyx_v_drift == 0.0); + if (__pyx_t_11) { + + /* "wfpt.pyx":376 + * + * if drift == 0: + * p = 0.5 # <<<<<<<<<<<<<< + * else: + * if responses[i] == 1: + */ + __Pyx_TraceLine(376,0,__PYX_ERR(0, 376, __pyx_L1_error)) + __pyx_v_p = 0.5; + + /* "wfpt.pyx":375 + * drift = (qs[1] - qs[0]) * v + * + * if drift == 0: # <<<<<<<<<<<<<< + * p = 0.5 + * else: + */ + goto __pyx_L10; + } + + /* "wfpt.pyx":378 + * p = 0.5 + * else: + * if responses[i] == 1: # <<<<<<<<<<<<<< + * p = (2.718281828459**(-2 * z * drift) - 1) / \ + * (2.718281828459**(-2 * drift) - 1) + */ + __Pyx_TraceLine(378,0,__PYX_ERR(0, 378, __pyx_L1_error)) + /*else*/ { + __pyx_t_24 = __pyx_v_i; + __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_responses.diminfo[0].strides)) == 1); + if (__pyx_t_11) { + + /* "wfpt.pyx":379 + * else: + * if responses[i] == 1: + * p = (2.718281828459**(-2 * z * drift) - 1) / \ # <<<<<<<<<<<<<< + * (2.718281828459**(-2 * drift) - 1) + * else: + */ + __Pyx_TraceLine(379,0,__PYX_ERR(0, 379, __pyx_L1_error)) + __pyx_v_p = ((pow(2.718281828459, ((-2.0 * __pyx_v_z) * __pyx_v_drift)) - 1.0) / (pow(2.718281828459, (-2.0 * __pyx_v_drift)) - 1.0)); + + /* "wfpt.pyx":378 + * p = 0.5 + * else: + * if responses[i] == 1: # <<<<<<<<<<<<<< + * p = (2.718281828459**(-2 * z * drift) - 1) / \ + * (2.718281828459**(-2 * drift) - 1) + */ + goto __pyx_L11; + } + + /* "wfpt.pyx":382 + * (2.718281828459**(-2 * drift) - 1) + * else: + * p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ # <<<<<<<<<<<<<< + * (2.718281828459**(-2 * drift) - 1) + * + */ + __Pyx_TraceLine(382,0,__PYX_ERR(0, 382, __pyx_L1_error)) + /*else*/ { + + /* "wfpt.pyx":383 + * else: + * p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ + * (2.718281828459**(-2 * drift) - 1) # <<<<<<<<<<<<<< + * + * # If one probability = 0, the log sum will be -Inf + */ + __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error)) + __pyx_v_p = (1.0 - ((pow(2.718281828459, ((-2.0 * __pyx_v_z) * __pyx_v_drift)) - 1.0) / (pow(2.718281828459, (-2.0 * __pyx_v_drift)) - 1.0))); + } + __pyx_L11:; + } + __pyx_L10:; + + /* "wfpt.pyx":386 + * + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< + * if p == 0: + * return -np.inf + */ + __Pyx_TraceLine(386,0,__PYX_ERR(0, 386, __pyx_L1_error)) + __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); + + /* "wfpt.pyx":387 + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(387,0,__PYX_ERR(0, 387, __pyx_L1_error)) + __pyx_t_11 = (__pyx_v_p == 0.0); + if (__pyx_t_11) { + + /* "wfpt.pyx":388 + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: + * return -np.inf # <<<<<<<<<<<<<< + * + * sum_logp += log(p) + */ + __Pyx_TraceLine(388,0,__PYX_ERR(0, 388, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":387 + * # If one probability = 0, the log sum will be -Inf + * p = p * (1 - p_outlier) + wp_outlier + * if p == 0: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":390 + * return -np.inf + * + * sum_logp += log(p) # <<<<<<<<<<<<<< + * + * # get learning rate for current trial. if pos_alpha is not in + */ + __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error)) + __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); + + /* "wfpt.pyx":395 + * # include it will be same as alpha so can still use this + * # calculation: + * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + __Pyx_TraceLine(395,0,__PYX_ERR(0, 395, __pyx_L1_error)) + __pyx_t_24 = __pyx_v_i; + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); + __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides))); + if (__pyx_t_11) { + + /* "wfpt.pyx":396 + * # calculation: + * if feedbacks[i] > qs[responses[i]]: + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< + * else: + * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) + */ + __Pyx_TraceLine(396,0,__PYX_ERR(0, 396, __pyx_L1_error)) + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); + + /* "wfpt.pyx":395 + * # include it will be same as alpha so can still use this + * # calculation: + * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + */ + goto __pyx_L13; + } + + /* "wfpt.pyx":398 + * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + * else: + * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< + * + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + */ + __Pyx_TraceLine(398,0,__PYX_ERR(0, 398, __pyx_L1_error)) + /*else*/ { + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); + } + __pyx_L13:; + + /* "wfpt.pyx":402 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[i] - qs[responses[i]]) + * return sum_logp + */ + __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error)) + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); + + /* "wfpt.pyx":403 + * # received on current trial. + * qs[responses[i]] = qs[responses[i]] + \ + * alfa * (feedbacks[i] - qs[responses[i]]) # <<<<<<<<<<<<<< + * return sum_logp + * + */ + __Pyx_TraceLine(403,0,__PYX_ERR(0, 403, __pyx_L1_error)) + __pyx_t_24 = __pyx_v_i; + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); + + /* "wfpt.pyx":402 + * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + * # received on current trial. + * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[i] - qs[responses[i]]) + * return sum_logp + */ + __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error)) + __pyx_t_25 = __pyx_v_i; + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides))))); + } + } + + /* "wfpt.pyx":404 + * qs[responses[i]] = qs[responses[i]] + \ + * alfa * (feedbacks[i] - qs[responses[i]]) + * return sum_logp # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(404,0,__PYX_ERR(0, 404, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":320 + * + * + * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] feedback, + * np.ndarray[long, ndim=1] split_by, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_rl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_qs); + __Pyx_XDECREF((PyObject *)__pyx_v_feedbacks); + __Pyx_XDECREF((PyObject *)__pyx_v_responses); + __Pyx_XDECREF((PyObject *)__pyx_v_unique); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":407 + * + * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_15wiener_like_multi(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_14wiener_like_multi, "wiener_like_multi(ndarray x, v, sv, a, z, sz, t, st, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_15wiener_like_multi = {"wiener_like_multi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_15wiener_like_multi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_14wiener_like_multi}; +static PyObject *__pyx_pw_4wfpt_15wiener_like_multi(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_v_sv = 0; + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_z = 0; + PyObject *__pyx_v_sz = 0; + PyObject *__pyx_v_t = 0; + PyObject *__pyx_v_st = 0; + double __pyx_v_err; + PyObject *__pyx_v_multi = 0; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_multi (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_multi,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + values[9] = ((PyObject *)((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 1); __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 2); __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 3); __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 4); __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 5); __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 6); __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 7); __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 8); __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[11] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[12] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[13] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[14] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[15] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi") < 0)) __PYX_ERR(0, 407, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_v = values[1]; + __pyx_v_sv = values[2]; + __pyx_v_a = values[3]; + __pyx_v_z = values[4]; + __pyx_v_sz = values[5]; + __pyx_v_t = values[6]; + __pyx_v_st = values[7]; + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + __pyx_v_multi = values[9]; + if (values[10]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)10)); + } + if (values[11]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)10)); + } + if (values[12]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[13]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-3)); + } + if (values[14]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[15]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, __pyx_nargs); __PYX_ERR(0, 407, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_14wiener_like_multi(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + double __pyx_v_p; + double __pyx_v_sum_logp; + double __pyx_v_wp_outlier; + PyObject *__pyx_v_params = NULL; + PyObject *__pyx_v_params_iter = NULL; + PyObject *__pyx_v_param = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + int __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + double __pyx_t_5; + double __pyx_t_6; + double __pyx_t_7; + double __pyx_t_8; + double __pyx_t_9; + double __pyx_t_10; + double __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + PyObject *(*__pyx_t_20)(PyObject *); + Py_ssize_t __pyx_t_21; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__12) + __Pyx_RefNannySetupContext("wiener_like_multi", 0); + __Pyx_TraceCall("wiener_like_multi", __pyx_f[0], 407, 0, __PYX_ERR(0, 407, __pyx_L1_error)); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 407, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":410 + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef double p = 0 + */ + __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":412 + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t i + * cdef double p = 0 # <<<<<<<<<<<<<< + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier + */ + __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error)) + __pyx_v_p = 0.0; + + /* "wfpt.pyx":413 + * cdef Py_ssize_t i + * cdef double p = 0 + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef double wp_outlier = w_outlier * p_outlier + * + */ + __Pyx_TraceLine(413,0,__PYX_ERR(0, 413, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":414 + * cdef double p = 0 + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * + * if multi is None: + */ + __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":416 + * cdef double wp_outlier = w_outlier * p_outlier + * + * if multi is None: # <<<<<<<<<<<<<< + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + */ + __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error)) + __pyx_t_2 = (__pyx_v_multi == Py_None); + if (__pyx_t_2) { + + /* "wfpt.pyx":417 + * + * if multi is None: + * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} + */ + __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_11 = __pyx_f_4wfpt_full_pdf(__pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":416 + * cdef double wp_outlier = w_outlier * p_outlier + * + * if multi is None: # <<<<<<<<<<<<<< + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + */ + } + + /* "wfpt.pyx":419 + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} # <<<<<<<<<<<<<< + * params_iter = copy(params) + * for i in range(size): + */ + __Pyx_TraceLine(419,0,__PYX_ERR(0, 419, __pyx_L1_error)) + /*else*/ { + __pyx_t_12 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_v_params = ((PyObject*)__pyx_t_12); + __pyx_t_12 = 0; + + /* "wfpt.pyx":420 + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} + * params_iter = copy(params) # <<<<<<<<<<<<<< + * for i in range(size): + * for param in multi: + */ + __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = NULL; + __pyx_t_15 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + __pyx_t_15 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_params}; + __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __pyx_v_params_iter = __pyx_t_12; + __pyx_t_12 = 0; + + /* "wfpt.pyx":421 + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} + * params_iter = copy(params) + * for i in range(size): # <<<<<<<<<<<<<< + * for param in multi: + * params_iter[param] = params[param][i] + */ + __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error)) + __pyx_t_16 = __pyx_v_size; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + + /* "wfpt.pyx":422 + * params_iter = copy(params) + * for i in range(size): + * for param in multi: # <<<<<<<<<<<<<< + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: + */ + __Pyx_TraceLine(422,0,__PYX_ERR(0, 422, __pyx_L1_error)) + if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { + __pyx_t_12 = __pyx_v_multi; __Pyx_INCREF(__pyx_t_12); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + } else { + __pyx_t_19 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 422, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_20)) { + if (likely(PyList_CheckExact(__pyx_t_12))) { + if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) + #else + __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + #endif + } else { + if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) + #else + __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + #endif + } + } else { + __pyx_t_13 = __pyx_t_20(__pyx_t_12); + if (unlikely(!__pyx_t_13)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 422, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_13); + } + __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_13); + __pyx_t_13 = 0; + + /* "wfpt.pyx":423 + * for i in range(size): + * for param in multi: + * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< + * if abs(x[i]) != 999.: + * p = full_pdf(x[i], params_iter['v'], + */ + __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error)) + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_14) < 0))) __PYX_ERR(0, 423, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "wfpt.pyx":422 + * params_iter = copy(params) + * for i in range(size): + * for param in multi: # <<<<<<<<<<<<<< + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: + */ + __Pyx_TraceLine(422,0,__PYX_ERR(0, 422, __pyx_L1_error)) + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "wfpt.pyx":424 + * for param in multi: + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< + * p = full_pdf(x[i], params_iter['v'], + * params_iter['sv'], params_iter['a'], params_iter['z'], + */ + __Pyx_TraceLine(424,0,__PYX_ERR(0, 424, __pyx_L1_error)) + __pyx_t_21 = __pyx_v_i; + __pyx_t_2 = (fabs((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides))) != 999.); + if (__pyx_t_2) { + + /* "wfpt.pyx":425 + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: + * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter['t'], params_iter['st'], + */ + __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "wfpt.pyx":426 + * if abs(x[i]) != 999.: + * p = full_pdf(x[i], params_iter['v'], + * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< + * params_iter['sz'], params_iter['t'], params_iter['st'], + * err, n_st, n_sz, use_adaptive, simps_err) + */ + __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "wfpt.pyx":427 + * p = full_pdf(x[i], params_iter['v'], + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter['t'], params_iter['st'], # <<<<<<<<<<<<<< + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier + */ + __Pyx_TraceLine(427,0,__PYX_ERR(0, 427, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "wfpt.pyx":425 + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: + * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter['t'], params_iter['st'], + */ + __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) + __pyx_t_22.__pyx_n = 4; + __pyx_t_22.n_st = __pyx_v_n_st; + __pyx_t_22.n_sz = __pyx_v_n_sz; + __pyx_t_22.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_22.simps_err = __pyx_v_simps_err; + __pyx_t_4 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5, __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_v_p = __pyx_t_4; + + /* "wfpt.pyx":429 + * params_iter['sz'], params_iter['t'], params_iter['st'], + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< + * elif x[i] == 999.: + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + */ + __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error)) + __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); + + /* "wfpt.pyx":424 + * for param in multi: + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< + * p = full_pdf(x[i], params_iter['v'], + * params_iter['sv'], params_iter['a'], params_iter['z'], + */ + goto __pyx_L9; + } + + /* "wfpt.pyx":430 + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier + * elif x[i] == 999.: # <<<<<<<<<<<<<< + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + * else: # x[i] == -999. + */ + __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error)) + __pyx_t_21 = __pyx_v_i; + __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)) == 999.); + if (__pyx_t_2) { + + /* "wfpt.pyx":431 + * p = p * (1 - p_outlier) + wp_outlier + * elif x[i] == 999.: + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< + * else: # x[i] == -999. + * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + */ + __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __pyx_f_4wfpt_prob_ub(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_v_p = __pyx_t_7; + + /* "wfpt.pyx":430 + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier + * elif x[i] == 999.: # <<<<<<<<<<<<<< + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + * else: # x[i] == -999. + */ + goto __pyx_L9; + } + + /* "wfpt.pyx":433 + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + * else: # x[i] == -999. + * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< + * + * sum_logp += log(p) + */ + __Pyx_TraceLine(433,0,__PYX_ERR(0, 433, __pyx_L1_error)) + /*else*/ { + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = __pyx_f_4wfpt_prob_ub(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_v_p = (1.0 - __pyx_t_4); + } + __pyx_L9:; + + /* "wfpt.pyx":435 + * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + * + * sum_logp += log(p) # <<<<<<<<<<<<<< + * + * return sum_logp + */ + __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error)) + __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); + } + + /* "wfpt.pyx":437 + * sum_logp += log(p) + * + * return sum_logp # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + } + + /* "wfpt.pyx":407 + * + * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_params); + __Pyx_XDECREF(__pyx_v_params_iter); + __Pyx_XDECREF(__pyx_v_param); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":440 + * + * + * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_17wiener_like_multi_rlddm(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_16wiener_like_multi_rlddm, "wiener_like_multi_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_17wiener_like_multi_rlddm = {"wiener_like_multi_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_17wiener_like_multi_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_16wiener_like_multi_rlddm}; +static PyObject *__pyx_pw_4wfpt_17wiener_like_multi_rlddm(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_response = 0; + PyArrayObject *__pyx_v_feedback = 0; + PyArrayObject *__pyx_v_split_by = 0; + double __pyx_v_q; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_v_sv = 0; + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_z = 0; + PyObject *__pyx_v_sz = 0; + PyObject *__pyx_v_t = 0; + PyObject *__pyx_v_st = 0; + PyObject *__pyx_v_alpha = 0; + double __pyx_v_err; + PyObject *__pyx_v_multi = 0; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_multi_rlddm (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_alpha,&__pyx_n_s_err,&__pyx_n_s_multi,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + + /* "wfpt.pyx":444 + * np.ndarray[double, ndim=1] feedback, + * np.ndarray[long, ndim=1] split_by, + * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + values[14] = ((PyObject *)((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 21: values[20] = __Pyx_Arg_FASTCALL(__pyx_args, 20); + CYTHON_FALLTHROUGH; + case 20: values[19] = __Pyx_Arg_FASTCALL(__pyx_args, 19); + CYTHON_FALLTHROUGH; + case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18); + CYTHON_FALLTHROUGH; + case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); + CYTHON_FALLTHROUGH; + case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 1); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 2); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 3); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 4); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 5); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 6); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 7); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 8); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 9); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 10); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 11); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 12); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 13); __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi); + if (value) { values[14] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[15] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[16] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 17: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[17] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 18: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[18] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 19: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[19] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 20: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[20] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_rlddm") < 0)) __PYX_ERR(0, 440, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 21: values[20] = __Pyx_Arg_FASTCALL(__pyx_args, 20); + CYTHON_FALLTHROUGH; + case 20: values[19] = __Pyx_Arg_FASTCALL(__pyx_args, 19); + CYTHON_FALLTHROUGH; + case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18); + CYTHON_FALLTHROUGH; + case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); + CYTHON_FALLTHROUGH; + case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_response = ((PyArrayObject *)values[1]); + __pyx_v_feedback = ((PyArrayObject *)values[2]); + __pyx_v_split_by = ((PyArrayObject *)values[3]); + __pyx_v_q = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) + __pyx_v_v = values[5]; + __pyx_v_sv = values[6]; + __pyx_v_a = values[7]; + __pyx_v_z = values[8]; + __pyx_v_sz = values[9]; + __pyx_v_t = values[10]; + __pyx_v_st = values[11]; + __pyx_v_alpha = values[12]; + __pyx_v_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) + __pyx_v_multi = values[14]; + if (values[15]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)10)); + } + if (values[16]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)10)); + } + if (values[17]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[18]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[18]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-3)); + } + if (values[19]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[19]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[20]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[20]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, __pyx_nargs); __PYX_ERR(0, 440, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_multi_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 440, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 441, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 442, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_16wiener_like_multi_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_alpha, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* "wfpt.pyx":440 + * + * + * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, PyObject *__pyx_v_alpha, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + Py_ssize_t __pyx_v_size; + double __pyx_v_p; + double __pyx_v_sum_logp; + double __pyx_v_wp_outlier; + PyArrayObject *__pyx_v_qs = 0; + PyObject *__pyx_v_params = NULL; + PyObject *__pyx_v_params_iter = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_param = NULL; + PyObject *__pyx_v_alfa = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; + __Pyx_Buffer __pyx_pybuffer_feedback; + __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; + __Pyx_Buffer __pyx_pybuffer_qs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_response; + __Pyx_Buffer __pyx_pybuffer_response; + __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; + __Pyx_Buffer __pyx_pybuffer_split_by; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + double __pyx_t_10; + double __pyx_t_11; + double __pyx_t_12; + double __pyx_t_13; + double __pyx_t_14; + double __pyx_t_15; + double __pyx_t_16; + double __pyx_t_17; + double __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + PyObject *(*__pyx_t_21)(PyObject *); + Py_ssize_t __pyx_t_22; + PyObject *(*__pyx_t_23)(PyObject *); + Py_ssize_t __pyx_t_24; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__13) + __Pyx_RefNannySetupContext("wiener_like_multi_rlddm", 0); + __Pyx_TraceCall("wiener_like_multi_rlddm", __pyx_f[0], 440, 0, __PYX_ERR(0, 440, __pyx_L1_error)); + __pyx_pybuffer_qs.pybuffer.buf = NULL; + __pyx_pybuffer_qs.refcount = 0; + __pyx_pybuffernd_qs.data = NULL; + __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_response.pybuffer.buf = NULL; + __pyx_pybuffer_response.refcount = 0; + __pyx_pybuffernd_response.data = NULL; + __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; + __pyx_pybuffer_feedback.pybuffer.buf = NULL; + __pyx_pybuffer_feedback.refcount = 0; + __pyx_pybuffernd_feedback.data = NULL; + __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; + __pyx_pybuffer_split_by.pybuffer.buf = NULL; + __pyx_pybuffer_split_by.refcount = 0; + __pyx_pybuffernd_split_by.data = NULL; + __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) + } + __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) + } + __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) + } + __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":447 + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t ij + * cdef Py_ssize_t s_size + */ + __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":450 + * cdef Py_ssize_t ij + * cdef Py_ssize_t s_size + * cdef double p = 0 # <<<<<<<<<<<<<< + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier + */ + __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error)) + __pyx_v_p = 0.0; + + /* "wfpt.pyx":451 + * cdef Py_ssize_t s_size + * cdef double p = 0 + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef double wp_outlier = w_outlier * p_outlier + * cdef int s + */ + __Pyx_TraceLine(451,0,__PYX_ERR(0, 451, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":452 + * cdef double p = 0 + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * cdef int s + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + */ + __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":454 + * cdef double wp_outlier = w_outlier * p_outlier + * cdef int s + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< + * + * if multi is None: + */ + __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 454, __pyx_L1_error) + } else {__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_t_8 = 0; + __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":456 + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + * + * if multi is None: # <<<<<<<<<<<<<< + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + */ + __Pyx_TraceLine(456,0,__PYX_ERR(0, 456, __pyx_L1_error)) + __pyx_t_9 = (__pyx_v_multi == Py_None); + if (__pyx_t_9) { + + /* "wfpt.pyx":457 + * + * if multi is None: + * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} + */ + __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_18 = __pyx_f_4wfpt_full_pdf(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":456 + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + * + * if multi is None: # <<<<<<<<<<<<<< + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + */ + } + + /* "wfpt.pyx":459 + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} # <<<<<<<<<<<<<< + * params_iter = copy(params) + * qs[0] = q + */ + __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error)) + /*else*/ { + __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_alpha, __pyx_v_alpha) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_v_params = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":460 + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} + * params_iter = copy(params) # <<<<<<<<<<<<<< + * qs[0] = q + * qs[1] = q + */ + __Pyx_TraceLine(460,0,__PYX_ERR(0, 460, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_params}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_v_params_iter = __pyx_t_2; + __pyx_t_2 = 0; + + /* "wfpt.pyx":461 + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} + * params_iter = copy(params) + * qs[0] = q # <<<<<<<<<<<<<< + * qs[1] = q + * for i in range(size): + */ + __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error)) + __pyx_t_19 = 0; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":462 + * params_iter = copy(params) + * qs[0] = q + * qs[1] = q # <<<<<<<<<<<<<< + * for i in range(size): + * for param in multi: + */ + __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error)) + __pyx_t_19 = 1; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":463 + * qs[0] = q + * qs[1] = q + * for i in range(size): # <<<<<<<<<<<<<< + * for param in multi: + * params_iter[param] = params[param][i] + */ + __Pyx_TraceLine(463,0,__PYX_ERR(0, 463, __pyx_L1_error)) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_20 = 0; + __pyx_t_21 = NULL; + } else { + __pyx_t_20 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 463, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_21)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_20 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_20); __Pyx_INCREF(__pyx_t_4); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_20 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_20); __Pyx_INCREF(__pyx_t_4); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_21(__pyx_t_2); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 463, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); + __pyx_t_4 = 0; + + /* "wfpt.pyx":464 + * qs[1] = q + * for i in range(size): + * for param in multi: # <<<<<<<<<<<<<< + * params_iter[param] = params[param][i] + * + */ + __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error)) + if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { + __pyx_t_4 = __pyx_v_multi; __Pyx_INCREF(__pyx_t_4); __pyx_t_22 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_22 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_23 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 464, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_22); __Pyx_INCREF(__pyx_t_6); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 464, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_22); __Pyx_INCREF(__pyx_t_6); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 464, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_23(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 464, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_6); + __pyx_t_6 = 0; + + /* "wfpt.pyx":465 + * for i in range(size): + * for param in multi: + * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< + * + * if (i != 0): + */ + __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error)) + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_5) < 0))) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":464 + * qs[1] = q + * for i in range(size): + * for param in multi: # <<<<<<<<<<<<<< + * params_iter[param] = params[param][i] + * + */ + __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":467 + * params_iter[param] = params[param][i] + * + * if (i != 0): # <<<<<<<<<<<<<< + * if (split_by[i] != split_by[i-1]): + * qs[0] = q + */ + __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error)) + __pyx_t_9 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_i, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 467, __pyx_L1_error) + if (__pyx_t_9) { + + /* "wfpt.pyx":468 + * + * if (i != 0): + * if (split_by[i] != split_by[i-1]): # <<<<<<<<<<<<<< + * qs[0] = q + * qs[1] = q + */ + __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_split_by), __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_split_by), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "wfpt.pyx":469 + * if (i != 0): + * if (split_by[i] != split_by[i-1]): + * qs[0] = q # <<<<<<<<<<<<<< + * qs[1] = q + * + */ + __Pyx_TraceLine(469,0,__PYX_ERR(0, 469, __pyx_L1_error)) + __pyx_t_19 = 0; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":470 + * if (split_by[i] != split_by[i-1]): + * qs[0] = q + * qs[1] = q # <<<<<<<<<<<<<< + * + * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), + */ + __Pyx_TraceLine(470,0,__PYX_ERR(0, 470, __pyx_L1_error)) + __pyx_t_19 = 1; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":468 + * + * if (i != 0): + * if (split_by[i] != split_by[i-1]): # <<<<<<<<<<<<<< + * qs[0] = q + * qs[1] = q + */ + } + + /* "wfpt.pyx":467 + * params_iter[param] = params[param][i] + * + * if (i != 0): # <<<<<<<<<<<<<< + * if (split_by[i] != split_by[i-1]): + * qs[0] = q + */ + } + + /* "wfpt.pyx":472 + * qs[1] = q + * + * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), # <<<<<<<<<<<<<< + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter[ + */ + __Pyx_TraceLine(472,0,__PYX_ERR(0, 472, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_19 = 1; + __pyx_t_24 = 0; + __pyx_t_6 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":473 + * + * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), + * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< + * params_iter['sz'], params_iter[ + * 't'], params_iter['st'], + */ + __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":474 + * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter[ # <<<<<<<<<<<<<< + * 't'], params_iter['st'], + * err, n_st, n_sz, use_adaptive, simps_err) + */ + __Pyx_TraceLine(474,0,__PYX_ERR(0, 474, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":475 + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter[ + * 't'], params_iter['st'], # <<<<<<<<<<<<<< + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier + */ + __Pyx_TraceLine(475,0,__PYX_ERR(0, 475, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":472 + * qs[1] = q + * + * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), # <<<<<<<<<<<<<< + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter[ + */ + __Pyx_TraceLine(472,0,__PYX_ERR(0, 472, __pyx_L1_error)) + __pyx_t_25.__pyx_n = 4; + __pyx_t_25.n_st = __pyx_v_n_st; + __pyx_t_25.n_sz = __pyx_v_n_sz; + __pyx_t_25.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_25.simps_err = __pyx_v_simps_err; + __pyx_t_10 = __pyx_f_4wfpt_full_pdf(__pyx_t_18, __pyx_t_17, __pyx_t_16, __pyx_t_15, __pyx_t_14, __pyx_t_13, __pyx_t_12, __pyx_t_11, __pyx_v_err, 0, &__pyx_t_25); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_v_p = __pyx_t_10; + + /* "wfpt.pyx":477 + * 't'], params_iter['st'], + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< + * sum_logp += log(p) + * + */ + __Pyx_TraceLine(477,0,__PYX_ERR(0, 477, __pyx_L1_error)) + __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); + + /* "wfpt.pyx":478 + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier + * sum_logp += log(p) # <<<<<<<<<<<<<< + * + * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) + */ + __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error)) + __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); + + /* "wfpt.pyx":480 + * sum_logp += log(p) + * + * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) # <<<<<<<<<<<<<< + * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) + * + */ + __Pyx_TraceLine(480,0,__PYX_ERR(0, 480, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Power(__pyx_float_2_718281828459, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Power(__pyx_float_2_718281828459, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_5, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_alfa, __pyx_t_5); + __pyx_t_5 = 0; + + /* "wfpt.pyx":481 + * + * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) + * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) # <<<<<<<<<<<<<< + * + * return sum_logp + */ + __Pyx_TraceLine(481,0,__PYX_ERR(0, 481, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qs), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qs), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_v_alfa, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qs), __pyx_t_3, __pyx_t_6) < 0))) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "wfpt.pyx":463 + * qs[0] = q + * qs[1] = q + * for i in range(size): # <<<<<<<<<<<<<< + * for param in multi: + * params_iter[param] = params[param][i] + */ + __Pyx_TraceLine(463,0,__PYX_ERR(0, 463, __pyx_L1_error)) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "wfpt.pyx":483 + * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) + * + * return sum_logp # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "wfpt.pyx":440 + * + * + * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_multi_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_qs); + __Pyx_XDECREF(__pyx_v_params); + __Pyx_XDECREF(__pyx_v_params_iter); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_param); + __Pyx_XDECREF(__pyx_v_alfa); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":486 + * + * + * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< + * np.ndarray[float, ndim=2] rl_arr, + * np.ndarray[double, ndim=1] x, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_19wiener_like_rlssm_nn_reg(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_18wiener_like_rlssm_nn_reg, "wiener_like_rlssm_nn_reg(ndarray data, ndarray rl_arr, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); +static PyMethodDef __pyx_mdef_4wfpt_19wiener_like_rlssm_nn_reg = {"wiener_like_rlssm_nn_reg", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_19wiener_like_rlssm_nn_reg, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_18wiener_like_rlssm_nn_reg}; +static PyObject *__pyx_pw_4wfpt_19wiener_like_rlssm_nn_reg(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_data = 0; + PyArrayObject *__pyx_v_rl_arr = 0; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_response = 0; + PyArrayObject *__pyx_v_feedback = 0; + PyArrayObject *__pyx_v_split_by = 0; + double __pyx_v_q; + PyArrayObject *__pyx_v_params_bnds = 0; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + PyObject *__pyx_v_network = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_rlssm_nn_reg (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_rl_arr,&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_params_bnds,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; + PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0}; + + /* "wfpt.pyx":494 + * double q, + * np.ndarray[double, ndim=2] params_bnds, + * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< + * cdef double rl_alpha + * cdef Py_ssize_t size = x.shape[0] + */ + values[10] = ((PyObject *)((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rl_arr)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 1); __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 2); __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 3); __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 4); __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 5); __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 6); __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_bnds)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 7); __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[8] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlssm_nn_reg") < 0)) __PYX_ERR(0, 486, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_data = ((PyArrayObject *)values[0]); + __pyx_v_rl_arr = ((PyArrayObject *)values[1]); + __pyx_v_x = ((PyArrayObject *)values[2]); + __pyx_v_response = ((PyArrayObject *)values[3]); + __pyx_v_feedback = ((PyArrayObject *)values[4]); + __pyx_v_split_by = ((PyArrayObject *)values[5]); + __pyx_v_q = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error) + __pyx_v_params_bnds = ((PyArrayObject *)values[7]); + if (values[8]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[9]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + __pyx_v_network = values[10]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, __pyx_nargs); __PYX_ERR(0, 486, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn_reg", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rl_arr), __pyx_ptype_5numpy_ndarray, 1, "rl_arr", 0))) __PYX_ERR(0, 487, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 488, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 489, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 490, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 491, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_bnds), __pyx_ptype_5numpy_ndarray, 1, "params_bnds", 0))) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(__pyx_self, __pyx_v_data, __pyx_v_rl_arr, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); + + /* "wfpt.pyx":486 + * + * + * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< + * np.ndarray[float, ndim=2] rl_arr, + * np.ndarray[double, ndim=1] x, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_rl_arr, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { + double __pyx_v_rl_alpha; + CYTHON_UNUSED Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_i_p; + Py_ssize_t __pyx_v_s_size; + int __pyx_v_s; + CYTHON_UNUSED double __pyx_v_log_p; + double __pyx_v_sum_logp; + CYTHON_UNUSED double __pyx_v_wp_outlier; + double __pyx_v_alfa; + PyArrayObject *__pyx_v_qs = 0; + PyArrayObject *__pyx_v_xs = 0; + PyArrayObject *__pyx_v_feedbacks = 0; + PyArrayObject *__pyx_v_responses = 0; + PyArrayObject *__pyx_v_responses_qs = 0; + PyArrayObject *__pyx_v_unique = 0; + PyArrayObject *__pyx_v_data_copy = 0; + float __pyx_v_ll_min; + int __pyx_v_cumm_s_size; + PyObject *__pyx_v_lower_bnd = NULL; + PyObject *__pyx_v_upper_bnd = NULL; + PyObject *__pyx_v_tp_scale = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_data; + __Pyx_Buffer __pyx_pybuffer_data; + __Pyx_LocalBuf_ND __pyx_pybuffernd_data_copy; + __Pyx_Buffer __pyx_pybuffer_data_copy; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; + __Pyx_Buffer __pyx_pybuffer_feedback; + __Pyx_LocalBuf_ND __pyx_pybuffernd_feedbacks; + __Pyx_Buffer __pyx_pybuffer_feedbacks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_params_bnds; + __Pyx_Buffer __pyx_pybuffer_params_bnds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; + __Pyx_Buffer __pyx_pybuffer_qs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_response; + __Pyx_Buffer __pyx_pybuffer_response; + __Pyx_LocalBuf_ND __pyx_pybuffernd_responses; + __Pyx_Buffer __pyx_pybuffer_responses; + __Pyx_LocalBuf_ND __pyx_pybuffernd_responses_qs; + __Pyx_Buffer __pyx_pybuffer_responses_qs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rl_arr; + __Pyx_Buffer __pyx_pybuffer_rl_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; + __Pyx_Buffer __pyx_pybuffer_split_by; + __Pyx_LocalBuf_ND __pyx_pybuffernd_unique; + __Pyx_Buffer __pyx_pybuffer_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xs; + __Pyx_Buffer __pyx_pybuffer_xs; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + npy_intp __pyx_t_15; + npy_intp __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyArrayObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyArrayObject *__pyx_t_22 = NULL; + PyArrayObject *__pyx_t_23 = NULL; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + float __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + PyObject *__pyx_t_33 = NULL; + PyObject *__pyx_t_34 = NULL; + double __pyx_t_35; + PyObject *__pyx_t_36 = NULL; + PyObject *__pyx_t_37 = NULL; + PyObject *__pyx_t_38 = NULL; + PyObject *__pyx_t_39 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__14) + __Pyx_RefNannySetupContext("wiener_like_rlssm_nn_reg", 0); + __Pyx_TraceCall("wiener_like_rlssm_nn_reg", __pyx_f[0], 486, 0, __PYX_ERR(0, 486, __pyx_L1_error)); + __pyx_pybuffer_qs.pybuffer.buf = NULL; + __pyx_pybuffer_qs.refcount = 0; + __pyx_pybuffernd_qs.data = NULL; + __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; + __pyx_pybuffer_xs.pybuffer.buf = NULL; + __pyx_pybuffer_xs.refcount = 0; + __pyx_pybuffernd_xs.data = NULL; + __pyx_pybuffernd_xs.rcbuffer = &__pyx_pybuffer_xs; + __pyx_pybuffer_feedbacks.pybuffer.buf = NULL; + __pyx_pybuffer_feedbacks.refcount = 0; + __pyx_pybuffernd_feedbacks.data = NULL; + __pyx_pybuffernd_feedbacks.rcbuffer = &__pyx_pybuffer_feedbacks; + __pyx_pybuffer_responses.pybuffer.buf = NULL; + __pyx_pybuffer_responses.refcount = 0; + __pyx_pybuffernd_responses.data = NULL; + __pyx_pybuffernd_responses.rcbuffer = &__pyx_pybuffer_responses; + __pyx_pybuffer_responses_qs.pybuffer.buf = NULL; + __pyx_pybuffer_responses_qs.refcount = 0; + __pyx_pybuffernd_responses_qs.data = NULL; + __pyx_pybuffernd_responses_qs.rcbuffer = &__pyx_pybuffer_responses_qs; + __pyx_pybuffer_unique.pybuffer.buf = NULL; + __pyx_pybuffer_unique.refcount = 0; + __pyx_pybuffernd_unique.data = NULL; + __pyx_pybuffernd_unique.rcbuffer = &__pyx_pybuffer_unique; + __pyx_pybuffer_data_copy.pybuffer.buf = NULL; + __pyx_pybuffer_data_copy.refcount = 0; + __pyx_pybuffernd_data_copy.data = NULL; + __pyx_pybuffernd_data_copy.rcbuffer = &__pyx_pybuffer_data_copy; + __pyx_pybuffer_data.pybuffer.buf = NULL; + __pyx_pybuffer_data.refcount = 0; + __pyx_pybuffernd_data.data = NULL; + __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; + __pyx_pybuffer_rl_arr.pybuffer.buf = NULL; + __pyx_pybuffer_rl_arr.refcount = 0; + __pyx_pybuffernd_rl_arr.data = NULL; + __pyx_pybuffernd_rl_arr.rcbuffer = &__pyx_pybuffer_rl_arr; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_response.pybuffer.buf = NULL; + __pyx_pybuffer_response.refcount = 0; + __pyx_pybuffernd_response.data = NULL; + __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; + __pyx_pybuffer_feedback.pybuffer.buf = NULL; + __pyx_pybuffer_feedback.refcount = 0; + __pyx_pybuffernd_feedback.data = NULL; + __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; + __pyx_pybuffer_split_by.pybuffer.buf = NULL; + __pyx_pybuffer_split_by.refcount = 0; + __pyx_pybuffernd_split_by.data = NULL; + __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; + __pyx_pybuffer_params_bnds.pybuffer.buf = NULL; + __pyx_pybuffer_params_bnds.refcount = 0; + __pyx_pybuffernd_params_bnds.data = NULL; + __pyx_pybuffernd_params_bnds.rcbuffer = &__pyx_pybuffer_params_bnds; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rl_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rl_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_pybuffernd_rl_arr.diminfo[0].strides = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rl_arr.diminfo[0].shape = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rl_arr.diminfo[1].strides = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rl_arr.diminfo[1].shape = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_bnds, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_pybuffernd_params_bnds.diminfo[0].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_bnds.diminfo[0].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_params_bnds.diminfo[1].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_params_bnds.diminfo[1].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[1]; + + /* "wfpt.pyx":496 + * double p_outlier=0, double w_outlier=0, network = None): + * cdef double rl_alpha + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, i_p + * cdef Py_ssize_t s_size + */ + __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":500 + * cdef Py_ssize_t s_size + * cdef int s + * cdef double log_p = 0 # <<<<<<<<<<<<<< + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier + */ + __Pyx_TraceLine(500,0,__PYX_ERR(0, 500, __pyx_L1_error)) + __pyx_v_log_p = 0.0; + + /* "wfpt.pyx":501 + * cdef int s + * cdef double log_p = 0 + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef double wp_outlier = w_outlier * p_outlier + * cdef double alfa + */ + __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":502 + * cdef double log_p = 0 + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * cdef double alfa + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + */ + __Pyx_TraceLine(502,0,__PYX_ERR(0, 502, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":504 + * cdef double wp_outlier = w_outlier * p_outlier + * cdef double alfa + * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim=1] xs + * cdef np.ndarray[double, ndim=1] feedbacks + */ + __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 504, __pyx_L1_error) + } else {__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_t_8 = 0; + __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":509 + * cdef np.ndarray[long, ndim=1] responses + * cdef np.ndarray[long, ndim=1] responses_qs + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< + * cdef np.ndarray[float, ndim=2] data_copy = data + * cdef float ll_min = -16.11809 + */ + __Pyx_TraceLine(509,0,__PYX_ERR(0, 509, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 509, __pyx_L1_error) + } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_9 = 0; + __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":510 + * cdef np.ndarray[long, ndim=1] responses_qs + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + * cdef np.ndarray[float, ndim=2] data_copy = data # <<<<<<<<<<<<<< + * cdef float ll_min = -16.11809 + * cdef int cumm_s_size = 0 + */ + __Pyx_TraceLine(510,0,__PYX_ERR(0, 510, __pyx_L1_error)) + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data_copy.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_data), &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_data_copy = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 510, __pyx_L1_error) + } else {__pyx_pybuffernd_data_copy.diminfo[0].strides = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data_copy.diminfo[0].shape = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data_copy.diminfo[1].strides = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data_copy.diminfo[1].shape = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.shape[1]; + } + } + __Pyx_INCREF((PyObject *)__pyx_v_data); + __pyx_v_data_copy = ((PyArrayObject *)__pyx_v_data); + + /* "wfpt.pyx":511 + * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + * cdef np.ndarray[float, ndim=2] data_copy = data + * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< + * cdef int cumm_s_size = 0 + * + */ + __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error)) + __pyx_v_ll_min = -16.11809; + + /* "wfpt.pyx":512 + * cdef np.ndarray[float, ndim=2] data_copy = data + * cdef float ll_min = -16.11809 + * cdef int cumm_s_size = 0 # <<<<<<<<<<<<<< + * + * if not p_outlier_in_range(p_outlier): + */ + __Pyx_TraceLine(512,0,__PYX_ERR(0, 512, __pyx_L1_error)) + __pyx_v_cumm_s_size = 0; + + /* "wfpt.pyx":514 + * cdef int cumm_s_size = 0 + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error)) + __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_10); + if (__pyx_t_11) { + + /* "wfpt.pyx":515 + * + * if not p_outlier_in_range(p_outlier): + * return -np.inf # <<<<<<<<<<<<<< + * + * # Check for boundary violations -- if true, return -np.inf + */ + __Pyx_TraceLine(515,0,__PYX_ERR(0, 515, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":514 + * cdef int cumm_s_size = 0 + * + * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":518 + * + * # Check for boundary violations -- if true, return -np.inf + * for i_p in np.arange(1, data.shape[1]-2): # <<<<<<<<<<<<<< + * lower_bnd = params_bnds[0][i_p] + * upper_bnd = params_bnds[1][i_p] + */ + __Pyx_TraceLine(518,0,__PYX_ERR(0, 518, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_data)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(((__pyx_t_1[1]) - 2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_int_1, __pyx_t_6}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 518, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 518, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 518, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_13(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 518, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_i_p = __pyx_t_14; + + /* "wfpt.pyx":519 + * # Check for boundary violations -- if true, return -np.inf + * for i_p in np.arange(1, data.shape[1]-2): + * lower_bnd = params_bnds[0][i_p] # <<<<<<<<<<<<<< + * upper_bnd = params_bnds[1][i_p] + * + */ + __Pyx_TraceLine(519,0,__PYX_ERR(0, 519, __pyx_L1_error)) + __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_lower_bnd, __pyx_t_6); + __pyx_t_6 = 0; + + /* "wfpt.pyx":520 + * for i_p in np.arange(1, data.shape[1]-2): + * lower_bnd = params_bnds[0][i_p] + * upper_bnd = params_bnds[1][i_p] # <<<<<<<<<<<<<< + * + * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: + */ + __Pyx_TraceLine(520,0,__PYX_ERR(0, 520, __pyx_L1_error)) + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_upper_bnd, __pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":522 + * upper_bnd = params_bnds[1][i_p] + * + * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error)) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_slice__7); + __Pyx_GIVEREF(__pyx_slice__7); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__7); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_6, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lower_bnd, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!__pyx_t_10) { + } else { + __pyx_t_11 = __pyx_t_10; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_slice__7); + __Pyx_GIVEREF(__pyx_slice__7); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__7); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_2, }; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_upper_bnd, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_11 = __pyx_t_10; + __pyx_L7_bool_binop_done:; + if (__pyx_t_11) { + + /* "wfpt.pyx":523 + * + * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: + * return -np.inf # <<<<<<<<<<<<<< + * + * # unique represent # of conditions + */ + __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":522 + * upper_bnd = params_bnds[1][i_p] + * + * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":518 + * + * # Check for boundary violations -- if true, return -np.inf + * for i_p in np.arange(1, data.shape[1]-2): # <<<<<<<<<<<<<< + * lower_bnd = params_bnds[0][i_p] + * upper_bnd = params_bnds[1][i_p] + */ + __Pyx_TraceLine(518,0,__PYX_ERR(0, 518, __pyx_L1_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":526 + * + * # unique represent # of conditions + * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< + * s = unique[j] + * # select trials for current condition, identified by the split_by-array + */ + __Pyx_TraceLine(526,0,__PYX_ERR(0, 526, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_15 = (__pyx_t_1[0]); + __pyx_t_16 = __pyx_t_15; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_16; __pyx_t_12+=1) { + __pyx_v_j = __pyx_t_12; + + /* "wfpt.pyx":527 + * # unique represent # of conditions + * for j in range(unique.shape[0]): + * s = unique[j] # <<<<<<<<<<<<<< + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] + */ + __Pyx_TraceLine(527,0,__PYX_ERR(0, 527, __pyx_L1_error)) + __pyx_t_17 = __pyx_v_j; + __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_unique.diminfo[0].strides)); + + /* "wfpt.pyx":529 + * s = unique[j] + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< + * responses = response[split_by == s] + * xs = x[split_by == s] + */ + __Pyx_TraceLine(529,0,__PYX_ERR(0, 529, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_18 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedbacks, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21); + } + __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0; + } + __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 529, __pyx_L1_error) + } + __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "wfpt.pyx":530 + * # select trials for current condition, identified by the split_by-array + * feedbacks = feedback[split_by == s] + * responses = response[split_by == s] # <<<<<<<<<<<<<< + * xs = x[split_by == s] + * s_size = xs.shape[0] + */ + __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_22 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19); + } + __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0; + } + __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 530, __pyx_L1_error) + } + __pyx_t_22 = 0; + __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "wfpt.pyx":531 + * feedbacks = feedback[split_by == s] + * responses = response[split_by == s] + * xs = x[split_by == s] # <<<<<<<<<<<<<< + * s_size = xs.shape[0] + * qs[0] = q + */ + __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_23 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21); + } + __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0; + } + __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) + } + __pyx_t_23 = 0; + __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "wfpt.pyx":532 + * responses = response[split_by == s] + * xs = x[split_by == s] + * s_size = xs.shape[0] # <<<<<<<<<<<<<< + * qs[0] = q + * qs[1] = q + */ + __Pyx_TraceLine(532,0,__PYX_ERR(0, 532, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_v_s_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":533 + * xs = x[split_by == s] + * s_size = xs.shape[0] + * qs[0] = q # <<<<<<<<<<<<<< + * qs[1] = q + * + */ + __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error)) + __pyx_t_17 = 0; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":534 + * s_size = xs.shape[0] + * qs[0] = q + * qs[1] = q # <<<<<<<<<<<<<< + * + * responses_qs = responses + */ + __Pyx_TraceLine(534,0,__PYX_ERR(0, 534, __pyx_L1_error)) + __pyx_t_17 = 1; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; + + /* "wfpt.pyx":536 + * qs[1] = q + * + * responses_qs = responses # <<<<<<<<<<<<<< + * responses_qs[responses_qs == -1] = 0 + * + */ + __Pyx_TraceLine(536,0,__PYX_ERR(0, 536, __pyx_L1_error)) + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_responses), &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses_qs, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19); + } + __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0; + } + __pyx_pybuffernd_responses_qs.diminfo[0].strides = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses_qs.diminfo[0].shape = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 536, __pyx_L1_error) + } + __Pyx_INCREF((PyObject *)__pyx_v_responses); + __Pyx_XDECREF_SET(__pyx_v_responses_qs, ((PyArrayObject *)__pyx_v_responses)); + + /* "wfpt.pyx":537 + * + * responses_qs = responses + * responses_qs[responses_qs == -1] = 0 # <<<<<<<<<<<<<< + * + * # loop through all trials in current condition + */ + __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error)) + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_responses_qs), __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_responses_qs), __pyx_t_4, __pyx_int_0) < 0))) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":540 + * + * # loop through all trials in current condition + * for i in range(0, s_size): # <<<<<<<<<<<<<< + * tp_scale = data[cumm_s_size + i, 0] + * if tp_scale < 0: + */ + __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error)) + __pyx_t_14 = __pyx_v_s_size; + __pyx_t_24 = __pyx_t_14; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_i = __pyx_t_25; + + /* "wfpt.pyx":541 + * # loop through all trials in current condition + * for i in range(0, s_size): + * tp_scale = data[cumm_s_size + i, 0] # <<<<<<<<<<<<<< + * if tp_scale < 0: + * return -np.inf + */ + __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error)) + __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); + __pyx_t_26 = 0; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_tp_scale, __pyx_t_4); + __pyx_t_4 = 0; + + /* "wfpt.pyx":542 + * for i in range(0, s_size): + * tp_scale = data[cumm_s_size + i, 0] + * if tp_scale < 0: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error)) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_tp_scale, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_11) { + + /* "wfpt.pyx":543 + * tp_scale = data[cumm_s_size + i, 0] + * if tp_scale < 0: + * return -np.inf # <<<<<<<<<<<<<< + * + * data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale + */ + __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":542 + * for i in range(0, s_size): + * tp_scale = data[cumm_s_size + i, 0] + * if tp_scale < 0: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":545 + * return -np.inf + * + * data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale # <<<<<<<<<<<<<< + * + * # Check for boundary violations -- if true, return -np.inf + */ + __Pyx_TraceLine(545,0,__PYX_ERR(0, 545, __pyx_L1_error)) + __pyx_t_26 = 1; + __pyx_t_17 = 0; + __pyx_t_4 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_v_tp_scale); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_27 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_27 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); + __pyx_t_26 = 0; + *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[1].strides) = __pyx_t_27; + + /* "wfpt.pyx":548 + * + * # Check for boundary violations -- if true, return -np.inf + * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error)) + __pyx_t_26 = (__pyx_v_cumm_s_size + __pyx_v_i); + __pyx_t_17 = 0; + __pyx_t_6 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[1].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_10) { + } else { + __pyx_t_11 = __pyx_t_10; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); + __pyx_t_26 = 0; + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = __pyx_t_10; + __pyx_L16_bool_binop_done:; + if (__pyx_t_11) { + + /* "wfpt.pyx":549 + * # Check for boundary violations -- if true, return -np.inf + * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: + * return -np.inf # <<<<<<<<<<<<<< + * + * rl_alpha = rl_arr[cumm_s_size + i, 0] + */ + __Pyx_TraceLine(549,0,__PYX_ERR(0, 549, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":548 + * + * # Check for boundary violations -- if true, return -np.inf + * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< + * return -np.inf + * + */ + } + + /* "wfpt.pyx":551 + * return -np.inf + * + * rl_alpha = rl_arr[cumm_s_size + i, 0] # <<<<<<<<<<<<<< + * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) + * + */ + __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error)) + __pyx_t_26 = (__pyx_v_cumm_s_size + __pyx_v_i); + __pyx_t_17 = 0; + __pyx_v_rl_alpha = (*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rl_arr.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_rl_arr.diminfo[1].strides)); + + /* "wfpt.pyx":552 + * + * rl_alpha = rl_arr[cumm_s_size + i, 0] + * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< + * + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ + */ + __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error)) + __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); + + /* "wfpt.pyx":554 + * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) + * + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[i] - qs[responses_qs[i]]) + * cumm_s_size += s_size + */ + __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error)) + __pyx_t_17 = __pyx_v_i; + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + + /* "wfpt.pyx":555 + * + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ + * alfa * (feedbacks[i] - qs[responses_qs[i]]) # <<<<<<<<<<<<<< + * cumm_s_size += s_size + * + */ + __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error)) + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + + /* "wfpt.pyx":554 + * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) + * + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< + * alfa * (feedbacks[i] - qs[responses_qs[i]]) + * cumm_s_size += s_size + */ + __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error)) + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides))))); + } + + /* "wfpt.pyx":556 + * qs[responses_qs[i]] = qs[responses_qs[i]] + \ + * alfa * (feedbacks[i] - qs[responses_qs[i]]) + * cumm_s_size += s_size # <<<<<<<<<<<<<< + * + * # Call to network: + */ + __Pyx_TraceLine(556,0,__PYX_ERR(0, 556, __pyx_L1_error)) + __pyx_v_cumm_s_size = (__pyx_v_cumm_s_size + __pyx_v_s_size); + } + + /* "wfpt.pyx":559 + * + * # Call to network: + * if p_outlier == 0: # <<<<<<<<<<<<<< + * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) + * else: + */ + __Pyx_TraceLine(559,0,__PYX_ERR(0, 559, __pyx_L1_error)) + __pyx_t_11 = (__pyx_v_p_outlier == 0.0); + if (__pyx_t_11) { + + /* "wfpt.pyx":560 + * # Call to network: + * if p_outlier == 0: + * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) # <<<<<<<<<<<<<< + * else: + * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + */ + __Pyx_TraceLine(560,0,__PYX_ERR(0, 560, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_umath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_maximum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_34 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_33))) { + __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_33); + if (likely(__pyx_t_34)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); + __Pyx_INCREF(__pyx_t_34); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_33, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_34, ((PyObject *)__pyx_v_data_copy)}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + } + __pyx_t_33 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_34 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_34)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_34); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_34, __pyx_t_2, __pyx_t_33}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_3 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_sum_logp = __pyx_t_35; + + /* "wfpt.pyx":559 + * + * # Call to network: + * if p_outlier == 0: # <<<<<<<<<<<<<< + * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) + * else: + */ + goto __pyx_L18; + } + + /* "wfpt.pyx":562 + * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) + * else: + * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< + * + * return sum_logp + */ + __Pyx_TraceLine(562,0,__PYX_ERR(0, 562, __pyx_L1_error)) + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_34); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_36); + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_core); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_37); + __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_umath); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_36); + __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_maximum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_37); + __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_39 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_38))) { + __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_38); + if (likely(__pyx_t_39)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); + __Pyx_INCREF(__pyx_t_39); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_38, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_39, ((PyObject *)__pyx_v_data_copy)}; + __pyx_t_36 = __Pyx_PyObject_FastCall(__pyx_t_38, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_36); + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + } + __pyx_t_38 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_38); + __pyx_t_39 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_37))) { + __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_37); + if (likely(__pyx_t_39)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); + __Pyx_INCREF(__pyx_t_39); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_37, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_39, __pyx_t_36, __pyx_t_38}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_37, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; + } + __pyx_t_37 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) { + __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_34); + if (likely(__pyx_t_37)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34); + __Pyx_INCREF(__pyx_t_37); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_34, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_37, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_34, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; + } + __pyx_t_34 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_34); + __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_34); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; + __pyx_t_34 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_34); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_34); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; + __pyx_t_34 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) { + __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_33); + if (likely(__pyx_t_34)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); + __Pyx_INCREF(__pyx_t_34); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_33, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + } + __pyx_t_33 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_33)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_33); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_33, __pyx_t_4}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_sum_logp = __pyx_t_35; + } + __pyx_L18:; + + /* "wfpt.pyx":564 + * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + * + * return sum_logp # <<<<<<<<<<<<<< + * + * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, + */ + __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":486 + * + * + * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< + * np.ndarray[float, ndim=2] rl_arr, + * np.ndarray[double, ndim=1] x, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_33); + __Pyx_XDECREF(__pyx_t_34); + __Pyx_XDECREF(__pyx_t_36); + __Pyx_XDECREF(__pyx_t_37); + __Pyx_XDECREF(__pyx_t_38); + __Pyx_XDECREF(__pyx_t_39); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data_copy.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rl_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn_reg", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data_copy.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rl_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_qs); + __Pyx_XDECREF((PyObject *)__pyx_v_xs); + __Pyx_XDECREF((PyObject *)__pyx_v_feedbacks); + __Pyx_XDECREF((PyObject *)__pyx_v_responses); + __Pyx_XDECREF((PyObject *)__pyx_v_responses_qs); + __Pyx_XDECREF((PyObject *)__pyx_v_unique); + __Pyx_XDECREF((PyObject *)__pyx_v_data_copy); + __Pyx_XDECREF(__pyx_v_lower_bnd); + __Pyx_XDECREF(__pyx_v_upper_bnd); + __Pyx_XDECREF(__pyx_v_tp_scale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":566 + * return sum_logp + * + * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< + * double sv, double a, double z, double sz, double t, double st, double t_min, + * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_21wiener_like_contaminant(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_20wiener_like_contaminant, "wiener_like_contaminant(ndarray x, ndarray cont_x, double v, double sv, double a, double z, double sz, double t, double st, double t_min, double t_max, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8)\nWiener likelihood function where RTs could come from a\n separate, uniform contaminant distribution.\n\n Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007)\n "); +static PyMethodDef __pyx_mdef_4wfpt_21wiener_like_contaminant = {"wiener_like_contaminant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_21wiener_like_contaminant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_20wiener_like_contaminant}; +static PyObject *__pyx_pw_4wfpt_21wiener_like_contaminant(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_cont_x = 0; + double __pyx_v_v; + double __pyx_v_sv; + double __pyx_v_a; + double __pyx_v_z; + double __pyx_v_sz; + double __pyx_v_t; + double __pyx_v_st; + double __pyx_v_t_min; + double __pyx_v_t_max; + double __pyx_v_err; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_contaminant (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_cont_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_t_min,&__pyx_n_s_t_max,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cont_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 1); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 2); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 3); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 4); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 5); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 6); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 7); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 8); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_min)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 9); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_max)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 10); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 11); __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[12] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[13] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[14] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[15] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_contaminant") < 0)) __PYX_ERR(0, 566, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_cont_x = ((PyArrayObject *)values[1]); + __pyx_v_v = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_t_min = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_t_min == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_t_max = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_t_max == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + if (values[12]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)10)); + } + if (values[13]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)10)); + } + if (values[14]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[15]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-8)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, __pyx_nargs); __PYX_ERR(0, 566, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_contaminant", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cont_x), __pyx_ptype_5numpy_ndarray, 1, "cont_x", 0))) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_20wiener_like_contaminant(__pyx_self, __pyx_v_x, __pyx_v_cont_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_t_min, __pyx_v_t_max, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_cont_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_t_min, double __pyx_v_t_max, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err) { + CYTHON_UNUSED Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + double __pyx_v_p; + double __pyx_v_sum_logp; + int __pyx_v_n_cont; + CYTHON_UNUSED int __pyx_v_pos_cont; + __Pyx_LocalBuf_ND __pyx_pybuffernd_cont_x; + __Pyx_Buffer __pyx_pybuffer_cont_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + double __pyx_t_11; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__15) + __Pyx_RefNannySetupContext("wiener_like_contaminant", 0); + __Pyx_TraceCall("wiener_like_contaminant", __pyx_f[0], 566, 0, __PYX_ERR(0, 566, __pyx_L1_error)); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_cont_x.pybuffer.buf = NULL; + __pyx_pybuffer_cont_x.refcount = 0; + __pyx_pybuffernd_cont_x.data = NULL; + __pyx_pybuffernd_cont_x.rcbuffer = &__pyx_pybuffer_cont_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 566, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cont_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_cont_x, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 566, __pyx_L1_error) + } + __pyx_pybuffernd_cont_x.diminfo[0].strides = __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cont_x.diminfo[0].shape = __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":575 + * Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007) + * """ + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef double p + */ + __Pyx_TraceLine(575,0,__PYX_ERR(0, 575, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":578 + * cdef Py_ssize_t i + * cdef double p + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef int n_cont = np.sum(cont_x) + * cdef int pos_cont = 0 + */ + __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":579 + * cdef double p + * cdef double sum_logp = 0 + * cdef int n_cont = np.sum(cont_x) # <<<<<<<<<<<<<< + * cdef int pos_cont = 0 + * + */ + __Pyx_TraceLine(579,0,__PYX_ERR(0, 579, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_cont_x)}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n_cont = __pyx_t_5; + + /* "wfpt.pyx":580 + * cdef double sum_logp = 0 + * cdef int n_cont = np.sum(cont_x) + * cdef int pos_cont = 0 # <<<<<<<<<<<<<< + * + * for i in prange(size, nogil=True): + */ + __Pyx_TraceLine(580,0,__PYX_ERR(0, 580, __pyx_L1_error)) + __pyx_v_pos_cont = 0; + + /* "wfpt.pyx":582 + * cdef int pos_cont = 0 + * + * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< + * if cont_x[i] == 0: + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + */ + __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error)) + { + #ifdef WITH_THREAD + PyThreadState *_save; + _save = NULL; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_6 = __pyx_v_size; + { + Py_ssize_t __pyx_parallel_temp0 = ((Py_ssize_t)0xbad0bad0); + double __pyx_parallel_temp1 = ((double)__PYX_NAN()); + double __pyx_parallel_temp2 = ((double)__PYX_NAN()); + const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0; + PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL; + int __pyx_parallel_why; + __pyx_parallel_why = 0; + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_8 > 0) + { + #ifdef _OPENMP + #pragma omp parallel reduction(+:__pyx_v_sum_logp) private(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_9) firstprivate(__pyx_t_2, __pyx_t_4) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + Py_BEGIN_ALLOW_THREADS + #endif /* _OPENMP */ + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_p) + #endif /* _OPENMP */ + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ + if (__pyx_parallel_why < 2) + { + __pyx_v_i = (Py_ssize_t)(0 + 1 * __pyx_t_7); + /* Initialize private variables to invalid values */ + __pyx_v_p = ((double)__PYX_NAN()); + + /* "wfpt.pyx":583 + * + * for i in prange(size, nogil=True): + * if cont_x[i] == 0: # <<<<<<<<<<<<<< + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) + */ + __Pyx_TraceLine(583,1,__PYX_ERR(0, 583, __pyx_L8_error)) + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = ((*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_cont_x.diminfo[0].strides)) == 0); + if (__pyx_t_10) { + + /* "wfpt.pyx":584 + * for i in prange(size, nogil=True): + * if cont_x[i] == 0: + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< + * n_st, n_sz, use_adaptive, simps_err) + * if p == 0: + */ + __Pyx_TraceLine(584,1,__PYX_ERR(0, 584, __pyx_L8_error)) + __pyx_t_9 = __pyx_v_i; + + /* "wfpt.pyx":585 + * if cont_x[i] == 0: + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< + * if p == 0: + * with gil: + */ + __Pyx_TraceLine(585,1,__PYX_ERR(0, 585, __pyx_L8_error)) + __pyx_t_12.__pyx_n = 4; + __pyx_t_12.n_st = __pyx_v_n_st; + __pyx_t_12.n_sz = __pyx_v_n_sz; + __pyx_t_12.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_12.simps_err = __pyx_v_simps_err; + __pyx_t_11 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_12); if (unlikely(__pyx_t_11 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 584, __pyx_L8_error) + __pyx_v_p = __pyx_t_11; + + /* "wfpt.pyx":586 + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) + * if p == 0: # <<<<<<<<<<<<<< + * with gil: + * return -np.inf + */ + __Pyx_TraceLine(586,1,__PYX_ERR(0, 586, __pyx_L8_error)) + __pyx_t_10 = (__pyx_v_p == 0.0); + if (__pyx_t_10) { + + /* "wfpt.pyx":587 + * n_st, n_sz, use_adaptive, simps_err) + * if p == 0: + * with gil: # <<<<<<<<<<<<<< + * return -np.inf + * sum_logp += log(p) + */ + __Pyx_TraceLine(587,1,__PYX_ERR(0, 587, __pyx_L8_error)) + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { + + /* "wfpt.pyx":588 + * if p == 0: + * with gil: + * return -np.inf # <<<<<<<<<<<<<< + * sum_logp += log(p) + * # If one probability = 0, the log sum will be -Inf + */ + __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L15_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L14_return; + } + + /* "wfpt.pyx":587 + * n_st, n_sz, use_adaptive, simps_err) + * if p == 0: + * with gil: # <<<<<<<<<<<<<< + * return -np.inf + * sum_logp += log(p) + */ + __Pyx_TraceLine(587,0,__PYX_ERR(0, 587, __pyx_L15_error)) + /*finally:*/ { + __pyx_L14_return: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L9_return; + } + __pyx_L15_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8_error; + } + } + } + + /* "wfpt.pyx":586 + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) + * if p == 0: # <<<<<<<<<<<<<< + * with gil: + * return -np.inf + */ + } + + /* "wfpt.pyx":589 + * with gil: + * return -np.inf + * sum_logp += log(p) # <<<<<<<<<<<<<< + * # If one probability = 0, the log sum will be -Inf + * + */ + __Pyx_TraceLine(589,1,__PYX_ERR(0, 589, __pyx_L8_error)) + __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); + + /* "wfpt.pyx":583 + * + * for i in prange(size, nogil=True): + * if cont_x[i] == 0: # <<<<<<<<<<<<<< + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + * n_st, n_sz, use_adaptive, simps_err) + */ + } + goto __pyx_L18; + __pyx_L9_return:; + __pyx_parallel_why = 3; + goto __pyx_L17; + __pyx_L8_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + #ifdef _OPENMP + #pragma omp flush(__pyx_parallel_exc_type) + #endif /* _OPENMP */ + if (!__pyx_parallel_exc_type) { + __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb); + __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno; + __Pyx_GOTREF(__pyx_parallel_exc_type); + } + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_parallel_why = 4; + goto __pyx_L17; + __pyx_L17:; + #ifdef _OPENMP + #pragma omp critical(__pyx_parallel_lastprivates1) + #endif /* _OPENMP */ + { + __pyx_parallel_temp0 = __pyx_v_i; + __pyx_parallel_temp1 = __pyx_v_p; + __pyx_parallel_temp2 = __pyx_v_sum_logp; + } + __pyx_L18:; + #ifdef _OPENMP + #pragma omp flush(__pyx_parallel_why) + #endif /* _OPENMP */ + } + } + #ifdef _OPENMP + Py_END_ALLOW_THREADS + #else +{ +#ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + #endif /* _OPENMP */ + /* Clean up any temporaries */ + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + #ifndef _OPENMP +} +#endif /* _OPENMP */ + } + } + if (__pyx_parallel_exc_type) { + /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */ + __pyx_parallel_why = 4; + } + if (__pyx_parallel_why) { + __pyx_v_i = __pyx_parallel_temp0; + __pyx_v_p = __pyx_parallel_temp1; + __pyx_v_sum_logp = __pyx_parallel_temp2; + switch (__pyx_parallel_why) { + case 4: + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_GIVEREF(__pyx_parallel_exc_type); + __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); + __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + goto __pyx_L4_error; + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "wfpt.pyx":582 + * cdef int pos_cont = 0 + * + * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< + * if cont_x[i] == 0: + * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + */ + __Pyx_TraceLine(582,1,__PYX_ERR(0, 582, __pyx_L4_error)) + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L4_error: { + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L1_error; + } + __pyx_L5:; + } + } + + /* "wfpt.pyx":593 + * + * # add the log likelihood of the contaminations + * sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) # <<<<<<<<<<<<<< + * + * return sum_logp + */ + __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error)) + __pyx_v_sum_logp = (__pyx_v_sum_logp + (__pyx_v_n_cont * log(((0.5 * 1.) / (__pyx_v_t_max - __pyx_v_t_min))))); + + /* "wfpt.pyx":595 + * sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) + * + * return sum_logp # <<<<<<<<<<<<<< + * + * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, + */ + __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":566 + * return sum_logp + * + * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< + * double sv, double a, double z, double sz, double t, double st, double t_min, + * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cont_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_contaminant", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cont_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":597 + * return sum_logp + * + * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< + * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_23gen_cdf_using_pdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_22gen_cdf_using_pdf, "gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, int N=500, double time=5., int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)\n\n generate cdf vector using the pdf\n "); +static PyMethodDef __pyx_mdef_4wfpt_23gen_cdf_using_pdf = {"gen_cdf_using_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_23gen_cdf_using_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_22gen_cdf_using_pdf}; +static PyObject *__pyx_pw_4wfpt_23gen_cdf_using_pdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + double __pyx_v_v; + double __pyx_v_sv; + double __pyx_v_a; + double __pyx_v_z; + double __pyx_v_sz; + double __pyx_v_t; + double __pyx_v_st; + double __pyx_v_err; + int __pyx_v_N; + double __pyx_v_time; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("gen_cdf_using_pdf (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_N,&__pyx_n_s_time,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 1); __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 2); __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 3); __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 4); __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 5); __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 6); __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 7); __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_N); + if (value) { values[8] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time); + if (value) { values[9] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[10] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[11] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[12] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[13] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[14] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[15] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gen_cdf_using_pdf") < 0)) __PYX_ERR(0, 597, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_v = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (values[8]) { + __pyx_v_N = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + } else { + __pyx_v_N = ((int)((int)0x1F4)); + } + if (values[9]) { + __pyx_v_time = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + } else { + __pyx_v_time = ((double)((double)5.)); + } + if (values[10]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)2)); + } + if (values[11]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)2)); + } + if (values[12]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[13]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-3)); + } + if (values[14]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[15]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, __pyx_nargs); __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.gen_cdf_using_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4wfpt_22gen_cdf_using_pdf(__pyx_self, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_N, __pyx_v_time, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_N, double __pyx_v_time, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_cdf_array = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_cdf_array; + __Pyx_Buffer __pyx_pybuffer_cdf_array; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyArrayObject *__pyx_t_11 = NULL; + npy_intp *__pyx_t_12; + PyArrayObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + PyObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + npy_intp __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__16) + __Pyx_RefNannySetupContext("gen_cdf_using_pdf", 0); + __Pyx_TraceCall("gen_cdf_using_pdf", __pyx_f[0], 597, 0, __PYX_ERR(0, 597, __pyx_L1_error)); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_cdf_array.pybuffer.buf = NULL; + __pyx_pybuffer_cdf_array.refcount = 0; + __pyx_pybuffernd_cdf_array.data = NULL; + __pyx_pybuffernd_cdf_array.rcbuffer = &__pyx_pybuffer_cdf_array; + + /* "wfpt.pyx":603 + * generate cdf vector using the pdf + * """ + * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< + * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError( + */ + __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error)) + __pyx_t_2 = (__pyx_v_sv < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_a <= 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_z < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_z > 1.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_sz < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_sz > 1.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_z + (__pyx_v_sz / 2.)) > 1.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "wfpt.pyx":604 + * """ + * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ + * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< + * raise ValueError( + * "at least one of the parameters is out of the support") + */ + __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error)) + __pyx_t_2 = ((__pyx_v_z - (__pyx_v_sz / 2.)) < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_t - (__pyx_v_st / 2.)) < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_t < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_st < 0.0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_3 = (!__pyx_t_2); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + + /* "wfpt.pyx":603 + * generate cdf vector using the pdf + * """ + * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< + * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError( + */ + __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error)) + if (unlikely(__pyx_t_1)) { + + /* "wfpt.pyx":605 + * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ + * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError( # <<<<<<<<<<<<<< + * "at least one of the parameters is out of the support") + * + */ + __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 605, __pyx_L1_error) + + /* "wfpt.pyx":603 + * generate cdf vector using the pdf + * """ + * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< + * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError( + */ + } + + /* "wfpt.pyx":608 + * "at least one of the parameters is out of the support") + * + * cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) + * cdef int idx + */ + __Pyx_TraceLine(608,0,__PYX_ERR(0, 608, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble((-__pyx_v_time)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_long(((2 * __pyx_v_N) + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_10 = 1; + } + } + { + PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_5, __pyx_t_7, __pyx_t_8}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_x = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 608, __pyx_L1_error) + } else {__pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_11 = 0; + __pyx_v_x = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "wfpt.pyx":609 + * + * cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) + * cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) # <<<<<<<<<<<<<< + * cdef int idx + * + */ + __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t((__pyx_t_12[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_13 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_cdf_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 609, __pyx_L1_error) + } else {__pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_13 = 0; + __pyx_v_cdf_array = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "wfpt.pyx":613 + * + * # compute pdf on the real line + * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, # <<<<<<<<<<<<<< + * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) + * + */ + __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pdf_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_sv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyFloat_FromDouble(__pyx_v_z); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = PyFloat_FromDouble(__pyx_v_sz); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyFloat_FromDouble(__pyx_v_st); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = PyFloat_FromDouble(__pyx_v_err); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + + /* "wfpt.pyx":614 + * # compute pdf on the real line + * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, + * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) # <<<<<<<<<<<<<< + * + * # integrate + */ + __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error)) + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_n_st); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_n_sz); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = __Pyx_PyBool_FromLong(__pyx_v_use_adaptive); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_21 = PyFloat_FromDouble(__pyx_v_simps_err); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_22 = PyFloat_FromDouble(__pyx_v_p_outlier); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_22); + __pyx_t_23 = PyFloat_FromDouble(__pyx_v_w_outlier); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __pyx_t_24 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_10 = 1; + } + } + { + PyObject *__pyx_callargs[17] = {__pyx_t_24, ((PyObject *)__pyx_v_x), __pyx_t_8, __pyx_t_6, __pyx_t_7, __pyx_t_9, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_int_0, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 16+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "wfpt.pyx":613 + * + * # compute pdf on the real line + * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, # <<<<<<<<<<<<<< + * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) + * + */ + __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error)) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_13 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_cdf_array, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27); + } + __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0; + } + __pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 613, __pyx_L1_error) + } + __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_cdf_array, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "wfpt.pyx":617 + * + * # integrate + * cdf_array[1:] = integrate.cumtrapz(cdf_array) # <<<<<<<<<<<<<< + * + * # normalize + */ + __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_integrate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cumtrapz); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_23); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_23, function); + __pyx_t_10 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_cdf_array)}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_23, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; + } + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_cdf_array), __pyx_slice__10, __pyx_t_5) < 0))) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":620 + * + * # normalize + * cdf_array /= cdf_array[x.shape[0] - 1] # <<<<<<<<<<<<<< + * + * return x, cdf_array + */ + __Pyx_TraceLine(620,0,__PYX_ERR(0, 620, __pyx_L1_error)) + __pyx_t_12 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_28 = ((__pyx_t_12[0]) - 1); + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_cdf_array.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_23 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_cdf_array), __pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_23) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_23, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_13 = ((PyArrayObject *)__pyx_t_23); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_cdf_array, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25); + } + __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0; + } + __pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 620, __pyx_L1_error) + } + __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_cdf_array, ((PyArrayObject *)__pyx_t_23)); + __pyx_t_23 = 0; + + /* "wfpt.pyx":622 + * cdf_array /= cdf_array[x.shape[0] - 1] + * + * return x, cdf_array # <<<<<<<<<<<<<< + * + * + */ + __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __Pyx_INCREF((PyObject *)__pyx_v_x); + __Pyx_GIVEREF((PyObject *)__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)__pyx_v_x)); + __Pyx_INCREF((PyObject *)__pyx_v_cdf_array); + __Pyx_GIVEREF((PyObject *)__pyx_v_cdf_array); + PyTuple_SET_ITEM(__pyx_t_23, 1, ((PyObject *)__pyx_v_cdf_array)); + __pyx_r = __pyx_t_23; + __pyx_t_23 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":597 + * return sum_logp + * + * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< + * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_22); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_XDECREF(__pyx_t_24); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.gen_cdf_using_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_cdf_array); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":625 + * + * + * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< + * + * # get length of data + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_25split_cdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_24split_cdf, "split_cdf(ndarray x, ndarray data)"); +static PyMethodDef __pyx_mdef_4wfpt_25split_cdf = {"split_cdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_25split_cdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_24split_cdf}; +static PyObject *__pyx_pw_4wfpt_25split_cdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_data = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("split_cdf (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_data,0}; + PyObject* values[2] = {0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("split_cdf", 1, 2, 2, 1); __PYX_ERR(0, 625, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "split_cdf") < 0)) __PYX_ERR(0, 625, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_data = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("split_cdf", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 625, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.split_cdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 625, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_24split_cdf(__pyx_self, __pyx_v_x, __pyx_v_data); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_data) { + int __pyx_v_N; + PyArrayObject *__pyx_v_x_lb = 0; + PyArrayObject *__pyx_v_lb = 0; + PyArrayObject *__pyx_v_x_ub = 0; + PyArrayObject *__pyx_v_ub = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_data; + __Pyx_Buffer __pyx_pybuffer_data; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lb; + __Pyx_Buffer __pyx_pybuffer_lb; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ub; + __Pyx_Buffer __pyx_pybuffer_ub; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x_lb; + __Pyx_Buffer __pyx_pybuffer_x_lb; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x_ub; + __Pyx_Buffer __pyx_pybuffer_x_ub; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyArrayObject *__pyx_t_16 = NULL; + PyArrayObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__18) + __Pyx_RefNannySetupContext("split_cdf", 0); + __Pyx_TraceCall("split_cdf", __pyx_f[0], 625, 0, __PYX_ERR(0, 625, __pyx_L1_error)); + __pyx_pybuffer_x_lb.pybuffer.buf = NULL; + __pyx_pybuffer_x_lb.refcount = 0; + __pyx_pybuffernd_x_lb.data = NULL; + __pyx_pybuffernd_x_lb.rcbuffer = &__pyx_pybuffer_x_lb; + __pyx_pybuffer_lb.pybuffer.buf = NULL; + __pyx_pybuffer_lb.refcount = 0; + __pyx_pybuffernd_lb.data = NULL; + __pyx_pybuffernd_lb.rcbuffer = &__pyx_pybuffer_lb; + __pyx_pybuffer_x_ub.pybuffer.buf = NULL; + __pyx_pybuffer_x_ub.refcount = 0; + __pyx_pybuffernd_x_ub.data = NULL; + __pyx_pybuffernd_x_ub.rcbuffer = &__pyx_pybuffer_x_ub; + __pyx_pybuffer_ub.pybuffer.buf = NULL; + __pyx_pybuffer_ub.refcount = 0; + __pyx_pybuffernd_ub.data = NULL; + __pyx_pybuffernd_ub.rcbuffer = &__pyx_pybuffer_ub; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_data.pybuffer.buf = NULL; + __pyx_pybuffer_data.refcount = 0; + __pyx_pybuffernd_data.data = NULL; + __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 625, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 625, __pyx_L1_error) + } + __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":628 + * + * # get length of data + * cdef int N = (len(data) - 1) / 2 # <<<<<<<<<<<<<< + * + * # lower bound is reversed + */ + __Pyx_TraceLine(628,0,__PYX_ERR(0, 628, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_v_N = ((__pyx_t_1 - 1) / 2); + + /* "wfpt.pyx":631 + * + * # lower bound is reversed + * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] + * # lower bound is cumulative in the wrong direction + */ + __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_lb.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_x_lb = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 631, __pyx_L1_error) + } else {__pyx_pybuffernd_x_lb.diminfo[0].strides = __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_lb.diminfo[0].shape = __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_4 = 0; + __pyx_v_x_lb = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "wfpt.pyx":632 + * # lower bound is reversed + * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] + * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] # <<<<<<<<<<<<<< + * # lower bound is cumulative in the wrong direction + * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) + */ + __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lb.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_lb = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_lb.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 632, __pyx_L1_error) + } else {__pyx_pybuffernd_lb.diminfo[0].strides = __pyx_pybuffernd_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lb.diminfo[0].shape = __pyx_pybuffernd_lb.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_5 = 0; + __pyx_v_lb = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "wfpt.pyx":634 + * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] + * # lower bound is cumulative in the wrong direction + * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) # <<<<<<<<<<<<<< + * + * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] + */ + __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_int_0); + __pyx_t_11 = NULL; + __pyx_t_12 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_12 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_diff); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_12 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_12 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_lb)}; + __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __pyx_t_11 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __pyx_t_7 = 0; + __pyx_t_11 = 0; + __pyx_t_11 = NULL; + __pyx_t_12 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_12 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_t_8 = NULL; + __pyx_t_12 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_12 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lb.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lb.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lb.rcbuffer->pybuffer, (PyObject*)__pyx_v_lb, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0; + } + __pyx_pybuffernd_lb.diminfo[0].strides = __pyx_pybuffernd_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lb.diminfo[0].shape = __pyx_pybuffernd_lb.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) + } + __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_lb, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "wfpt.pyx":636 + * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) + * + * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] + * # ub does not start at 0 + */ + __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_16 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_ub.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_x_ub = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 636, __pyx_L1_error) + } else {__pyx_pybuffernd_x_ub.diminfo[0].strides = __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_ub.diminfo[0].shape = __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_16 = 0; + __pyx_v_x_ub = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "wfpt.pyx":637 + * + * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] + * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] # <<<<<<<<<<<<<< + * # ub does not start at 0 + * ub -= ub[0] + */ + __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_17 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ub.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_ub = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ub.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 637, __pyx_L1_error) + } else {__pyx_pybuffernd_ub.diminfo[0].strides = __pyx_pybuffernd_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ub.diminfo[0].shape = __pyx_pybuffernd_ub.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_17 = 0; + __pyx_v_ub = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "wfpt.pyx":639 + * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] + * # ub does not start at 0 + * ub -= ub[0] # <<<<<<<<<<<<<< + * + * return (x_lb, lb, x_ub, ub) + */ + __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error)) + __pyx_t_18 = 0; + __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_ub.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ub.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_ub), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_17 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ub.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ub.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ub.rcbuffer->pybuffer, (PyObject*)__pyx_v_ub, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13); + } + __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0; + } + __pyx_pybuffernd_ub.diminfo[0].strides = __pyx_pybuffernd_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ub.diminfo[0].shape = __pyx_pybuffernd_ub.rcbuffer->pybuffer.shape[0]; + if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 639, __pyx_L1_error) + } + __pyx_t_17 = 0; + __Pyx_DECREF_SET(__pyx_v_ub, ((PyArrayObject *)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "wfpt.pyx":641 + * ub -= ub[0] + * + * return (x_lb, lb, x_ub, ub) # <<<<<<<<<<<<<< + * + * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, + */ + __Pyx_TraceLine(641,0,__PYX_ERR(0, 641, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF((PyObject *)__pyx_v_x_lb); + __Pyx_GIVEREF((PyObject *)__pyx_v_x_lb); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_x_lb)); + __Pyx_INCREF((PyObject *)__pyx_v_lb); + __Pyx_GIVEREF((PyObject *)__pyx_v_lb); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_lb)); + __Pyx_INCREF((PyObject *)__pyx_v_x_ub); + __Pyx_GIVEREF((PyObject *)__pyx_v_x_ub); + PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_x_ub)); + __Pyx_INCREF((PyObject *)__pyx_v_ub); + __Pyx_GIVEREF((PyObject *)__pyx_v_ub); + PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_ub)); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":625 + * + * + * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< + * + * # get length of data + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lb.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ub.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_lb.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_ub.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.split_cdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lb.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ub.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_lb.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_ub.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_x_lb); + __Pyx_XDECREF((PyObject *)__pyx_v_lb); + __Pyx_XDECREF((PyObject *)__pyx_v_x_ub); + __Pyx_XDECREF((PyObject *)__pyx_v_ub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":643 + * return (x_lb, lb, x_ub, ub) + * + * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_27wiener_like_multi_nn_mlp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_26wiener_like_multi_nn_mlp, "wiener_like_multi_nn_mlp(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); +static PyMethodDef __pyx_mdef_4wfpt_27wiener_like_multi_nn_mlp = {"wiener_like_multi_nn_mlp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_27wiener_like_multi_nn_mlp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_26wiener_like_multi_nn_mlp}; +static PyObject *__pyx_pw_4wfpt_27wiener_like_multi_nn_mlp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_data = 0; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + PyObject *__pyx_v_network = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; + PyObject* values[4] = {0,0,0,0}; + + /* "wfpt.pyx":646 + * double p_outlier = 0, + * double w_outlier = 0, + * network = None): # <<<<<<<<<<<<<< + * #**kwargs): + * + */ + values[3] = ((PyObject *)((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[1] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[2] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); + if (value) { values[3] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_nn_mlp") < 0)) __PYX_ERR(0, 643, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_data = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[2]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + __pyx_v_network = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_nn_mlp", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 643, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(__pyx_self, __pyx_v_data, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); + + /* "wfpt.pyx":643 + * return (x_lb, lb, x_ub, ub) + * + * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { + float __pyx_v_ll_min; + float __pyx_v_log_p; + __Pyx_LocalBuf_ND __pyx_pybuffernd_data; + __Pyx_Buffer __pyx_pybuffer_data; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + float __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__20) + __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp", 0); + __Pyx_TraceCall("wiener_like_multi_nn_mlp", __pyx_f[0], 643, 0, __PYX_ERR(0, 643, __pyx_L1_error)); + __pyx_pybuffer_data.pybuffer.buf = NULL; + __pyx_pybuffer_data.refcount = 0; + __pyx_pybuffernd_data.data = NULL; + __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 643, __pyx_L1_error) + } + __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; + + /* "wfpt.pyx":654 + * # (in that order) + * + * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< + * cdef float log_p + * + */ + __Pyx_TraceLine(654,0,__PYX_ERR(0, 654, __pyx_L1_error)) + __pyx_v_ll_min = -16.11809; + + /* "wfpt.pyx":658 + * + * # Call to network: + * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< + * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + */ + __Pyx_TraceLine(658,0,__PYX_ERR(0, 658, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_p_outlier == 0.0); + if (__pyx_t_1) { + + /* "wfpt.pyx":659 + * # Call to network: + * if p_outlier == 0: # previous ddm_model + * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< + * else: + * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + */ + __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_umath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_maximum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_data)}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_log_p = __pyx_t_10; + + /* "wfpt.pyx":658 + * + * # Call to network: + * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< + * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + */ + goto __pyx_L3; + } + + /* "wfpt.pyx":661 + * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< + * return log_p + * + */ + __Pyx_TraceLine(661,0,__PYX_ERR(0, 661, __pyx_L1_error)) + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_umath); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_maximum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_14, ((PyObject *)__pyx_v_data)}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __pyx_t_13 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_11, __pyx_t_13}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_t_12 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_t_8 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_log_p = __pyx_t_10; + } + __pyx_L3:; + + /* "wfpt.pyx":662 + * else: + * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + * return log_p # <<<<<<<<<<<<<< + * + * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, + */ + __Pyx_TraceLine(662,0,__PYX_ERR(0, 662, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_log_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":643 + * return (x_lb, lb, x_ub, ub) + * + * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":664 + * return log_p + * + * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_28wiener_like_multi_nn_mlp_pdf, "wiener_like_multi_nn_mlp_pdf(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); +static PyMethodDef __pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp_pdf = {"wiener_like_multi_nn_mlp_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_28wiener_like_multi_nn_mlp_pdf}; +static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_data = 0; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + PyObject *__pyx_v_network = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp_pdf (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; + PyObject* values[4] = {0,0,0,0}; + + /* "wfpt.pyx":667 + * double p_outlier = 0, + * double w_outlier = 0, + * network = None): # <<<<<<<<<<<<<< + * #**kwargs): + * + */ + values[3] = ((PyObject *)((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[1] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[2] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); + if (value) { values[3] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_nn_mlp_pdf") < 0)) __PYX_ERR(0, 664, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_data = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[2]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.0)); + } + __pyx_v_network = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_nn_mlp_pdf", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 664, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(__pyx_self, __pyx_v_data, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); + + /* "wfpt.pyx":664 + * return log_p + * + * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { + float __pyx_v_ll_min; + float __pyx_v_log_p; + __Pyx_LocalBuf_ND __pyx_pybuffernd_data; + __Pyx_Buffer __pyx_pybuffer_data; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + float __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__21) + __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp_pdf", 0); + __Pyx_TraceCall("wiener_like_multi_nn_mlp_pdf", __pyx_f[0], 664, 0, __PYX_ERR(0, 664, __pyx_L1_error)); + __pyx_pybuffer_data.pybuffer.buf = NULL; + __pyx_pybuffer_data.refcount = 0; + __pyx_pybuffernd_data.data = NULL; + __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 664, __pyx_L1_error) + } + __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; + + /* "wfpt.pyx":675 + * # (in that order) + * + * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< + * cdef float log_p + * + */ + __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L1_error)) + __pyx_v_ll_min = -16.11809; + + /* "wfpt.pyx":679 + * + * # Call to network: + * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< + * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + */ + __Pyx_TraceLine(679,0,__PYX_ERR(0, 679, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_p_outlier == 0.0); + if (__pyx_t_1) { + + /* "wfpt.pyx":680 + * # Call to network: + * if p_outlier == 0: # previous ddm_model + * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< + * else: + * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + */ + __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_umath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_maximum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_data)}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_log_p = __pyx_t_10; + + /* "wfpt.pyx":679 + * + * # Call to network: + * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< + * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + */ + goto __pyx_L3; + } + + /* "wfpt.pyx":682 + * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + * else: + * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< + * return log_p + */ + __Pyx_TraceLine(682,0,__PYX_ERR(0, 682, __pyx_L1_error)) + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_umath); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_maximum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_14, ((PyObject *)__pyx_v_data)}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __pyx_t_13 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_11, __pyx_t_13}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_t_12 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_t_8 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_log_p = __pyx_t_10; + } + __pyx_L3:; + + /* "wfpt.pyx":683 + * else: + * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + * return log_p # <<<<<<<<<<<<<< + */ + __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_log_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":664 + * return log_p + * + * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 1}, + {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0}, + {&__pyx_n_s__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 1, 1}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_u_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 1, 0, 1}, + {&__pyx_n_s_alfa, __pyx_k_alfa, sizeof(__pyx_k_alfa), 0, 0, 1, 1}, + {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, + {&__pyx_n_u_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 1, 0, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_kp_u_at_least_one_of_the_parameters_i, __pyx_k_at_least_one_of_the_parameters_i, sizeof(__pyx_k_at_least_one_of_the_parameters_i), 0, 1, 0, 0}, + {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, + {&__pyx_n_s_cdf_array, __pyx_k_cdf_array, sizeof(__pyx_k_cdf_array), 0, 0, 1, 1}, + {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, + {&__pyx_n_s_cont_x, __pyx_k_cont_x, sizeof(__pyx_k_cont_x), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_core, __pyx_k_core, sizeof(__pyx_k_core), 0, 0, 1, 1}, + {&__pyx_n_s_cumm_s_size, __pyx_k_cumm_s_size, sizeof(__pyx_k_cumm_s_size), 0, 0, 1, 1}, + {&__pyx_n_s_cumsum, __pyx_k_cumsum, sizeof(__pyx_k_cumsum), 0, 0, 1, 1}, + {&__pyx_n_s_cumtrapz, __pyx_k_cumtrapz, sizeof(__pyx_k_cumtrapz), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_data_copy, __pyx_k_data_copy, sizeof(__pyx_k_data_copy), 0, 0, 1, 1}, + {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, + {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, + {&__pyx_n_s_drift, __pyx_k_drift, sizeof(__pyx_k_drift), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, + {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1}, + {&__pyx_n_s_feedback, __pyx_k_feedback, sizeof(__pyx_k_feedback), 0, 0, 1, 1}, + {&__pyx_n_s_feedbacks, __pyx_k_feedbacks, sizeof(__pyx_k_feedbacks), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_full_pdf, __pyx_k_full_pdf, sizeof(__pyx_k_full_pdf), 0, 0, 1, 1}, + {&__pyx_n_s_gen_cdf_using_pdf, __pyx_k_gen_cdf_using_pdf, sizeof(__pyx_k_gen_cdf_using_pdf), 0, 0, 1, 1}, + {&__pyx_kp_s_hddm_wfpt_pdf_pxi, __pyx_k_hddm_wfpt_pdf_pxi, sizeof(__pyx_k_hddm_wfpt_pdf_pxi), 0, 0, 1, 0}, + {&__pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_k_hddm_wfpt_wfpt_pyx, sizeof(__pyx_k_hddm_wfpt_wfpt_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i_p, __pyx_k_i_p, sizeof(__pyx_k_i_p), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_ij, __pyx_k_ij, sizeof(__pyx_k_ij), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_integrate, __pyx_k_integrate, sizeof(__pyx_k_integrate), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_lb, __pyx_k_lb, sizeof(__pyx_k_lb), 0, 0, 1, 1}, + {&__pyx_n_s_linspace, __pyx_k_linspace, sizeof(__pyx_k_linspace), 0, 0, 1, 1}, + {&__pyx_n_s_ll_min, __pyx_k_ll_min, sizeof(__pyx_k_ll_min), 0, 0, 1, 1}, + {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1}, + {&__pyx_n_s_log_p, __pyx_k_log_p, sizeof(__pyx_k_log_p), 0, 0, 1, 1}, + {&__pyx_n_s_logp, __pyx_k_logp, sizeof(__pyx_k_logp), 0, 0, 1, 1}, + {&__pyx_n_s_lower_bnd, __pyx_k_lower_bnd, sizeof(__pyx_k_lower_bnd), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1}, + {&__pyx_n_s_multi, __pyx_k_multi, sizeof(__pyx_k_multi), 0, 0, 1, 1}, + {&__pyx_n_s_n_cont, __pyx_k_n_cont, sizeof(__pyx_k_n_cont), 0, 0, 1, 1}, + {&__pyx_n_s_n_params, __pyx_k_n_params, sizeof(__pyx_k_n_params), 0, 0, 1, 1}, + {&__pyx_n_s_n_st, __pyx_k_n_st, sizeof(__pyx_k_n_st), 0, 0, 1, 1}, + {&__pyx_n_s_n_sz, __pyx_k_n_sz, sizeof(__pyx_k_n_sz), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_network, __pyx_k_network, sizeof(__pyx_k_network), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, + {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, + {&__pyx_n_s_p_outlier, __pyx_k_p_outlier, sizeof(__pyx_k_p_outlier), 0, 0, 1, 1}, + {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1}, + {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, + {&__pyx_n_s_params_bnds, __pyx_k_params_bnds, sizeof(__pyx_k_params_bnds), 0, 0, 1, 1}, + {&__pyx_n_s_params_iter, __pyx_k_params_iter, sizeof(__pyx_k_params_iter), 0, 0, 1, 1}, + {&__pyx_n_s_params_rl, __pyx_k_params_rl, sizeof(__pyx_k_params_rl), 0, 0, 1, 1}, + {&__pyx_n_s_params_ssm, __pyx_k_params_ssm, sizeof(__pyx_k_params_ssm), 0, 0, 1, 1}, + {&__pyx_n_s_pdf_array, __pyx_k_pdf_array, sizeof(__pyx_k_pdf_array), 0, 0, 1, 1}, + {&__pyx_n_s_pos_alfa, __pyx_k_pos_alfa, sizeof(__pyx_k_pos_alfa), 0, 0, 1, 1}, + {&__pyx_n_s_pos_alpha, __pyx_k_pos_alpha, sizeof(__pyx_k_pos_alpha), 0, 0, 1, 1}, + {&__pyx_n_s_pos_cont, __pyx_k_pos_cont, sizeof(__pyx_k_pos_cont), 0, 0, 1, 1}, + {&__pyx_n_s_predict_on_batch, __pyx_k_predict_on_batch, sizeof(__pyx_k_predict_on_batch), 0, 0, 1, 1}, + {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, + {&__pyx_n_s_qs, __pyx_k_qs, sizeof(__pyx_k_qs), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1}, + {&__pyx_n_s_responses, __pyx_k_responses, sizeof(__pyx_k_responses), 0, 0, 1, 1}, + {&__pyx_n_s_responses_qs, __pyx_k_responses_qs, sizeof(__pyx_k_responses_qs), 0, 0, 1, 1}, + {&__pyx_n_s_rl_alpha, __pyx_k_rl_alpha, sizeof(__pyx_k_rl_alpha), 0, 0, 1, 1}, + {&__pyx_n_s_rl_arr, __pyx_k_rl_arr, sizeof(__pyx_k_rl_arr), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_n_s_s_size, __pyx_k_s_size, sizeof(__pyx_k_s_size), 0, 0, 1, 1}, + {&__pyx_n_s_scipy, __pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 0, 1, 1}, + {&__pyx_n_s_scipy_integrate, __pyx_k_scipy_integrate, sizeof(__pyx_k_scipy_integrate), 0, 0, 1, 1}, + {&__pyx_n_s_simps_err, __pyx_k_simps_err, sizeof(__pyx_k_simps_err), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_split_by, __pyx_k_split_by, sizeof(__pyx_k_split_by), 0, 0, 1, 1}, + {&__pyx_n_s_split_cdf, __pyx_k_split_cdf, sizeof(__pyx_k_split_cdf), 0, 0, 1, 1}, + {&__pyx_n_s_squeeze, __pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 0, 1, 1}, + {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, + {&__pyx_n_u_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 1, 0, 1}, + {&__pyx_n_s_stack, __pyx_k_stack, sizeof(__pyx_k_stack), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_sum_logp, __pyx_k_sum_logp, sizeof(__pyx_k_sum_logp), 0, 0, 1, 1}, + {&__pyx_n_s_sv, __pyx_k_sv, sizeof(__pyx_k_sv), 0, 0, 1, 1}, + {&__pyx_n_u_sv, __pyx_k_sv, sizeof(__pyx_k_sv), 0, 1, 0, 1}, + {&__pyx_n_s_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 0, 1, 1}, + {&__pyx_n_u_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 1, 0, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_u_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 1, 0, 1}, + {&__pyx_n_s_t_max, __pyx_k_t_max, sizeof(__pyx_k_t_max), 0, 0, 1, 1}, + {&__pyx_n_s_t_min, __pyx_k_t_min, sizeof(__pyx_k_t_min), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_tile, __pyx_k_tile, sizeof(__pyx_k_tile), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_tp_scale, __pyx_k_tp_scale, sizeof(__pyx_k_tp_scale), 0, 0, 1, 1}, + {&__pyx_n_s_ub, __pyx_k_ub, sizeof(__pyx_k_ub), 0, 0, 1, 1}, + {&__pyx_n_s_umath, __pyx_k_umath, sizeof(__pyx_k_umath), 0, 0, 1, 1}, + {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1}, + {&__pyx_n_s_upper_bnd, __pyx_k_upper_bnd, sizeof(__pyx_k_upper_bnd), 0, 0, 1, 1}, + {&__pyx_n_s_use_adaptive, __pyx_k_use_adaptive, sizeof(__pyx_k_use_adaptive), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_u_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 1, 0, 1}, + {&__pyx_n_s_w_outlier, __pyx_k_w_outlier, sizeof(__pyx_k_w_outlier), 0, 0, 1, 1}, + {&__pyx_n_s_wfpt, __pyx_k_wfpt, sizeof(__pyx_k_wfpt), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like, __pyx_k_wiener_like, sizeof(__pyx_k_wiener_like), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_contaminant, __pyx_k_wiener_like_contaminant, sizeof(__pyx_k_wiener_like_contaminant), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_multi, __pyx_k_wiener_like_multi, sizeof(__pyx_k_wiener_like_multi), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_multi_nn_mlp, __pyx_k_wiener_like_multi_nn_mlp, sizeof(__pyx_k_wiener_like_multi_nn_mlp), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_multi_nn_mlp_pdf, __pyx_k_wiener_like_multi_nn_mlp_pdf, sizeof(__pyx_k_wiener_like_multi_nn_mlp_pdf), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_multi_rlddm, __pyx_k_wiener_like_multi_rlddm, sizeof(__pyx_k_wiener_like_multi_rlddm), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_rl, __pyx_k_wiener_like_rl, sizeof(__pyx_k_wiener_like_rl), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_rlddm, __pyx_k_wiener_like_rlddm, sizeof(__pyx_k_wiener_like_rlddm), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_rlssm_nn, __pyx_k_wiener_like_rlssm_nn, sizeof(__pyx_k_wiener_like_rlssm_nn), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_like_rlssm_nn_reg, __pyx_k_wiener_like_rlssm_nn_reg, sizeof(__pyx_k_wiener_like_rlssm_nn_reg), 0, 0, 1, 1}, + {&__pyx_n_s_wiener_logp_array, __pyx_k_wiener_logp_array, sizeof(__pyx_k_wiener_logp_array), 0, 0, 1, 1}, + {&__pyx_n_s_wp_outlier, __pyx_k_wp_outlier, sizeof(__pyx_k_wp_outlier), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_x_lb, __pyx_k_x_lb, sizeof(__pyx_k_x_lb), 0, 0, 1, 1}, + {&__pyx_n_s_x_ub, __pyx_k_x_ub, sizeof(__pyx_k_x_ub), 0, 0, 1, 1}, + {&__pyx_n_s_xs, __pyx_k_xs, sizeof(__pyx_k_xs), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, + {&__pyx_n_u_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 1, 0, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 605, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 983, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "wfpt.pyx":101 + * + * if not p_outlier_in_range(p_outlier): + * logp[:] = -np.inf # <<<<<<<<<<<<<< + * return logp + * + */ + __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__7); + __Pyx_GIVEREF(__pyx_slice__7); + + /* "wfpt.pyx":308 + * + * + * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) # <<<<<<<<<<<<<< + * data[:, n_params:] = np.stack([x, response], axis = 1) + * + */ + __pyx_slice__10 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__10); + __Pyx_GIVEREF(__pyx_slice__10); + + /* "wfpt.pyx":605 + * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ + * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): + * raise ValueError( # <<<<<<<<<<<<<< + * "at least one of the parameters is out of the support") + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_at_least_one_of_the_parameters_i); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "wfpt.pyx":631 + * + * # lower bound is reversed + * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] # <<<<<<<<<<<<<< + * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] + * # lower bound is cumulative in the wrong direction + */ + __pyx_slice__19 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__19); + __Pyx_GIVEREF(__pyx_slice__19); + + /* "wfpt.pyx":19 + * #from hddm.model_config import model_config + * + * import scipy.integrate as integrate # <<<<<<<<<<<<<< + * from copy import copy + * import numpy as np + */ + __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_scipy, __pyx_n_s_integrate); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "hddm_wfpt/pdf.pxi":104 + * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) + * + * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< + * z, double sz, double t, double st, double err, int + * n_st=2, int n_sz=2, bint use_adaptive=1, double + */ + __pyx_tuple__25 = PyTuple_Pack(13, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(13, 0, 0, 13, 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_hddm_wfpt_pdf_pxi, __pyx_n_s_full_pdf, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(2, 104, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(4, __pyx_int_2, __pyx_int_2, __pyx_int_1, __pyx_float_1eneg_3); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "wfpt.pyx":32 + * include 'integrate.pxi' + * + * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< + * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, + * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): + */ + __pyx_tuple__27 = PyTuple_Pack(19, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_logp, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_y); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_pdf_array, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 32, __pyx_L1_error) + + /* "wfpt.pyx":54 + * + * + * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0.1): + */ + __pyx_tuple__28 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 54, __pyx_L1_error) + + /* "wfpt.pyx":78 + * return sum_logp + * + * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] v, + * np.ndarray[double, ndim=1] sv, + */ + __pyx_tuple__29 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_logp, __pyx_n_s_p, __pyx_n_s_wp_outlier); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 20, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_logp_array, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 78, __pyx_L1_error) + + /* "wfpt.pyx":128 + * return logp + * + * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + __pyx_tuple__30 = PyTuple_Pack(36, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_alpha, __pyx_n_s_pos_alpha, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_unique); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 36, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_rlddm, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 128, __pyx_L1_error) + + /* "wfpt.pyx":206 + * + * + * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] x, + * np.ndarray[long, ndim=1] response, + */ + __pyx_tuple__31 = PyTuple_Pack(37, __pyx_n_s_model, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_params_ssm, __pyx_n_s_params_rl, __pyx_n_s_params_bnds, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_v, __pyx_n_s_rl_alpha, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_p, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_log_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_responses_qs, __pyx_n_s_unique, __pyx_n_s_n_params, __pyx_n_s_data, __pyx_n_s_ll_min, __pyx_n_s_cumm_s_size, __pyx_n_s_lower_bnd, __pyx_n_s_upper_bnd); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(12, 0, 0, 37, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_rlssm_nn, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 206, __pyx_L1_error) + + /* "wfpt.pyx":320 + * + * + * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] feedback, + * np.ndarray[long, ndim=1] split_by, + */ + __pyx_tuple__32 = PyTuple_Pack(30, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_alpha, __pyx_n_s_pos_alpha, __pyx_n_s_v, __pyx_n_s_z, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_drift, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_unique); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_rl, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 320, __pyx_L1_error) + + /* "wfpt.pyx":407 + * + * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + __pyx_tuple__33 = PyTuple_Pack(24, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_multi, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_params, __pyx_n_s_params_iter, __pyx_n_s_param); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 24, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_multi, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 407, __pyx_L1_error) + + /* "wfpt.pyx":440 + * + * + * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + __pyx_tuple__34 = PyTuple_Pack(34, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_alpha, __pyx_n_s_err, __pyx_n_s_multi, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_ij, __pyx_n_s_s_size, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_s, __pyx_n_s_qs, __pyx_n_s_params, __pyx_n_s_params_iter, __pyx_n_s_i, __pyx_n_s_param, __pyx_n_s_alfa); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 34, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_multi_rlddm, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 440, __pyx_L1_error) + + /* "wfpt.pyx":486 + * + * + * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< + * np.ndarray[float, ndim=2] rl_arr, + * np.ndarray[double, ndim=1] x, + */ + __pyx_tuple__35 = PyTuple_Pack(34, __pyx_n_s_data, __pyx_n_s_rl_arr, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_params_bnds, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_rl_alpha, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_p, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_log_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_responses_qs, __pyx_n_s_unique, __pyx_n_s_data_copy, __pyx_n_s_ll_min, __pyx_n_s_cumm_s_size, __pyx_n_s_lower_bnd, __pyx_n_s_upper_bnd, __pyx_n_s_tp_scale); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 34, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_rlssm_nn_reg, 486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 486, __pyx_L1_error) + + /* "wfpt.pyx":566 + * return sum_logp + * + * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< + * double sv, double a, double z, double sz, double t, double st, double t_min, + * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, + */ + __pyx_tuple__36 = PyTuple_Pack(22, __pyx_n_s_x, __pyx_n_s_cont_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_t_min, __pyx_n_s_t_max, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_n_cont, __pyx_n_s_pos_cont); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_contaminant, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 566, __pyx_L1_error) + + /* "wfpt.pyx":597 + * return sum_logp + * + * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< + * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + __pyx_tuple__37 = PyTuple_Pack(19, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_N, __pyx_n_s_time, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_x, __pyx_n_s_cdf_array, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_gen_cdf_using_pdf, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 597, __pyx_L1_error) + + /* "wfpt.pyx":625 + * + * + * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< + * + * # get length of data + */ + __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_s_x, __pyx_n_s_data, __pyx_n_s_N, __pyx_n_s_x_lb, __pyx_n_s_lb, __pyx_n_s_x_ub, __pyx_n_s_ub); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_split_cdf, 625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 625, __pyx_L1_error) + + /* "wfpt.pyx":643 + * return (x_lb, lb, x_ub, ub) + * + * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + __pyx_tuple__39 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_ll_min, __pyx_n_s_log_p); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_multi_nn_mlp, 643, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 643, __pyx_L1_error) + + /* "wfpt.pyx":664 + * return log_p + * + * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, 664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_float_1eneg_3 = PyFloat_FromDouble(1e-3); if (unlikely(!__pyx_float_1eneg_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_float_2_718281828459 = PyFloat_FromDouble(2.718281828459); if (unlikely(!__pyx_float_2_718281828459)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + /* NumpyImportArray.init */ + /* + * Cython has automatically inserted a call to _import_array since + * you didn't include one when you cimported numpy. To disable this + * add the line + * numpy._import_array + */ +#ifdef NPY_FEATURE_VERSION +#if !NO_IMPORT_ARRAY +if (unlikely(_import_array() == -1)) { + PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import " + "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; " + "use 'numpy._import_array' to disable if you are certain you don't need it)."); +} +#endif +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyTypeObject), + #elif CYTHON_COMPILING_IN_LIMITED_API + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyTypeObject), + #else + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_wfpt(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_wfpt}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "wfpt", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initwfpt(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initwfpt(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_wfpt(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_wfpt(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +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) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_wfpt(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + __Pyx_TraceDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'wfpt' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("wfpt", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to wfpt pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_wfpt(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_wfpt) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "wfpt")) { + if (unlikely((PyDict_SetItemString(modules, "wfpt", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_wfpt(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + * + * @property + * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + * + * @property + * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + __Pyx_TraceLine(257,0,__PYX_ERR(1, 257, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + * + * @property + * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + __Pyx_TraceLine(263,0,__PYX_ERR(1, 263, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + * + * @property + * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + __Pyx_TraceLine(271,0,__PYX_ERR(1, 271, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + * + * @property + * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + __Pyx_TraceLine(278,0,__PYX_ERR(1, 278, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + * + * @property + * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + __Pyx_TraceLine(773,0,__PYX_ERR(1, 773, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + __Pyx_TraceLine(788,0,__PYX_ERR(1, 788, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + __Pyx_TraceLine(967,0,__PYX_ERR(1, 967, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + __Pyx_TraceLine(971,0,__PYX_ERR(1, 971, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + __Pyx_TraceLine(998,0,__PYX_ERR(1, 998, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error)) + + + /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error)) + + + /* "wfpt.pyx":19 + * #from hddm.model_config import model_config + * + * import scipy.integrate as integrate # <<<<<<<<<<<<<< + * from copy import copy + * import numpy as np + */ + __Pyx_TraceLine(19,0,__PYX_ERR(0, 19, __pyx_L1_error)) + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_scipy_integrate, __pyx_tuple__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_integrate, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "wfpt.pyx":20 + * + * import scipy.integrate as integrate + * from copy import copy # <<<<<<<<<<<<<< + * import numpy as np + * + */ + __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error)) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_copy); + __Pyx_GIVEREF(__pyx_n_s_copy); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_copy); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_copy, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "wfpt.pyx":21 + * import scipy.integrate as integrate + * from copy import copy + * import numpy as np # <<<<<<<<<<<<<< + * + * cimport numpy as np + */ + __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error)) + __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "hddm_wfpt/integrate.pxi":6 + * #cython: boundscheck=False + * + * import numpy as np # <<<<<<<<<<<<<< + * cimport numpy as np + * cimport cython + */ + __Pyx_TraceLine(6,0,__PYX_ERR(3, 6, __pyx_L1_error)) + __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(3, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "hddm_wfpt/pdf.pxi":28 + * T max[T](T a, T b) + * + * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< + * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method + * and implementation of Navarro & Fuss, 2009. + */ + __Pyx_TraceLine(28,0,__PYX_ERR(2, 28, __pyx_L1_error)) + + + /* "hddm_wfpt/pdf.pxi":67 + * return p + * + * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< + * """Probability of hitting upper boundary.""" + * if v == 0: + */ + __Pyx_TraceLine(67,0,__PYX_ERR(2, 67, __pyx_L1_error)) + + + /* "hddm_wfpt/pdf.pxi":74 + * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) + * + * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< + * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method + * and implementation of Navarro & Fuss, 2009. + */ + __Pyx_TraceLine(74,0,__PYX_ERR(2, 74, __pyx_L1_error)) + + + /* "hddm_wfpt/pdf.pxi":87 + * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) + * + * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< + * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method + * and implementation of Navarro & Fuss, 2009. + */ + __Pyx_TraceLine(87,0,__PYX_ERR(2, 87, __pyx_L1_error)) + + + /* "hddm_wfpt/pdf.pxi":104 + * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) + * + * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< + * z, double sz, double t, double st, double err, int + * n_st=2, int n_sz=2, bint use_adaptive=1, double + */ + __Pyx_TraceLine(104,0,__PYX_ERR(2, 104, __pyx_L1_error)) + + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_1full_pdf, 0, __pyx_n_s_full_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__26); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_full_pdf, __pyx_t_3) < 0) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "hddm_wfpt/integrate.pxi":12 + * include 'pdf.pxi' + * + * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< + * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: + * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" + */ + __Pyx_TraceLine(12,0,__PYX_ERR(3, 12, __pyx_L1_error)) + + + /* "hddm_wfpt/integrate.pxi":47 + * return ((ht+hz) * S / 3) + * + * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< + * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" + * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) + */ + __Pyx_TraceLine(47,0,__PYX_ERR(3, 47, __pyx_L1_error)) + + + /* "hddm_wfpt/integrate.pxi":72 + * return (ht * S / 3) + * + * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< + * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, + * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: + */ + __Pyx_TraceLine(72,0,__PYX_ERR(3, 72, __pyx_L1_error)) + + + /* "hddm_wfpt/integrate.pxi":114 + * Sright, f_mid, f_end, fe, bottom-1) + * + * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< + * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, + * double simps_err, int maxRecursionDepth) nogil: + */ + __Pyx_TraceLine(114,0,__PYX_ERR(3, 114, __pyx_L1_error)) + + + /* "hddm_wfpt/integrate.pxi":143 + * return res + * + * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< + * double a, double z, double t, double + * pdf_err, double err_1d, double lb_z, + */ + __Pyx_TraceLine(143,0,__PYX_ERR(3, 143, __pyx_L1_error)) + + + /* "hddm_wfpt/integrate.pxi":181 + * + * + * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< + * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, + * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: + */ + __Pyx_TraceLine(181,0,__PYX_ERR(3, 181, __pyx_L1_error)) + + + /* "wfpt.pyx":33 + * + * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, + * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, # <<<<<<<<<<<<<< + * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): + * + */ + __Pyx_TraceLine(33,0,__PYX_ERR(0, 33, __pyx_L1_error)) + __pyx_t_3 = PyFloat_FromDouble(((double)1e-4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "wfpt.pyx":34 + * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, + * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, + * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(34,0,__PYX_ERR(0, 34, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + + /* "wfpt.pyx":32 + * include 'integrate.pxi' + * + * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< + * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, + * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): + */ + __Pyx_TraceLine(32,0,__PYX_ERR(0, 32, __pyx_L1_error)) + __pyx_t_10 = PyTuple_New(8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_9); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_3pdf_array, 0, __pyx_n_s_pdf_array, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pdf_array, __pyx_t_9) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "wfpt.pyx":50 + * return y + * + * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< + * return (p_outlier >= 0) & (p_outlier <= 1) + * + */ + __Pyx_TraceLine(50,0,__PYX_ERR(0, 50, __pyx_L1_error)) + + + /* "wfpt.pyx":55 + * + * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< + * double p_outlier=0, double w_outlier=0.1): + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(55,0,__PYX_ERR(0, 55, __pyx_L1_error)) + __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "wfpt.pyx":56 + * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0.1): # <<<<<<<<<<<<<< + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t i + */ + __Pyx_TraceLine(56,0,__PYX_ERR(0, 56, __pyx_L1_error)) + __pyx_t_6 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyFloat_FromDouble(((double)0.1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "wfpt.pyx":54 + * + * + * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0.1): + */ + __Pyx_TraceLine(54,0,__PYX_ERR(0, 54, __pyx_L1_error)) + __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_5); + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_5wiener_like, 0, __pyx_n_s_wiener_like, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like, __pyx_t_5) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":87 + * np.ndarray[double, ndim=1] st, + * double err, + * int n_st=10, # <<<<<<<<<<<<<< + * int n_sz=10, + * bint use_adaptive=1, + */ + __Pyx_TraceLine(87,0,__PYX_ERR(0, 87, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "wfpt.pyx":88 + * double err, + * int n_st=10, + * int n_sz=10, # <<<<<<<<<<<<<< + * bint use_adaptive=1, + * double simps_err=1e-8, + */ + __Pyx_TraceLine(88,0,__PYX_ERR(0, 88, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "wfpt.pyx":89 + * int n_st=10, + * int n_sz=10, + * bint use_adaptive=1, # <<<<<<<<<<<<<< + * double simps_err=1e-8, + * double p_outlier=0, + */ + __Pyx_TraceLine(89,0,__PYX_ERR(0, 89, __pyx_L1_error)) + __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "wfpt.pyx":90 + * int n_sz=10, + * bint use_adaptive=1, + * double simps_err=1e-8, # <<<<<<<<<<<<<< + * double p_outlier=0, + * double w_outlier=0.1): + */ + __Pyx_TraceLine(90,0,__PYX_ERR(0, 90, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "wfpt.pyx":91 + * bint use_adaptive=1, + * double simps_err=1e-8, + * double p_outlier=0, # <<<<<<<<<<<<<< + * double w_outlier=0.1): + * + */ + __Pyx_TraceLine(91,0,__PYX_ERR(0, 91, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "wfpt.pyx":92 + * double simps_err=1e-8, + * double p_outlier=0, + * double w_outlier=0.1): # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(92,0,__PYX_ERR(0, 92, __pyx_L1_error)) + __pyx_t_10 = PyFloat_FromDouble(((double)0.1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "wfpt.pyx":78 + * return sum_logp + * + * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] v, + * np.ndarray[double, ndim=1] sv, + */ + __Pyx_TraceLine(78,0,__PYX_ERR(0, 78, __pyx_L1_error)) + __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_10); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_7wiener_logp_array, 0, __pyx_n_s_wiener_logp_array, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_logp_array, __pyx_t_10) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "wfpt.pyx":134 + * double q, double alpha, double pos_alpha, double v, + * double sv, double a, double z, double sz, double t, + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "wfpt.pyx":135 + * double sv, double a, double z, double sz, double t, + * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t i, j + */ + __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error)) + __pyx_t_6 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "wfpt.pyx":128 + * return logp + * + * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error)) + __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4); + __pyx_t_10 = 0; + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_9wiener_like_rlddm, 0, __pyx_n_s_wiener_like_rlddm, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlddm, __pyx_t_4) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":215 + * np.ndarray[double, ndim=1] params_rl, + * np.ndarray[double, ndim=2] params_bnds, + * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< + * + * cdef double v = params_ssm[0] + */ + __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error)) + __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "wfpt.pyx":206 + * + * + * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] x, + * np.ndarray[long, ndim=1] response, + */ + __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error)) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)Py_None)); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_11wiener_like_rlssm_nn, 0, __pyx_n_s_wiener_like_rlssm_nn, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlssm_nn, __pyx_t_5) < 0) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":324 + * np.ndarray[long, ndim=1] split_by, + * double q, double alpha, double pos_alpha, double v, double z, + * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = response.shape[0] + */ + __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error)) + __pyx_t_5 = PyFloat_FromDouble(((double)1e-4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "wfpt.pyx":325 + * double q, double alpha, double pos_alpha, double v, double z, + * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< + * cdef Py_ssize_t size = response.shape[0] + * cdef Py_ssize_t i, j + */ + __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "wfpt.pyx":320 + * + * + * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] feedback, + * np.ndarray[long, ndim=1] split_by, + */ + __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error)) + __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_10); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_13wiener_like_rl, 0, __pyx_n_s_wiener_like_rl, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rl, __pyx_t_10) < 0) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "wfpt.pyx":408 + * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(408,0,__PYX_ERR(0, 408, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "wfpt.pyx":409 + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t i + */ + __Pyx_TraceLine(409,0,__PYX_ERR(0, 409, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "wfpt.pyx":407 + * + * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error)) + __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_None)); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_4); + __pyx_t_10 = 0; + __pyx_t_2 = 0; + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_15wiener_like_multi, 0, __pyx_n_s_wiener_like_multi, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi, __pyx_t_4) < 0) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":445 + * np.ndarray[long, ndim=1] split_by, + * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(445,0,__PYX_ERR(0, 445, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "wfpt.pyx":446 + * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t ij + */ + __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "wfpt.pyx":440 + * + * + * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[long, ndim=1] response, + * np.ndarray[double, ndim=1] feedback, + */ + __Pyx_TraceLine(440,0,__PYX_ERR(0, 440, __pyx_L1_error)) + __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_None)); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_17wiener_like_multi_rlddm, 0, __pyx_n_s_wiener_like_multi_rlddm, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_rlddm, __pyx_t_2) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "wfpt.pyx":494 + * double q, + * np.ndarray[double, ndim=2] params_bnds, + * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< + * cdef double rl_alpha + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error)) + __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "wfpt.pyx":486 + * + * + * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< + * np.ndarray[float, ndim=2] rl_arr, + * np.ndarray[double, ndim=1] x, + */ + __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error)) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)Py_None)); + __pyx_t_2 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_19wiener_like_rlssm_nn_reg, 0, __pyx_n_s_wiener_like_rlssm_nn_reg, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlssm_nn_reg, __pyx_t_10) < 0) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "wfpt.pyx":568 + * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, + * double sv, double a, double z, double sz, double t, double st, double t_min, + * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, # <<<<<<<<<<<<<< + * double simps_err=1e-8): + * """Wiener likelihood function where RTs could come from a + */ + __Pyx_TraceLine(568,0,__PYX_ERR(0, 568, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "wfpt.pyx":569 + * double sv, double a, double z, double sz, double t, double st, double t_min, + * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, + * double simps_err=1e-8): # <<<<<<<<<<<<<< + * """Wiener likelihood function where RTs could come from a + * separate, uniform contaminant distribution. + */ + __Pyx_TraceLine(569,0,__PYX_ERR(0, 569, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "wfpt.pyx":566 + * return sum_logp + * + * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< + * double sv, double a, double z, double sz, double t, double st, double t_min, + * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, + */ + __Pyx_TraceLine(566,0,__PYX_ERR(0, 566, __pyx_L1_error)) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_8); + __pyx_t_10 = 0; + __pyx_t_9 = 0; + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_21wiener_like_contaminant, 0, __pyx_n_s_wiener_like_contaminant, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_contaminant, __pyx_t_8) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "wfpt.pyx":598 + * + * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, + * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< + * double p_outlier=0, double w_outlier=0): + * """ + */ + __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error)) + __pyx_t_8 = __Pyx_PyInt_From_int(((int)0x1F4)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyFloat_FromDouble(((double)5.)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "wfpt.pyx":599 + * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, + * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< + * """ + * generate cdf vector using the pdf + */ + __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error)) + __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "wfpt.pyx":597 + * return sum_logp + * + * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< + * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + __Pyx_TraceLine(597,0,__PYX_ERR(0, 597, __pyx_L1_error)) + __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_5); + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_2 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_23gen_cdf_using_pdf, 0, __pyx_n_s_gen_cdf_using_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gen_cdf_using_pdf, __pyx_t_5) < 0) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":625 + * + * + * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< + * + * # get length of data + */ + __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error)) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_25split_cdf, 0, __pyx_n_s_split_cdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_cdf, __pyx_t_5) < 0) __PYX_ERR(0, 625, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "wfpt.pyx":644 + * + * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, + * double p_outlier = 0, # <<<<<<<<<<<<<< + * double w_outlier = 0, + * network = None): + */ + __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error)) + __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "wfpt.pyx":645 + * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, + * double p_outlier = 0, + * double w_outlier = 0, # <<<<<<<<<<<<<< + * network = None): + * #**kwargs): + */ + __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error)) + __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "wfpt.pyx":643 + * return (x_lb, lb, x_ub, ub) + * + * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error)) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)Py_None)); + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_27wiener_like_multi_nn_mlp, 0, __pyx_n_s_wiener_like_multi_nn_mlp, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_nn_mlp, __pyx_t_3) < 0) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "wfpt.pyx":665 + * + * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, + * double p_outlier = 0, # <<<<<<<<<<<<<< + * double w_outlier = 0, + * network = None): + */ + __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error)) + __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "wfpt.pyx":666 + * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, + * double p_outlier = 0, + * double w_outlier = 0, # <<<<<<<<<<<<<< + * network = None): + * #**kwargs): + */ + __Pyx_TraceLine(666,0,__PYX_ERR(0, 666, __pyx_L1_error)) + __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "wfpt.pyx":664 + * return log_p + * + * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< + * double p_outlier = 0, + * double w_outlier = 0, + */ + __Pyx_TraceLine(664,0,__PYX_ERR(0, 664, __pyx_L1_error)) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)Py_None)); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp_pdf, 0, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, __pyx_t_4) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "wfpt.pyx":1 + * # cython: embedsignature=True # <<<<<<<<<<<<<< + * # cython: cdivision=True + * # cython: wraparound=False + */ + __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_TraceReturn(Py_None, 0); + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init wfpt", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init wfpt"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* ErrOccurredWithGIL */ +static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) { + int err; + #ifdef WITH_THREAD + PyGILState_STATE _save = PyGILState_Ensure(); + #endif + err = !!PyErr_Occurred(); + #ifdef WITH_THREAD + PyGILState_Release(_save); + #endif + return err; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; // error + return kwvalues[i]; + } + } + return NULL; // not found (no exception set) +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + if (kwds_is_tuple) { + if (pos >= PyTuple_GET_SIZE(kwds)) break; + key = PyTuple_GET_ITEM(kwds, pos); + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* IsLittleEndian */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t <= '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case '?': return "'bool'"; + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparsable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) { + CYTHON_UNUSED_VAR(is_complex); + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) { + CYTHON_UNUSED_VAR(is_complex); + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number, ndim; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* BufferGetAndValidate */ + static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (unlikely(info->buf == NULL)) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} +static void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static int __Pyx__GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + buf->buf = NULL; + if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { + __Pyx_ZeroBuffer(buf); + return -1; + } + if (unlikely(buf->ndim != nd)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if (unlikely((size_t)buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_SafeReleaseBuffer(buf); + return -1; +} + +/* PyDictVersioning */ + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ + #if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* ExtTypeTest */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + __Pyx_TypeName obj_type_name; + __Pyx_TypeName type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetName(type); + PyErr_Format(PyExc_TypeError, + "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, + obj_type_name, type_name); + __Pyx_DECREF_TypeName(obj_type_name); + __Pyx_DECREF_TypeName(type_name); + return 0; +} + +/* BufferFallbackError */ + static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCallMethO */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ + static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + Py_DECREF(argstuple); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) + if (__Pyx_IsCyOrPyCFunction(func)) +#else + if (PyCFunction_Check(func)) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + } + else if (nargs == 1 && kwargs == NULL) { + if (PyCFunction_Check(func)) + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, args[0]); + } + } + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + #if CYTHON_VECTORCALL + vectorcallfunc f = _PyVectorcall_Function(func); + if (f) { + return f(func, args, (size_t)nargs, kwargs); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, kwargs); + } + #endif + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); +} + +/* GetItemInt */ + static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyObjectCallOneArg */ + static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* ObjectGetItem */ + #if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { + PyObject *runerr = NULL; + Py_ssize_t key_value; + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, + "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); + __Pyx_DECREF_TypeName(index_type_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { + __Pyx_TypeName obj_type_name; + if (likely(PyType_Check(obj))) { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + if (meth) { + PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); + Py_DECREF(meth); + return result; + } + } + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { + PyTypeObject *tp = Py_TYPE(obj); + PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { + return mm->mp_subscript(obj, key); + } + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); + } + return __Pyx_PyObject_GetItem_Slow(obj, key); +} +#endif + +/* DictGetItem */ + #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* PyIntCompare */ + static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 0; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + return (a != b); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) != 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 1; + intval = -intval; + } else { + if (__Pyx_PyLong_IsNeg(op1)) + return 1; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal != 0); + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + return ((double)a != (double)b); + } + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_NE)); +} + +/* PyIntBinop */ + #if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + + x = (long)((unsigned long)a - (unsigned long)b); + if (likely((x^a) >= 0 || (x^~b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return PyLong_FromLong(-intval); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + } + x = a - b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla - llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("subtract", return NULL) + result = ((double)a) - (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); +} +#endif + +/* PyIntBinop */ + #if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op2))) { + const long a = intval; + long x; + long b = PyInt_AS_LONG(op2); + + x = (long)((unsigned long)a + (unsigned long)b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op2))) { + const long a = intval; + long b, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG lla = intval; + PY_LONG_LONG llb, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op2))) { + return __Pyx_NewRef(op1); + } + if (likely(__Pyx_PyLong_IsCompact(op2))) { + b = __Pyx_PyLong_CompactValue(op2); + } else { + const digit* digits = __Pyx_PyLong_Digits(op2); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op2)) { + const long a = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double b = __pyx_PyFloat_AsDouble(op2); +#else + double b = PyFloat_AS_DOUBLE(op2); +#endif + double result; + + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType_3_0_0 +#define __PYX_HAVE_RT_ImportType_3_0_0 +static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; + Py_ssize_t itemsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + PyObject *py_itemsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#if !CYTHON_COMPILING_IN_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize+itemsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_0 && + ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd-%zd from PyObject", + module_name, class_name, size, basicsize, basicsize+itemsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_0 && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, 1); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + #endif + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportDottedModule */ + #if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s__23; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__24); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FixUpExtensionType */ + #if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* FetchSharedCythonModule */ + static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); + if (unlikely(!abi_module)) return NULL; + Py_INCREF(abi_module); + return abi_module; +} + +/* FetchCommonType */ + static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ + #if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ + static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); + PyList_SET_ITEM(fromlist, 0, marker); + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyCFunctionObject *cf = (PyCFunctionObject*) op; + if (unlikely(op == NULL)) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + cf->m_ml = ml; + cf->m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + cf->m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(((PyCFunctionObject*)m)->m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(((PyCFunctionObject*)m)->m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#ifdef _Py_TPFLAGS_HAVE_VECTORCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ + static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + #if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + _PyTraceback_Add(funcname, filename, py_line); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + __Pyx_TypeName obj_type_name; + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface", + obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* Declarations */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = (float)(1.0) / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = (float)(1.0) / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if ((b.imag == 0) && (a.real >= 0)) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if ((b.imag == 0) && (a.real >= 0)) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* FormatTypeName */ + #if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__40)); + } + return name; +} +#endif + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __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]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; + char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } + PyOS_snprintf(message, sizeof(message), + "compile time version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ + #if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + 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])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + 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])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/src/hssm/likelihoods/hddm_wfpt/wfpt.pyx b/src/hssm/likelihoods/hddm_wfpt/wfpt.pyx new file mode 100644 index 00000000..9d410b44 --- /dev/null +++ b/src/hssm/likelihoods/hddm_wfpt/wfpt.pyx @@ -0,0 +1,705 @@ +# cython: embedsignature=True +# cython: cdivision=True +# cython: wraparound=False +# cython: boundscheck=False +# distutils: language = c++ +# +# Cython version of the Navarro & Fuss, 2009 DDM PDF. Based on the following code by Navarro & Fuss: +# http://www.psychocmath.logy.adelaide.edu.au/personalpages/staff/danielnavarro/resources/wfpt.m +# +# This implementation is about 170 times faster than the matlab +# reference version. +# +# Copyleft Thomas Wiecki (thomas_wiecki[at]brown.edu) & Imri Sofer, 2011 +# GPLv3 + +#import hddm +#from hddm.model_config import model_config + +import scipy.integrate as integrate +from copy import copy +import numpy as np + +cimport numpy as np +cimport cython + +from cython.parallel import * +# cimport openmp + +# include "pdf.pxi" +include 'integrate.pxi' + +def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, + double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, + double simps_err=1e-3, double p_outlier=0, double w_outlier=0): + + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i + cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) + + for i in prange(size, nogil=True): + y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + n_st, n_sz, use_adaptive, simps_err) + + y = y * (1 - p_outlier) + (w_outlier * p_outlier) + if logp == 1: + return np.log(y) + else: + return y + +cdef inline bint p_outlier_in_range(double p_outlier): + return (p_outlier >= 0) & (p_outlier <= 1) + + +def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, + double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + double p_outlier=0, double w_outlier=0.1): + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i + cdef double p + cdef double sum_logp = 0 + cdef double wp_outlier = w_outlier * p_outlier + + if not p_outlier_in_range(p_outlier): + return -np.inf + + for i in range(size): + p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + n_st, n_sz, use_adaptive, simps_err) + # If one probability = 0, the log sum will be -Inf + p = p * (1 - p_outlier) + wp_outlier + if p == 0: + return -np.inf + + sum_logp += log(p) + + return sum_logp + +def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, + int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + double p_outlier=0, double w_outlier=0): + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i + cdef double p = 0 + cdef double sum_logp = 0 + cdef double wp_outlier = w_outlier * p_outlier + + if multi is None: + return full_pdf(x, v, sv, a, z, sz, t, st, err) + else: + params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} + params_iter = copy(params) + for i in range(size): + for param in multi: + params_iter[param] = params[param][i] + if abs(x[i]) != 999.: + p = full_pdf(x[i], params_iter['v'], + params_iter['sv'], params_iter['a'], params_iter['z'], + params_iter['sz'], params_iter['t'], params_iter['st'], + err, n_st, n_sz, use_adaptive, simps_err) + p = p * (1 - p_outlier) + wp_outlier + elif x[i] == 999.: + p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + else: # x[i] == -999. + p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + + sum_logp += log(p) + + return sum_logp + +def wiener_logp_array(np.ndarray[double, ndim=1] x, + np.ndarray[double, ndim=1] v, + np.ndarray[double, ndim=1] sv, + np.ndarray[double, ndim=1] a, + np.ndarray[double, ndim=1] z, + np.ndarray[double, ndim=1] sz, + np.ndarray[double, ndim=1] t, + np.ndarray[double, ndim=1] st, + double err, + int n_st=10, + int n_sz=10, + bint use_adaptive=1, + double simps_err=1e-8, + double p_outlier=0, + double w_outlier=0.1): + + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i + cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) + cdef double p + cdef double wp_outlier = w_outlier * p_outlier + + if not p_outlier_in_range(p_outlier): + logp[:] = -np.inf + return logp + + for i in range(size): + p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, + n_st, n_sz, use_adaptive, simps_err) + + # If one probability = 0, the log sum will be -Inf + p = p * (1 - p_outlier) + wp_outlier + + if p == 0: + logp[i] = -np.inf + else: + logp[i] = np.log(p) + + return logp + +def wiener_like_rlddm(np.ndarray[double, ndim=1] x, + np.ndarray[long, ndim=1] response, + np.ndarray[double, ndim=1] feedback, + np.ndarray[long, ndim=1] split_by, + double q, double alpha, double pos_alpha, double v, + double sv, double a, double z, double sz, double t, + double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + double p_outlier=0, double w_outlier=0): + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i, j + cdef Py_ssize_t s_size + cdef int s + cdef double p + cdef double sum_logp = 0 + cdef double wp_outlier = w_outlier * p_outlier + cdef double alfa + cdef double pos_alfa + cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + cdef np.ndarray[double, ndim=1] xs + cdef np.ndarray[double, ndim=1] feedbacks + cdef np.ndarray[long, ndim=1] responses + cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + + if not p_outlier_in_range(p_outlier): + return -np.inf + + if pos_alpha==100.00: + pos_alfa = alpha + else: + pos_alfa = pos_alpha + + # unique represent # of conditions + for j in range(unique.shape[0]): + s = unique[j] + # select trials for current condition, identified by the split_by-array + feedbacks = feedback[split_by == s] + responses = response[split_by == s] + xs = x[split_by == s] + s_size = xs.shape[0] + qs[0] = q + qs[1] = q + + # don't calculate pdf for first trial but still update q + if feedbacks[0] > qs[responses[0]]: + alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + else: + alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) + + # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + # received on current trial. + qs[responses[0]] = qs[responses[0]] + \ + alfa * (feedbacks[0] - qs[responses[0]]) + + # loop through all trials in current condition + for i in range(1, s_size): + p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, + sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) + # If one probability = 0, the log sum will be -Inf + p = p * (1 - p_outlier) + wp_outlier + if p == 0: + return -np.inf + sum_logp += log(p) + + # get learning rate for current trial. if pos_alpha is not in + # include it will be same as alpha so can still use this + # calculation: + if feedbacks[i] > qs[responses[i]]: + alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + else: + alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) + + # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + # received on current trial. + qs[responses[i]] = qs[responses[i]] + \ + alfa * (feedbacks[i] - qs[responses[i]]) + return sum_logp + + +def wiener_like_rlssm_nn(str model, + np.ndarray[double, ndim=1] x, + np.ndarray[long, ndim=1] response, + np.ndarray[double, ndim=1] feedback, + np.ndarray[long, ndim=1] split_by, + double q, + np.ndarray[double, ndim=1] params_ssm, + np.ndarray[double, ndim=1] params_rl, + np.ndarray[double, ndim=2] params_bnds, + double p_outlier=0, double w_outlier=0, network = None): + + cdef double v = params_ssm[0] + cdef double rl_alpha = params_rl[0] + + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i, j, i_p + cdef Py_ssize_t s_size + cdef int s + cdef double log_p = 0 + cdef double sum_logp = 0 + cdef double wp_outlier = w_outlier * p_outlier + cdef double alfa + cdef double pos_alfa + cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + cdef np.ndarray[double, ndim=1] xs + cdef np.ndarray[double, ndim=1] feedbacks + cdef np.ndarray[long, ndim=1] responses + cdef np.ndarray[long, ndim=1] responses_qs + cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] + cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) + cdef float ll_min = -16.11809 + cdef int cumm_s_size = 0 + + if not p_outlier_in_range(p_outlier): + return -np.inf + + # Check for boundary violations -- if true, return -np.inf + for i_p in np.arange(1, len(params_ssm)): + lower_bnd = params_bnds[0][i_p] + upper_bnd = params_bnds[1][i_p] + + if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: + return -np.inf + + + if len(params_rl) == 2: + pos_alfa = params_rl[1] + else: + pos_alfa = params_rl[0] + + + # unique represent # of conditions + for j in range(unique.shape[0]): + s = unique[j] + # select trials for current condition, identified by the split_by-array + feedbacks = feedback[split_by == s] + responses = response[split_by == s] + xs = x[split_by == s] + s_size = xs.shape[0] + qs[0] = q + qs[1] = q + + responses_qs = responses + responses_qs[responses_qs == -1] = 0 + + # don't calculate pdf for first trial but still update q + if feedbacks[0] > qs[responses_qs[0]]: + alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + else: + alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) + + + # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + # received on current trial. + qs[responses_qs[0]] = qs[responses_qs[0]] + \ + alfa * (feedbacks[0] - qs[responses_qs[0]]) + + + data[0, 0] = 0.0 + # loop through all trials in current condition + for i in range(1, s_size): + data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v + # Check for boundary violations -- if true, return -np.inf + if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: + return -np.inf + + # get learning rate for current trial. if pos_alpha is not in + # include it will be same as alpha so can still use this + # calculation: + if feedbacks[i] > qs[responses_qs[i]]: + alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + else: + alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) + + # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + # received on current trial. + qs[responses_qs[i]] = qs[responses_qs[i]] + \ + alfa * (feedbacks[i] - qs[responses_qs[i]]) + cumm_s_size += s_size + + + data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) + data[:, n_params:] = np.stack([x, response], axis = 1) + + # Call to network: + if p_outlier == 0: + sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + else: + sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + + return sum_logp + + +def wiener_like_rl(np.ndarray[long, ndim=1] response, + np.ndarray[double, ndim=1] feedback, + np.ndarray[long, ndim=1] split_by, + double q, double alpha, double pos_alpha, double v, double z, + double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, + double p_outlier=0, double w_outlier=0): + cdef Py_ssize_t size = response.shape[0] + cdef Py_ssize_t i, j + cdef Py_ssize_t s_size + cdef int s + cdef double drift + cdef double p + cdef double sum_logp = 0 + cdef double wp_outlier = w_outlier * p_outlier + cdef double alfa + cdef double pos_alfa + cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + cdef np.ndarray[double, ndim=1] feedbacks + cdef np.ndarray[long, ndim=1] responses + cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + + if not p_outlier_in_range(p_outlier): + return -np.inf + + if pos_alpha==100.00: + pos_alfa = alpha + else: + pos_alfa = pos_alpha + + # unique represent # of conditions + for j in range(unique.shape[0]): + s = unique[j] + # select trials for current condition, identified by the split_by-array + feedbacks = feedback[split_by == s] + responses = response[split_by == s] + s_size = responses.shape[0] + qs[0] = q + qs[1] = q + + # don't calculate pdf for first trial but still update q + if feedbacks[0] > qs[responses[0]]: + alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + else: + alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) + + # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + # received on current trial. + qs[responses[0]] = qs[responses[0]] + \ + alfa * (feedbacks[0] - qs[responses[0]]) + + # loop through all trials in current condition + for i in range(1, s_size): + + drift = (qs[1] - qs[0]) * v + + if drift == 0: + p = 0.5 + else: + if responses[i] == 1: + p = (2.718281828459**(-2 * z * drift) - 1) / \ + (2.718281828459**(-2 * drift) - 1) + else: + p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ + (2.718281828459**(-2 * drift) - 1) + + # If one probability = 0, the log sum will be -Inf + p = p * (1 - p_outlier) + wp_outlier + if p == 0: + return -np.inf + + sum_logp += log(p) + + # get learning rate for current trial. if pos_alpha is not in + # include it will be same as alpha so can still use this + # calculation: + if feedbacks[i] > qs[responses[i]]: + alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) + else: + alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) + + # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward + # received on current trial. + qs[responses[i]] = qs[responses[i]] + \ + alfa * (feedbacks[i] - qs[responses[i]]) + return sum_logp + + +def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, + int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + double p_outlier=0, double w_outlier=0): + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i + cdef double p = 0 + cdef double sum_logp = 0 + cdef double wp_outlier = w_outlier * p_outlier + + if multi is None: + return full_pdf(x, v, sv, a, z, sz, t, st, err) + else: + params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} + params_iter = copy(params) + for i in range(size): + for param in multi: + params_iter[param] = params[param][i] + if abs(x[i]) != 999.: + p = full_pdf(x[i], params_iter['v'], + params_iter['sv'], params_iter['a'], params_iter['z'], + params_iter['sz'], params_iter['t'], params_iter['st'], + err, n_st, n_sz, use_adaptive, simps_err) + p = p * (1 - p_outlier) + wp_outlier + elif x[i] == 999.: + p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + else: # x[i] == -999. + p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + + sum_logp += log(p) + + return sum_logp + + +def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, + np.ndarray[long, ndim=1] response, + np.ndarray[double, ndim=1] feedback, + np.ndarray[long, ndim=1] split_by, + double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, + int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + double p_outlier=0, double w_outlier=0): + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t ij + cdef Py_ssize_t s_size + cdef double p = 0 + cdef double sum_logp = 0 + cdef double wp_outlier = w_outlier * p_outlier + cdef int s + cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + + if multi is None: + return full_pdf(x, v, sv, a, z, sz, t, st, err) + else: + params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} + params_iter = copy(params) + qs[0] = q + qs[1] = q + for i in range(size): + for param in multi: + params_iter[param] = params[param][i] + + if (i != 0): + if (split_by[i] != split_by[i-1]): + qs[0] = q + qs[1] = q + + p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), + params_iter['sv'], params_iter['a'], params_iter['z'], + params_iter['sz'], params_iter[ + 't'], params_iter['st'], + err, n_st, n_sz, use_adaptive, simps_err) + p = p * (1 - p_outlier) + wp_outlier + sum_logp += log(p) + + alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) + qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) + + return sum_logp + + +def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, + np.ndarray[float, ndim=2] rl_arr, + np.ndarray[double, ndim=1] x, + np.ndarray[long, ndim=1] response, + np.ndarray[double, ndim=1] feedback, + np.ndarray[long, ndim=1] split_by, + double q, + np.ndarray[double, ndim=2] params_bnds, + double p_outlier=0, double w_outlier=0, network = None): + cdef double rl_alpha + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i, j, i_p + cdef Py_ssize_t s_size + cdef int s + cdef double log_p = 0 + cdef double sum_logp = 0 + cdef double wp_outlier = w_outlier * p_outlier + cdef double alfa + cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) + cdef np.ndarray[double, ndim=1] xs + cdef np.ndarray[double, ndim=1] feedbacks + cdef np.ndarray[long, ndim=1] responses + cdef np.ndarray[long, ndim=1] responses_qs + cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) + cdef np.ndarray[float, ndim=2] data_copy = data + cdef float ll_min = -16.11809 + cdef int cumm_s_size = 0 + + if not p_outlier_in_range(p_outlier): + return -np.inf + + # Check for boundary violations -- if true, return -np.inf + for i_p in np.arange(1, data.shape[1]-2): + lower_bnd = params_bnds[0][i_p] + upper_bnd = params_bnds[1][i_p] + + if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: + return -np.inf + + # unique represent # of conditions + for j in range(unique.shape[0]): + s = unique[j] + # select trials for current condition, identified by the split_by-array + feedbacks = feedback[split_by == s] + responses = response[split_by == s] + xs = x[split_by == s] + s_size = xs.shape[0] + qs[0] = q + qs[1] = q + + responses_qs = responses + responses_qs[responses_qs == -1] = 0 + + # loop through all trials in current condition + for i in range(0, s_size): + tp_scale = data[cumm_s_size + i, 0] + if tp_scale < 0: + return -np.inf + + data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale + + # Check for boundary violations -- if true, return -np.inf + if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: + return -np.inf + + rl_alpha = rl_arr[cumm_s_size + i, 0] + alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) + + qs[responses_qs[i]] = qs[responses_qs[i]] + \ + alfa * (feedbacks[i] - qs[responses_qs[i]]) + cumm_s_size += s_size + + # Call to network: + if p_outlier == 0: + sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) + else: + sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + + return sum_logp + +def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, + double sv, double a, double z, double sz, double t, double st, double t_min, + double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, + double simps_err=1e-8): + """Wiener likelihood function where RTs could come from a + separate, uniform contaminant distribution. + + Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007) + """ + cdef Py_ssize_t size = x.shape[0] + cdef Py_ssize_t i + cdef double p + cdef double sum_logp = 0 + cdef int n_cont = np.sum(cont_x) + cdef int pos_cont = 0 + + for i in prange(size, nogil=True): + if cont_x[i] == 0: + p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, + n_st, n_sz, use_adaptive, simps_err) + if p == 0: + with gil: + return -np.inf + sum_logp += log(p) + # If one probability = 0, the log sum will be -Inf + + # add the log likelihood of the contaminations + sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) + + return sum_logp + +def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, + int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, + double p_outlier=0, double w_outlier=0): + """ + generate cdf vector using the pdf + """ + if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ + (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): + raise ValueError( + "at least one of the parameters is out of the support") + + cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) + cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) + cdef int idx + + # compute pdf on the real line + cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, + n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) + + # integrate + cdf_array[1:] = integrate.cumtrapz(cdf_array) + + # normalize + cdf_array /= cdf_array[x.shape[0] - 1] + + return x, cdf_array + + +def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): + + # get length of data + cdef int N = (len(data) - 1) / 2 + + # lower bound is reversed + cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] + cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] + # lower bound is cumulative in the wrong direction + lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) + + cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] + cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] + # ub does not start at 0 + ub -= ub[0] + + return (x_lb, lb, x_ub, ub) + +def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, + double p_outlier = 0, + double w_outlier = 0, + network = None): + #**kwargs): + + # data is a matrix of shape (n_samples, n_params + 2) + # where the first n_params columns are the parameters + # and the last two columns are the rt and response + # (in that order) + + cdef float ll_min = -16.11809 + cdef float log_p + + # Call to network: + if p_outlier == 0: # previous ddm_model + log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + else: + log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + return log_p + +def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, + double p_outlier = 0, + double w_outlier = 0, + network = None): + #**kwargs): + + # data is a matrix of shape (n_samples, n_params + 2) + # where the first n_params columns are the parameters + # and the last two columns are the rt and response + # (in that order) + + cdef float ll_min = -16.11809 + cdef float log_p + + # Call to network: + if p_outlier == 0: # previous ddm_model + log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) + else: + log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) + return log_p From 2564dd5fbca9cdec8b3058e74498b1ee9744901e Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Wed, 6 Sep 2023 11:05:25 -0400 Subject: [PATCH 03/14] add setup.py for cython module --- setup.py | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..2236c0fc --- /dev/null +++ b/setup.py @@ -0,0 +1,70 @@ +# noqa: D100 +import platform + +import numpy as np +from setuptools import Extension, setup + +try: + from Cython.Build import cythonize + + if platform.system() == "Darwin": + ext1 = Extension( + "wfpt", + ["src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"], + language="c++", + extra_compile_args=["-stdlib=libc++"], + extra_link_args=["-stdlib=libc++", "-mmacosx-version-min=10.9"], + ) + else: + ext1 = Extension( + "wfpt", ["src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"], language="c++" + ) + + ext_modules = cythonize( + [ + ext1, + Extension( + "cdfdif_wrapper", + [ + "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx", + "src/hssm/likelihoods/hddm_wfpt/cdfdif.c", + ], + ), + ], + compiler_directives={"language_level": "3", "linetrace": True}, + ) + +except ImportError: + ext_modules = [ + Extension("wfpt", ["src/hssm/likelihoods/hddm_wfpt/wfpt.cpp"], language="c++"), + Extension( + "cdfdif_wrapper", + [ + "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c", + "src/hssm/likelihoods/hddm_wfpt/cdfdif.c", + ], + ), + ] + +setup( + name="hddm-wfpt", + version="0.1.1", + author="Thomas V. Wiecki, Imri Sofer, Michael J. Frank, Mads Lund Pedersen" + + ", Alexander Fengler, Lakshmi Govindarajan, Krishn Bera", + author_email="alexander_fengler@brown.com", + url="http://github.com/lncc/hddm-wfpt", + packages=["hddm_wfpt"], # 'hddm.cnn', 'hddm.cnn_models', 'hddm.keras_models', + description="Collects a bunch of cython implementations of basic DDM likelihoods", + install_requires=["NumPy >=1.23.4", "SciPy >= 1.9.1", "cython >= 0.29.32"], + include_dirs=[np.get_include()], + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Operating System :: OS Independent", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", + ], + ext_modules=ext_modules, +) From cad88b558fedb86224db0c140477ce2a072bece8 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Wed, 6 Sep 2023 11:16:26 -0400 Subject: [PATCH 04/14] fix ci errors --- setup.py => build.py | 27 +- pyproject.toml | 3 + .../likelihoods/hddm_wfpt/cdfdif_wrapper.c | 1065 +- src/hssm/likelihoods/hddm_wfpt/wfpt.cpp | 8987 ++++++++++------- 4 files changed, 6333 insertions(+), 3749 deletions(-) rename setup.py => build.py (55%) diff --git a/setup.py b/build.py similarity index 55% rename from setup.py rename to build.py index 2236c0fc..4b9ca1d7 100644 --- a/setup.py +++ b/build.py @@ -1,8 +1,8 @@ # noqa: D100 import platform -import numpy as np -from setuptools import Extension, setup +import numpy as np # noqa +from setuptools import Extension, setup # noqa try: from Cython.Build import cythonize @@ -45,26 +45,3 @@ ], ), ] - -setup( - name="hddm-wfpt", - version="0.1.1", - author="Thomas V. Wiecki, Imri Sofer, Michael J. Frank, Mads Lund Pedersen" - + ", Alexander Fengler, Lakshmi Govindarajan, Krishn Bera", - author_email="alexander_fengler@brown.com", - url="http://github.com/lncc/hddm-wfpt", - packages=["hddm_wfpt"], # 'hddm.cnn', 'hddm.cnn_models', 'hddm.keras_models', - description="Collects a bunch of cython implementations of basic DDM likelihoods", - install_requires=["NumPy >=1.23.4", "SciPy >= 1.9.1", "cython >= 0.29.32"], - include_dirs=[np.get_include()], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Operating System :: OS Independent", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python", - "Topic :: Scientific/Engineering", - ], - ext_modules=ext_modules, -) diff --git a/pyproject.toml b/pyproject.toml index dc9e8e5d..e9034fd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -169,6 +169,9 @@ convention = "numpy" [tool.mypy] ignore_missing_imports = true +[tool.poetry.build] +script = "build.py" + [build-system] requires = [ "poetry-core>=1.4.0", diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c index 07bff919..700ad7b3 100644 --- a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c +++ b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c @@ -1,18 +1,18 @@ -/* Generated by Cython 3.0.0 */ +/* Generated by Cython 3.0.2 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "hddm_wfpt/cdfdif.h" + "src/hssm/likelihoods/hddm_wfpt/cdfdif.h" ], "include_dirs": [ - "hddm_wfpt" + "src/hssm/likelihoods/hddm_wfpt" ], "name": "cdfdif_wrapper", "sources": [ - "hddm_wfpt/cdfdif_wrapper.pyx", - "hddm_wfpt/cdfdif.c" + "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx", + "src/hssm/likelihoods/hddm_wfpt/cdfdif.c" ] }, "module_name": "cdfdif_wrapper" @@ -38,10 +38,15 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else -#define CYTHON_ABI "3_0_0" +#if CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_2" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030000F0 +#define CYTHON_HEX_VERSION 0x030002F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -74,6 +79,7 @@ END: Cython Metadata */ #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ @@ -140,8 +146,9 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 @@ -193,6 +200,10 @@ END: Cython Metadata */ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 @@ -240,7 +251,7 @@ END: Cython Metadata */ #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 @@ -462,6 +473,14 @@ END: Cython Metadata */ # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ @@ -561,59 +580,89 @@ END: Cython Metadata */ #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type -#if PY_VERSION_HEX >= 0x030B00A1 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { - PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; - PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; - const char *fn_cstr=NULL; - const char *name_cstr=NULL; - PyCodeObject *co=NULL, *result=NULL; + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + PyObject *version_info; // borrowed + PyObject *py_minor_version = NULL; + long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); - if (!(kwds=PyDict_New())) goto end; - if (!(argcount=PyLong_FromLong(a))) goto end; - if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; - if (!(posonlyargcount=PyLong_FromLong(p))) goto end; - if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; - if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; - if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; - if (!(nlocals=PyLong_FromLong(l))) goto end; - if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; - if (!(stacksize=PyLong_FromLong(s))) goto end; - if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; - if (!(flags=PyLong_FromLong(f))) goto end; - if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; - if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; - if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; - if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; - if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; - if (!(empty = PyTuple_New(0))) goto end; - result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; // we don't yet need to distinguish between versions > 11 + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } end: - Py_XDECREF((PyObject*) co); - Py_XDECREF(kwds); - Py_XDECREF(argcount); - Py_XDECREF(posonlyargcount); - Py_XDECREF(kwonlyargcount); - Py_XDECREF(nlocals); - Py_XDECREF(stacksize); - Py_XDECREF(replace); - Py_XDECREF(empty); + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } return result; } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) @@ -713,7 +762,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -863,6 +912,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE(obj);\ @@ -989,9 +1043,25 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) -#else + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject @@ -1391,7 +1461,7 @@ static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { - "hddm_wfpt/cdfdif_wrapper.pyx", + "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx", "__init__.cython-30.pxd", "type.pxd", }; @@ -1445,7 +1515,7 @@ typedef struct { /* #### Code section: numeric_typedefs ### */ -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":730 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1454,7 +1524,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1463,7 +1533,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1472,7 +1542,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1481,7 +1551,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":737 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1490,7 +1560,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1499,7 +1569,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1508,7 +1578,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1517,7 +1587,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":744 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1526,7 +1596,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1535,7 +1605,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":754 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1544,7 +1614,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1553,7 +1623,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1562,7 +1632,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":758 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1571,7 +1641,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1580,7 +1650,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1589,7 +1659,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1598,7 +1668,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1607,7 +1677,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":765 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1644,7 +1714,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1653,7 +1723,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1662,7 +1732,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":769 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1671,7 +1741,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -2113,7 +2183,20 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ -#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op + #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed +#endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) @@ -2124,14 +2207,18 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs + #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else @@ -2180,20 +2267,34 @@ static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; /* AssertionsEnabled.proto */ -#define __Pyx_init_assertions_enabled() #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define __pyx_assertions_enabled() (1) -#elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API) - #define __pyx_assertions_enabled() (!Py_OptimizeFlag) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6 + #define __Pyx_init_assertions_enabled() (0) + #define __pyx_assertions_enabled() (1) +#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) - #undef __Pyx_init_assertions_enabled - static void __Pyx_init_assertions_enabled(void) { - __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level; + static int __Pyx_init_assertions_enabled(void) { + PyObject *builtins, *debug, *debug_str; + int flag; + builtins = PyEval_GetBuiltins(); + if (!builtins) goto bad; + debug_str = PyUnicode_FromStringAndSize("__debug__", 9); + if (!debug_str) goto bad; + debug = PyObject_GetItem(builtins, debug_str); + Py_DECREF(debug_str); + if (!debug) goto bad; + flag = PyObject_IsTrue(debug); + Py_DECREF(debug); + if (flag == -1) goto bad; + __pyx_assertions_enabled_flag = flag; + return 0; + bad: + __pyx_assertions_enabled_flag = 1; + return -1; } #else - #define __pyx_assertions_enabled() (!Py_OptimizeFlag) + #define __Pyx_init_assertions_enabled() (0) + #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* PyDictVersioning.proto */ @@ -2258,7 +2359,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif @@ -2295,22 +2396,22 @@ static void __Pyx_RaiseBufferIndexError(int axis); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_0 -#define __PYX_HAVE_RT_ImportType_proto_3_0_0 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_2 +#define __PYX_HAVE_RT_ImportType_proto_3_0_2 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_2(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_2(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_0 { - __Pyx_ImportType_CheckSize_Error_3_0_0 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_0 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_0 = 2 +enum __Pyx_ImportType_CheckSize_3_0_2 { + __Pyx_ImportType_CheckSize_Error_3_0_2 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_2 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_2 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_2 check_size); #endif /* Import.proto */ @@ -2341,7 +2442,22 @@ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec #endif /* PyMethodNew.proto */ -#if PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) @@ -2365,7 +2481,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else @@ -2379,7 +2495,10 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { -#if PY_VERSION_HEX < 0x030900B1 +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; @@ -2387,7 +2506,7 @@ typedef struct { #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2397,7 +2516,7 @@ typedef struct { PyObject *func_globals; PyObject *func_code; PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; @@ -2733,11 +2852,11 @@ static const char __pyx_k_cdfdif_wrapper[] = "cdfdif_wrapper"; static const char __pyx_k_dmat_cdf_array[] = "dmat_cdf_array"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_hddm_wfpt_cdfdif_wrapper_pyx[] = "hddm_wfpt/cdfdif_wrapper.pyx"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_1_2_w_outlier_must_be_smaller_th[] = "1. / (2*w_outlier) must be smaller than RT"; static const char __pyx_k_at_least_one_of_the_parameters_i[] = "at least one of the parameters is out of the support"; static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_src_hssm_likelihoods_hddm_wfpt_c[] = "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ /* #### Code section: late_includes ### */ @@ -2821,7 +2940,6 @@ typedef struct { PyObject *__pyx_n_s_dtype; PyObject *__pyx_n_s_empty; PyObject *__pyx_n_s_epsi; - PyObject *__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; @@ -2840,6 +2958,7 @@ typedef struct { PyObject *__pyx_n_s_sign; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; + PyObject *__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c; PyObject *__pyx_n_s_st; PyObject *__pyx_n_s_sv; PyObject *__pyx_n_s_sz; @@ -2932,7 +3051,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_dtype); Py_CLEAR(clear_module_state->__pyx_n_s_empty); Py_CLEAR(clear_module_state->__pyx_n_s_epsi); - Py_CLEAR(clear_module_state->__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); @@ -2951,6 +3069,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_sign); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c); Py_CLEAR(clear_module_state->__pyx_n_s_st); Py_CLEAR(clear_module_state->__pyx_n_s_sv); Py_CLEAR(clear_module_state->__pyx_n_s_sz); @@ -3021,7 +3140,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_dtype); Py_VISIT(traverse_module_state->__pyx_n_s_empty); Py_VISIT(traverse_module_state->__pyx_n_s_epsi); - Py_VISIT(traverse_module_state->__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); @@ -3040,6 +3158,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_sign); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c); Py_VISIT(traverse_module_state->__pyx_n_s_st); Py_VISIT(traverse_module_state->__pyx_n_s_sv); Py_VISIT(traverse_module_state->__pyx_n_s_sz); @@ -3138,7 +3257,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype #define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty #define __pyx_n_s_epsi __pyx_mstate_global->__pyx_n_s_epsi -#define __pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx __pyx_mstate_global->__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing @@ -3157,6 +3275,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_sign __pyx_mstate_global->__pyx_n_s_sign #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c __pyx_mstate_global->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c #define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st #define __pyx_n_s_sv __pyx_mstate_global->__pyx_n_s_sv #define __pyx_n_s_sz __pyx_mstate_global->__pyx_n_s_sz @@ -3175,7 +3294,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 /* #### Code section: module_code ### */ -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -3194,7 +3313,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject #endif __Pyx_TraceCall("base", __pyx_f[1], 245, 1, __PYX_ERR(1, 245, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248 * """Returns a borrowed reference to the object owning the data/memory. * """ * return PyArray_BASE(self) # <<<<<<<<<<<<<< @@ -3205,7 +3324,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -3219,7 +3338,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("numpy.ndarray.base.base", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __pyx_r = NULL; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif @@ -3228,7 +3347,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -3247,7 +3366,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __Pyx_RefNannySetupContext("descr", 0); __Pyx_TraceCall("descr", __pyx_f[1], 251, 0, __PYX_ERR(1, 251, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254 * """Returns an owned reference to the dtype of the array. * """ * return PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -3261,7 +3380,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -3280,7 +3399,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -3299,7 +3418,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx #endif __Pyx_TraceCall("ndim", __pyx_f[1], 257, 1, __PYX_ERR(1, 257, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260 * """Returns the number of dimensions in the array. * """ * return PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -3310,7 +3429,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -3333,7 +3452,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -3352,7 +3471,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec #endif __Pyx_TraceCall("shape", __pyx_f[1], 263, 1, __PYX_ERR(1, 263, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268 * Can return NULL for 0-dimensional arrays. * """ * return PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3363,7 +3482,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -3377,7 +3496,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("numpy.ndarray.shape.shape", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __pyx_r = NULL; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif @@ -3386,7 +3505,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -3405,7 +3524,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO #endif __Pyx_TraceCall("strides", __pyx_f[1], 271, 1, __PYX_ERR(1, 271, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275 * The number of elements matches the number of dimensions of the array (ndim). * """ * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -3416,7 +3535,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -3430,7 +3549,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("numpy.ndarray.strides.strides", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __pyx_r = NULL; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif @@ -3439,7 +3558,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -3458,7 +3577,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * #endif __Pyx_TraceCall("size", __pyx_f[1], 278, 1, __PYX_ERR(1, 278, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281 * """Returns the total size (in number of elements) of the array. * """ * return PyArray_SIZE(self) # <<<<<<<<<<<<<< @@ -3469,7 +3588,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -3492,7 +3611,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -3511,7 +3630,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p #endif __Pyx_TraceCall("data", __pyx_f[1], 284, 1, __PYX_ERR(1, 284, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290 * of `PyArray_DATA()` instead, which returns a 'void*'. * """ * return PyArray_BYTES(self) # <<<<<<<<<<<<<< @@ -3522,7 +3641,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -3545,7 +3664,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3564,7 +3683,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[1], 773, 0, __PYX_ERR(1, 773, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -3579,7 +3698,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3599,7 +3718,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3618,7 +3737,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[1], 776, 0, __PYX_ERR(1, 776, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -3633,7 +3752,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3653,7 +3772,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3672,7 +3791,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[1], 779, 0, __PYX_ERR(1, 779, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -3687,7 +3806,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3707,7 +3826,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3726,7 +3845,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[1], 782, 0, __PYX_ERR(1, 782, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -3741,7 +3860,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3761,7 +3880,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3780,7 +3899,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[1], 785, 0, __PYX_ERR(1, 785, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -3795,7 +3914,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3815,7 +3934,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -3834,7 +3953,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[1], 788, 0, __PYX_ERR(1, 788, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -3845,7 +3964,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":790 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -3858,7 +3977,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -3867,7 +3986,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -3882,7 +4001,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -3901,7 +4020,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -3919,7 +4038,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannySetupContext("set_array_base", 0); __Pyx_TraceCall("set_array_base", __pyx_f[1], 967, 0, __PYX_ERR(1, 967, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -3929,7 +4048,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_TraceLine(968,0,__PYX_ERR(1, 968, __pyx_L1_error)) Py_INCREF(__pyx_v_base); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -3939,7 +4058,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_TraceLine(969,0,__PYX_ERR(1, 969, __pyx_L1_error)) __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -3956,7 +4075,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -3976,7 +4095,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannySetupContext("get_array_base", 0); __Pyx_TraceCall("get_array_base", __pyx_f[1], 971, 0, __PYX_ERR(1, 971, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -3986,7 +4105,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_TraceLine(972,0,__PYX_ERR(1, 972, __pyx_L1_error)) __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -3997,7 +4116,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -4009,7 +4128,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4018,7 +4137,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -4031,7 +4150,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4050,7 +4169,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4076,7 +4195,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_RefNannySetupContext("import_array", 0); __Pyx_TraceCall("import_array", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4093,7 +4212,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -4103,7 +4222,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L3_error)) __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4117,7 +4236,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -4133,7 +4252,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -4149,7 +4268,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { } goto __pyx_L5_except_error; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4165,7 +4284,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4189,7 +4308,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4215,7 +4334,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_RefNannySetupContext("import_umath", 0); __Pyx_TraceCall("import_umath", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4232,7 +4351,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4242,7 +4361,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L3_error)) __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4256,7 +4375,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4272,7 +4391,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4288,7 +4407,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { } goto __pyx_L5_except_error; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4304,7 +4423,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4328,7 +4447,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4354,7 +4473,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_RefNannySetupContext("import_ufunc", 0); __Pyx_TraceCall("import_ufunc", __pyx_f[1], 991, 0, __PYX_ERR(1, 991, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4371,7 +4490,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4381,7 +4500,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L3_error)) __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4395,7 +4514,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4411,7 +4530,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4427,7 +4546,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { } goto __pyx_L5_except_error; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4443,7 +4562,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4467,7 +4586,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4485,7 +4604,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannySetupContext("is_timedelta64_object", 0); __Pyx_TraceCall("is_timedelta64_object", __pyx_f[1], 998, 0, __PYX_ERR(1, 998, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -4496,7 +4615,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4514,7 +4633,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4532,7 +4651,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannySetupContext("is_datetime64_object", 0); __Pyx_TraceCall("is_datetime64_object", __pyx_f[1], 1013, 0, __PYX_ERR(1, 1013, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -4543,7 +4662,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4561,7 +4680,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4580,7 +4699,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * #endif __Pyx_TraceCall("get_datetime64_value", __pyx_f[1], 1028, 1, __PYX_ERR(1, 1028, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -4591,7 +4710,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4614,7 +4733,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4633,7 +4752,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject #endif __Pyx_TraceCall("get_timedelta64_value", __pyx_f[1], 1038, 1, __PYX_ERR(1, 1038, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1042 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -4644,7 +4763,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4667,7 +4786,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4686,7 +4805,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec #endif __Pyx_TraceCall("get_datetime64_unit", __pyx_f[1], 1045, 1, __PYX_ERR(1, 1045, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1049 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -4695,7 +4814,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4836,18 +4955,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dmat_cdf_array (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 16, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -4877,68 +5005,98 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 1); __PYX_ERR(0, 16, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 2); __PYX_ERR(0, 16, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 3); __PYX_ERR(0, 16, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 4); __PYX_ERR(0, 16, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 5); __PYX_ERR(0, 16, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 6); __PYX_ERR(0, 16, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 7); __PYX_ERR(0, 16, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier)) != 0)) kw_args--; + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 8); __PYX_ERR(0, 16, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier)) != 0)) kw_args--; + if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 9); __PYX_ERR(0, 16, __pyx_L3_error) @@ -4976,7 +5134,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 16, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("cdfdif_wrapper.dmat_cdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; @@ -4989,6 +5154,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5078,7 +5249,8 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -5088,6 +5260,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_x)}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); @@ -5098,7 +5271,8 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject } __pyx_t_6 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -5108,6 +5282,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); @@ -5282,7 +5457,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject * cdef int boundary */ __Pyx_TraceLine(28,0,__PYX_ERR(0, 28, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_11 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_11 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_v_size = (__pyx_t_11[0]); /* "cdfdif_wrapper.pyx":29 @@ -5303,7 +5478,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -5505,7 +5680,8 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); @@ -5515,6 +5691,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); @@ -5681,7 +5858,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {&__pyx_n_s_epsi, __pyx_k_epsi, sizeof(__pyx_k_epsi), 0, 0, 1, 1}, - {&__pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx, __pyx_k_hddm_wfpt_cdfdif_wrapper_pyx, sizeof(__pyx_k_hddm_wfpt_cdfdif_wrapper_pyx), 0, 0, 1, 0}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, @@ -5700,6 +5876,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c, __pyx_k_src_hssm_likelihoods_hddm_wfpt_c, sizeof(__pyx_k_src_hssm_likelihoods_hddm_wfpt_c), 0, 0, 1, 0}, {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, {&__pyx_n_s_sv, __pyx_k_sv, sizeof(__pyx_k_sv), 0, 0, 1, 1}, {&__pyx_n_s_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 0, 1, 1}, @@ -5730,7 +5907,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -5741,7 +5918,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -5784,7 +5961,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__7 = PyTuple_Pack(17, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_y, __pyx_n_s_boundary, __pyx_n_s_p_boundary, __pyx_n_s_params, __pyx_n_s_epsi, __pyx_n_s_i); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_cdfdif_wrapper_pyx, __pyx_n_s_dmat_cdf_array, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c, __pyx_n_s_dmat_cdf_array, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5803,7 +5980,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ - __Pyx_init_assertions_enabled(); + if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2, __pyx_L1_error) @@ -5815,7 +5992,7 @@ if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2, __pyx_L1_error) * numpy._import_array */ #ifdef NPY_FEATURE_VERSION -#if !NO_IMPORT_ARRAY +#ifndef NO_IMPORT_ARRAY if (unlikely(_import_array() == -1)) { PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import " "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; " @@ -5882,33 +6059,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -6216,7 +6393,7 @@ if (!__Pyx_RefNanny) { #endif __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void)", __pyx_f[0], 2, 0, __PYX_ERR(0, 2, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -6226,7 +6403,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -6236,7 +6413,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -6246,7 +6423,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(257,0,__PYX_ERR(1, 257, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -6256,7 +6433,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(263,0,__PYX_ERR(1, 263, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -6266,7 +6443,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(271,0,__PYX_ERR(1, 271, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -6276,7 +6453,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(278,0,__PYX_ERR(1, 278, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -6286,7 +6463,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6296,7 +6473,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(773,0,__PYX_ERR(1, 773, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6306,7 +6483,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -6316,7 +6493,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -6326,7 +6503,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -6336,7 +6513,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -6346,7 +6523,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(788,0,__PYX_ERR(1, 788, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6356,7 +6533,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(967,0,__PYX_ERR(1, 967, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6366,7 +6543,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(971,0,__PYX_ERR(1, 971, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -6376,7 +6553,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -6386,7 +6563,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -6396,7 +6573,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -6406,7 +6583,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(998,0,__PYX_ERR(1, 998, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -6416,7 +6593,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -6426,7 +6603,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -6436,7 +6613,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -7434,22 +7611,52 @@ static int __Pyx_ParseOptionalKeywords( PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { - if (pos >= PyTuple_GET_SIZE(kwds)) break; + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); // transfer ownership of value to values + Py_DECREF(key); +#endif + key = NULL; + value = NULL; continue; } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { @@ -7457,6 +7664,9 @@ static int __Pyx_ParseOptionalKeywords( if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; // ownership transferred to values +#endif break; } name++; @@ -7486,6 +7696,9 @@ static int __Pyx_ParseOptionalKeywords( if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; // ownership transferred to values +#endif break; } name++; @@ -7512,6 +7725,8 @@ static int __Pyx_ParseOptionalKeywords( goto invalid_keyword; } } + Py_XDECREF(key); + Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); @@ -7531,6 +7746,8 @@ static int __Pyx_ParseOptionalKeywords( function_name, key); #endif bad: + Py_XDECREF(key); + Py_XDECREF(value); return -1; } @@ -7897,7 +8114,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ctx->is_complex = 0; return 0; } -static PyObject * +static int __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) { const char *ts = *tsp; @@ -7906,9 +8123,9 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) if (ctx->new_count != 1) { PyErr_SetString(PyExc_ValueError, "Cannot handle repeated arrays in format string"); - return NULL; + return -1; } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1; ndim = ctx->head->field->type->ndim; while (*ts && *ts != ')') { switch (*ts) { @@ -7916,29 +8133,35 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) default: break; } number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) - return PyErr_Format(PyExc_ValueError, + if (number == -1) return -1; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) { + PyErr_Format(PyExc_ValueError, "Expected a dimension of size %zu, got %d", ctx->head->field->type->arraysize[i], number); - if (*ts != ',' && *ts != ')') - return PyErr_Format(PyExc_ValueError, + return -1; + } + if (*ts != ',' && *ts != ')') { + PyErr_Format(PyExc_ValueError, "Expected a comma in format string, got '%c'", *ts); + return -1; + } if (*ts == ',') ts++; i++; } - if (i != ndim) - return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + if (i != ndim) { + PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", ctx->head->field->type->ndim, i); + return -1; + } if (!*ts) { PyErr_SetString(PyExc_ValueError, "Unexpected end of format string, expected ')'"); - return NULL; + return -1; } ctx->is_valid_array = 1; ctx->new_count = 1; *tsp = ++ts; - return Py_None; + return 0; } static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { int got_Z = 0; @@ -8064,7 +8287,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha ++ts; break; case '(': - if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL; break; default: { @@ -8332,15 +8555,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall */ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; - PyObject *result; + PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: Py_DECREF(argstuple); return result; } @@ -8390,7 +8614,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif #if CYTHON_VECTORCALL + #if Py_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif if (f) { return f(func, args, (size_t)nargs, kwargs); } @@ -8433,10 +8661,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj } /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_0 -#define __PYX_HAVE_RT_ImportType_3_0_0 -static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 check_size) + #ifndef __PYX_HAVE_RT_ImportType_3_0_2 +#define __PYX_HAVE_RT_ImportType_3_0_2 +static PyTypeObject *__Pyx_ImportType_3_0_2(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_2 check_size) { PyObject *result = 0; char warning[200]; @@ -8490,7 +8718,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_0 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_2 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -8498,7 +8726,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_0 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_2 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -8536,13 +8764,8 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module #if PY_MAJOR_VERSION >= 3 if (level == -1) { if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, 1); - #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); - #endif if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; @@ -8561,14 +8784,9 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, level); - #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif - #endif } } bad: @@ -8948,7 +9166,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ /* CythonFunctionShared */ static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); @@ -8963,6 +9181,10 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); @@ -8975,6 +9197,7 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) Py_INCREF(Py_None); return Py_None; } +#endif } Py_INCREF(op->func_doc); return op->func_doc; @@ -8995,7 +9218,9 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { -#if PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); @@ -9114,10 +9339,10 @@ __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else - op->defaults_tuple = PySequence_ITEM(res, 0); + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { - op->defaults_kwdict = PySequence_ITEM(res, 1); + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif @@ -9226,7 +9451,15 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; @@ -9242,6 +9475,18 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, @@ -9261,20 +9506,27 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else +#if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif -#if PY_VERSION_HEX < 0x030500A0 +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, @@ -9297,30 +9549,40 @@ static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif if (unlikely(op == NULL)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; +#endif Py_XINCREF(closure); op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; +#endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; @@ -9366,13 +9628,18 @@ static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else @@ -9381,6 +9648,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } +#endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); @@ -9411,14 +9679,20 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); @@ -9442,10 +9716,22 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif Py_ssize_t size; - switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); @@ -9454,24 +9740,43 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif if (likely(size == 0)) return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); +#endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else - arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) @@ -9479,9 +9784,18 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); +#endif return NULL; } break; @@ -9489,12 +9803,28 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); +#endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; @@ -9514,7 +9844,12 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; @@ -9727,7 +10062,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#ifdef _Py_TPFLAGS_HAVE_VECTORCALL +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, @@ -9959,20 +10294,91 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { #include "compile.h" #include "frameobject.h" #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + PyErr_Clear(); + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #endif +} static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } - _PyTraceback_Add(funcname, filename, py_line); + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -10711,7 +11117,8 @@ __Pyx_PyType_GetName(PyTypeObject* tp) __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__8)); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__8); } return name; } @@ -10750,8 +11157,32 @@ __Pyx_PyType_GetName(PyTypeObject* tp) { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(from_bytes); + Py_XDECREF(py_bytes); + Py_XDECREF(order_str); + Py_XDECREF(arg_tuple); + Py_XDECREF(kwds); + return result; +#endif } } diff --git a/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp b/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp index c98e5ae0..e988ab46 100644 --- a/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp +++ b/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.0 */ +/* Generated by Cython 3.0.2 */ /* BEGIN: Cython Metadata { @@ -14,7 +14,7 @@ "language": "c++", "name": "wfpt", "sources": [ - "hddm_wfpt/wfpt.pyx" + "src/hssm/likelihoods/hddm_wfpt/wfpt.pyx" ] }, "module_name": "wfpt" @@ -40,10 +40,15 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else -#define CYTHON_ABI "3_0_0" +#if CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_2" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030000F0 +#define CYTHON_HEX_VERSION 0x030002F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -76,6 +81,7 @@ END: Cython Metadata */ #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ @@ -142,8 +148,9 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 @@ -195,6 +202,10 @@ END: Cython Metadata */ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 @@ -242,7 +253,7 @@ END: Cython Metadata */ #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 @@ -464,6 +475,14 @@ END: Cython Metadata */ # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ @@ -579,59 +598,89 @@ class __Pyx_FakeReference { #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type -#if PY_VERSION_HEX >= 0x030B00A1 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { - PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; - PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; - const char *fn_cstr=NULL; - const char *name_cstr=NULL; - PyCodeObject *co=NULL, *result=NULL; + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + PyObject *version_info; // borrowed + PyObject *py_minor_version = NULL; + long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); - if (!(kwds=PyDict_New())) goto end; - if (!(argcount=PyLong_FromLong(a))) goto end; - if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; - if (!(posonlyargcount=PyLong_FromLong(p))) goto end; - if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; - if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; - if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; - if (!(nlocals=PyLong_FromLong(l))) goto end; - if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; - if (!(stacksize=PyLong_FromLong(s))) goto end; - if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; - if (!(flags=PyLong_FromLong(f))) goto end; - if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; - if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; - if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; - if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; - if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; - if (!(empty = PyTuple_New(0))) goto end; - result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; // we don't yet need to distinguish between versions > 11 + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } end: - Py_XDECREF((PyObject*) co); - Py_XDECREF(kwds); - Py_XDECREF(argcount); - Py_XDECREF(posonlyargcount); - Py_XDECREF(kwonlyargcount); - Py_XDECREF(nlocals); - Py_XDECREF(stacksize); - Py_XDECREF(replace); - Py_XDECREF(empty); + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } return result; } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) @@ -731,7 +780,7 @@ class __Pyx_FakeReference { #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -881,6 +930,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE(obj);\ @@ -1007,9 +1061,25 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject @@ -1405,10 +1475,10 @@ static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { - "hddm_wfpt/wfpt.pyx", + "src/hssm/likelihoods/hddm_wfpt/wfpt.pyx", "__init__.cython-30.pxd", - "hddm_wfpt/pdf.pxi", - "hddm_wfpt/integrate.pxi", + "src/hssm/likelihoods/hddm_wfpt/pdf.pxi", + "src/hssm/likelihoods/hddm_wfpt/integrate.pxi", "type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ @@ -1461,7 +1531,7 @@ typedef struct { /* #### Code section: numeric_typedefs ### */ -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":730 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1470,7 +1540,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1479,7 +1549,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1488,7 +1558,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1497,7 +1567,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":737 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1506,7 +1576,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1515,7 +1585,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1524,7 +1594,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1533,7 +1603,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":744 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1542,7 +1612,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1551,7 +1621,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":754 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1560,7 +1630,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1569,7 +1639,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1578,7 +1648,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":758 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1587,7 +1657,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1596,7 +1666,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1605,7 +1675,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1614,7 +1684,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1623,7 +1693,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":765 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1660,7 +1730,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1669,7 +1739,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1678,7 +1748,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":769 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1687,7 +1757,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1697,7 +1767,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_opt_args_4wfpt_full_pdf; -/* "hddm_wfpt/pdf.pxi":104 +/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< @@ -2148,7 +2218,20 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ -#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op + #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed +#endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) @@ -2159,14 +2242,18 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs + #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else @@ -2283,7 +2370,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif @@ -2312,6 +2399,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ @@ -2345,17 +2443,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *k #endif #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); -#define __Pyx_PyObject_Dict_GetItem(obj, name)\ - (likely(PyDict_CheckExact(obj)) ?\ - __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) -#else -#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) -#endif - /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); @@ -2376,22 +2463,22 @@ static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, #endif /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_0 -#define __PYX_HAVE_RT_ImportType_proto_3_0_0 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_2 +#define __PYX_HAVE_RT_ImportType_proto_3_0_2 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_2(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_2(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_0 { - __Pyx_ImportType_CheckSize_Error_3_0_0 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_0 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_0 = 2 +enum __Pyx_ImportType_CheckSize_3_0_2 { + __Pyx_ImportType_CheckSize_Error_3_0_2 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_2 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_2 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_2 check_size); #endif /* Import.proto */ @@ -2425,7 +2512,22 @@ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec #endif /* PyMethodNew.proto */ -#if PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) @@ -2449,7 +2551,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else @@ -2463,7 +2565,10 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { -#if PY_VERSION_HEX < 0x030900B1 +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; @@ -2471,7 +2576,7 @@ typedef struct { #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2481,7 +2586,7 @@ typedef struct { PyObject *func_globals; PyObject *func_code; PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; @@ -2813,9 +2918,9 @@ static const char __pyx_k_sv[] = "sv"; static const char __pyx_k_sz[] = "sz"; static const char __pyx_k_ub[] = "ub"; static const char __pyx_k_xs[] = "xs"; -static const char __pyx_k__23[] = "*"; -static const char __pyx_k__24[] = "."; -static const char __pyx_k__40[] = "?"; +static const char __pyx_k__24[] = "*"; +static const char __pyx_k__25[] = "."; +static const char __pyx_k__41[] = "?"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_exp[] = "exp"; static const char __pyx_k_i_p[] = "i_p"; @@ -2921,13 +3026,11 @@ static const char __pyx_k_wiener_like_rl[] = "wiener_like_rl"; static const char __pyx_k_scipy_integrate[] = "scipy.integrate"; static const char __pyx_k_predict_on_batch[] = "predict_on_batch"; static const char __pyx_k_gen_cdf_using_pdf[] = "gen_cdf_using_pdf"; -static const char __pyx_k_hddm_wfpt_pdf_pxi[] = "hddm_wfpt/pdf.pxi"; static const char __pyx_k_wiener_like_multi[] = "wiener_like_multi"; static const char __pyx_k_wiener_like_rlddm[] = "wiener_like_rlddm"; static const char __pyx_k_wiener_logp_array[] = "wiener_logp_array"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_hddm_wfpt_wfpt_pyx[] = "hddm_wfpt/wfpt.pyx"; static const char __pyx_k_wiener_like_rlssm_nn[] = "wiener_like_rlssm_nn"; static const char __pyx_k_wiener_like_contaminant[] = "wiener_like_contaminant"; static const char __pyx_k_wiener_like_multi_rlddm[] = "wiener_like_multi_rlddm"; @@ -2937,22 +3040,25 @@ static const char __pyx_k_wiener_like_multi_nn_mlp_pdf[] = "wiener_like_multi_nn static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_at_least_one_of_the_parameters_i[] = "at least one of the parameters is out of the support"; static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_src_hssm_likelihoods_hddm_wfpt_p[] = "src/hssm/likelihoods/hddm_wfpt/pdf.pxi"; +static const char __pyx_k_src_hssm_likelihoods_hddm_wfpt_w[] = "src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4wfpt_full_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err); /* proto */ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_logp, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_sv, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_z, PyArrayObject *__pyx_v_sz, PyArrayObject *__pyx_v_t, PyArrayObject *__pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_model, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_ssm, PyArrayObject *__pyx_v_params_rl, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ -static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_err, CYTHON_UNUSED int __pyx_v_n_st, CYTHON_UNUSED int __pyx_v_n_sz, CYTHON_UNUSED int __pyx_v_use_adaptive, CYTHON_UNUSED double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, PyObject *__pyx_v_alpha, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_rl_arr, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ -static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_cont_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_t_min, double __pyx_v_t_max, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err); /* proto */ -static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_N, double __pyx_v_time, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_data); /* proto */ -static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ -static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ +static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_sv, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_z, PyArrayObject *__pyx_v_sz, PyArrayObject *__pyx_v_t, PyArrayObject *__pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_model, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_ssm, PyArrayObject *__pyx_v_params_rl, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ +static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_err, CYTHON_UNUSED int __pyx_v_n_st, CYTHON_UNUSED int __pyx_v_n_sz, CYTHON_UNUSED int __pyx_v_use_adaptive, CYTHON_UNUSED double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, PyObject *__pyx_v_alpha, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_rl_arr, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ +static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_cont_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_t_min, double __pyx_v_t_max, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err); /* proto */ +static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_N, double __pyx_v_time, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ +static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_data); /* proto */ +static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ +static PyObject *__pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { @@ -3021,9 +3127,9 @@ typedef struct { PyObject *__pyx_n_s_ImportError; PyObject *__pyx_n_s_N; PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_n_s__23; - PyObject *__pyx_kp_u__24; - PyObject *__pyx_n_s__40; + PyObject *__pyx_n_s__24; + PyObject *__pyx_kp_u__25; + PyObject *__pyx_n_s__41; PyObject *__pyx_n_s_a; PyObject *__pyx_n_u_a; PyObject *__pyx_n_s_alfa; @@ -3059,8 +3165,6 @@ typedef struct { PyObject *__pyx_n_s_float32; PyObject *__pyx_n_s_full_pdf; PyObject *__pyx_n_s_gen_cdf_using_pdf; - PyObject *__pyx_kp_s_hddm_wfpt_pdf_pxi; - PyObject *__pyx_kp_s_hddm_wfpt_wfpt_pyx; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_i_p; PyObject *__pyx_n_s_idx; @@ -3125,6 +3229,8 @@ typedef struct { PyObject *__pyx_n_s_split_by; PyObject *__pyx_n_s_split_cdf; PyObject *__pyx_n_s_squeeze; + PyObject *__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p; + PyObject *__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w; PyObject *__pyx_n_s_st; PyObject *__pyx_n_u_st; PyObject *__pyx_n_s_stack; @@ -3178,13 +3284,12 @@ typedef struct { PyObject *__pyx_int_2; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; - PyObject *__pyx_slice__7; + PyObject *__pyx_slice__8; PyObject *__pyx_tuple__2; - PyObject *__pyx_slice__10; - PyObject *__pyx_slice__19; - PyObject *__pyx_tuple__17; - PyObject *__pyx_tuple__22; - PyObject *__pyx_tuple__25; + PyObject *__pyx_slice__11; + PyObject *__pyx_slice__20; + PyObject *__pyx_tuple__18; + PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; @@ -3199,21 +3304,23 @@ typedef struct { PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__39; + PyObject *__pyx_tuple__40; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__8; + PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__11; + PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__18; - PyObject *__pyx_codeobj__20; + PyObject *__pyx_codeobj__17; + PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; + PyObject *__pyx_codeobj__22; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -3275,9 +3382,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_n_s_N); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_n_s__23); - Py_CLEAR(clear_module_state->__pyx_kp_u__24); - Py_CLEAR(clear_module_state->__pyx_n_s__40); + Py_CLEAR(clear_module_state->__pyx_n_s__24); + Py_CLEAR(clear_module_state->__pyx_kp_u__25); + Py_CLEAR(clear_module_state->__pyx_n_s__41); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_u_a); Py_CLEAR(clear_module_state->__pyx_n_s_alfa); @@ -3313,8 +3420,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_float32); Py_CLEAR(clear_module_state->__pyx_n_s_full_pdf); Py_CLEAR(clear_module_state->__pyx_n_s_gen_cdf_using_pdf); - Py_CLEAR(clear_module_state->__pyx_kp_s_hddm_wfpt_pdf_pxi); - Py_CLEAR(clear_module_state->__pyx_kp_s_hddm_wfpt_wfpt_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_i_p); Py_CLEAR(clear_module_state->__pyx_n_s_idx); @@ -3379,6 +3484,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_split_by); Py_CLEAR(clear_module_state->__pyx_n_s_split_cdf); Py_CLEAR(clear_module_state->__pyx_n_s_squeeze); + Py_CLEAR(clear_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p); + Py_CLEAR(clear_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w); Py_CLEAR(clear_module_state->__pyx_n_s_st); Py_CLEAR(clear_module_state->__pyx_n_u_st); Py_CLEAR(clear_module_state->__pyx_n_s_stack); @@ -3432,13 +3539,12 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); - Py_CLEAR(clear_module_state->__pyx_slice__7); + Py_CLEAR(clear_module_state->__pyx_slice__8); Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_slice__10); - Py_CLEAR(clear_module_state->__pyx_slice__19); - Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_tuple__22); - Py_CLEAR(clear_module_state->__pyx_tuple__25); + Py_CLEAR(clear_module_state->__pyx_slice__11); + Py_CLEAR(clear_module_state->__pyx_slice__20); + Py_CLEAR(clear_module_state->__pyx_tuple__18); + Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); @@ -3453,21 +3559,23 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__39); + Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__8); + Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); + Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__18); - Py_CLEAR(clear_module_state->__pyx_codeobj__20); + Py_CLEAR(clear_module_state->__pyx_codeobj__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); + Py_CLEAR(clear_module_state->__pyx_codeobj__22); return 0; } #endif @@ -3507,9 +3615,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_n_s_N); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_n_s__23); - Py_VISIT(traverse_module_state->__pyx_kp_u__24); - Py_VISIT(traverse_module_state->__pyx_n_s__40); + Py_VISIT(traverse_module_state->__pyx_n_s__24); + Py_VISIT(traverse_module_state->__pyx_kp_u__25); + Py_VISIT(traverse_module_state->__pyx_n_s__41); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_u_a); Py_VISIT(traverse_module_state->__pyx_n_s_alfa); @@ -3545,8 +3653,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_float32); Py_VISIT(traverse_module_state->__pyx_n_s_full_pdf); Py_VISIT(traverse_module_state->__pyx_n_s_gen_cdf_using_pdf); - Py_VISIT(traverse_module_state->__pyx_kp_s_hddm_wfpt_pdf_pxi); - Py_VISIT(traverse_module_state->__pyx_kp_s_hddm_wfpt_wfpt_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_i_p); Py_VISIT(traverse_module_state->__pyx_n_s_idx); @@ -3611,6 +3717,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_split_by); Py_VISIT(traverse_module_state->__pyx_n_s_split_cdf); Py_VISIT(traverse_module_state->__pyx_n_s_squeeze); + Py_VISIT(traverse_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p); + Py_VISIT(traverse_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w); Py_VISIT(traverse_module_state->__pyx_n_s_st); Py_VISIT(traverse_module_state->__pyx_n_u_st); Py_VISIT(traverse_module_state->__pyx_n_s_stack); @@ -3664,13 +3772,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); - Py_VISIT(traverse_module_state->__pyx_slice__7); + Py_VISIT(traverse_module_state->__pyx_slice__8); Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_slice__10); - Py_VISIT(traverse_module_state->__pyx_slice__19); - Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_tuple__22); - Py_VISIT(traverse_module_state->__pyx_tuple__25); + Py_VISIT(traverse_module_state->__pyx_slice__11); + Py_VISIT(traverse_module_state->__pyx_slice__20); + Py_VISIT(traverse_module_state->__pyx_tuple__18); + Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); @@ -3685,21 +3792,23 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__39); + Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__8); + Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); + Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__18); - Py_VISIT(traverse_module_state->__pyx_codeobj__20); + Py_VISIT(traverse_module_state->__pyx_codeobj__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); + Py_VISIT(traverse_module_state->__pyx_codeobj__22); return 0; } #endif @@ -3769,9 +3878,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_n_s_N __pyx_mstate_global->__pyx_n_s_N #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_n_s__23 __pyx_mstate_global->__pyx_n_s__23 -#define __pyx_kp_u__24 __pyx_mstate_global->__pyx_kp_u__24 -#define __pyx_n_s__40 __pyx_mstate_global->__pyx_n_s__40 +#define __pyx_n_s__24 __pyx_mstate_global->__pyx_n_s__24 +#define __pyx_kp_u__25 __pyx_mstate_global->__pyx_kp_u__25 +#define __pyx_n_s__41 __pyx_mstate_global->__pyx_n_s__41 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_u_a __pyx_mstate_global->__pyx_n_u_a #define __pyx_n_s_alfa __pyx_mstate_global->__pyx_n_s_alfa @@ -3807,8 +3916,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_float32 __pyx_mstate_global->__pyx_n_s_float32 #define __pyx_n_s_full_pdf __pyx_mstate_global->__pyx_n_s_full_pdf #define __pyx_n_s_gen_cdf_using_pdf __pyx_mstate_global->__pyx_n_s_gen_cdf_using_pdf -#define __pyx_kp_s_hddm_wfpt_pdf_pxi __pyx_mstate_global->__pyx_kp_s_hddm_wfpt_pdf_pxi -#define __pyx_kp_s_hddm_wfpt_wfpt_pyx __pyx_mstate_global->__pyx_kp_s_hddm_wfpt_wfpt_pyx #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_i_p __pyx_mstate_global->__pyx_n_s_i_p #define __pyx_n_s_idx __pyx_mstate_global->__pyx_n_s_idx @@ -3873,6 +3980,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_split_by __pyx_mstate_global->__pyx_n_s_split_by #define __pyx_n_s_split_cdf __pyx_mstate_global->__pyx_n_s_split_cdf #define __pyx_n_s_squeeze __pyx_mstate_global->__pyx_n_s_squeeze +#define __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p __pyx_mstate_global->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p +#define __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w __pyx_mstate_global->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w #define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st #define __pyx_n_u_st __pyx_mstate_global->__pyx_n_u_st #define __pyx_n_s_stack __pyx_mstate_global->__pyx_n_s_stack @@ -3926,13 +4035,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ -#define __pyx_slice__7 __pyx_mstate_global->__pyx_slice__7 +#define __pyx_slice__8 __pyx_mstate_global->__pyx_slice__8 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_slice__10 __pyx_mstate_global->__pyx_slice__10 -#define __pyx_slice__19 __pyx_mstate_global->__pyx_slice__19 -#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 -#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 +#define __pyx_slice__11 __pyx_mstate_global->__pyx_slice__11 +#define __pyx_slice__20 __pyx_mstate_global->__pyx_slice__20 +#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 +#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 @@ -3947,24 +4055,26 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 +#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 +#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 +#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 -#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 +#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 +#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 /* #### Code section: module_code ### */ -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -3983,7 +4093,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject #endif __Pyx_TraceCall("base", __pyx_f[1], 245, 1, __PYX_ERR(1, 245, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248 * """Returns a borrowed reference to the object owning the data/memory. * """ * return PyArray_BASE(self) # <<<<<<<<<<<<<< @@ -3994,7 +4104,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -4008,7 +4118,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("numpy.ndarray.base.base", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __pyx_r = NULL; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif @@ -4017,7 +4127,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -4036,7 +4146,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __Pyx_RefNannySetupContext("descr", 0); __Pyx_TraceCall("descr", __pyx_f[1], 251, 0, __PYX_ERR(1, 251, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254 * """Returns an owned reference to the dtype of the array. * """ * return PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -4050,7 +4160,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -4069,7 +4179,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -4088,7 +4198,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx #endif __Pyx_TraceCall("ndim", __pyx_f[1], 257, 1, __PYX_ERR(1, 257, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260 * """Returns the number of dimensions in the array. * """ * return PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -4099,7 +4209,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -4122,7 +4232,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -4141,7 +4251,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec #endif __Pyx_TraceCall("shape", __pyx_f[1], 263, 1, __PYX_ERR(1, 263, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268 * Can return NULL for 0-dimensional arrays. * """ * return PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -4152,7 +4262,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -4166,7 +4276,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("numpy.ndarray.shape.shape", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __pyx_r = NULL; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif @@ -4175,7 +4285,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -4194,7 +4304,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO #endif __Pyx_TraceCall("strides", __pyx_f[1], 271, 1, __PYX_ERR(1, 271, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275 * The number of elements matches the number of dimensions of the array (ndim). * """ * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -4205,7 +4315,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -4219,7 +4329,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("numpy.ndarray.strides.strides", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __pyx_r = NULL; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif @@ -4228,7 +4338,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -4247,7 +4357,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * #endif __Pyx_TraceCall("size", __pyx_f[1], 278, 1, __PYX_ERR(1, 278, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281 * """Returns the total size (in number of elements) of the array. * """ * return PyArray_SIZE(self) # <<<<<<<<<<<<<< @@ -4258,7 +4368,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -4281,7 +4391,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -4300,7 +4410,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p #endif __Pyx_TraceCall("data", __pyx_f[1], 284, 1, __PYX_ERR(1, 284, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290 * of `PyArray_DATA()` instead, which returns a 'void*'. * """ * return PyArray_BYTES(self) # <<<<<<<<<<<<<< @@ -4311,7 +4421,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -4334,7 +4444,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4353,7 +4463,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[1], 773, 0, __PYX_ERR(1, 773, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -4368,7 +4478,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4388,7 +4498,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4407,7 +4517,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[1], 776, 0, __PYX_ERR(1, 776, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -4422,7 +4532,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4442,7 +4552,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4461,7 +4571,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[1], 779, 0, __PYX_ERR(1, 779, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -4476,7 +4586,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4496,7 +4606,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4515,7 +4625,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[1], 782, 0, __PYX_ERR(1, 782, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -4530,7 +4640,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4550,7 +4660,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4569,7 +4679,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[1], 785, 0, __PYX_ERR(1, 785, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -4584,7 +4694,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4604,7 +4714,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4623,7 +4733,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[1], 788, 0, __PYX_ERR(1, 788, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4634,7 +4744,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":790 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -4647,7 +4757,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4656,7 +4766,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -4671,7 +4781,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4690,7 +4800,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4708,7 +4818,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannySetupContext("set_array_base", 0); __Pyx_TraceCall("set_array_base", __pyx_f[1], 967, 0, __PYX_ERR(1, 967, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -4718,7 +4828,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_TraceLine(968,0,__PYX_ERR(1, 968, __pyx_L1_error)) Py_INCREF(__pyx_v_base); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -4728,7 +4838,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_TraceLine(969,0,__PYX_ERR(1, 969, __pyx_L1_error)) __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4745,7 +4855,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4765,7 +4875,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannySetupContext("get_array_base", 0); __Pyx_TraceCall("get_array_base", __pyx_f[1], 971, 0, __PYX_ERR(1, 971, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -4775,7 +4885,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_TraceLine(972,0,__PYX_ERR(1, 972, __pyx_L1_error)) __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4786,7 +4896,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -4798,7 +4908,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4807,7 +4917,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -4820,7 +4930,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4839,7 +4949,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4865,7 +4975,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_RefNannySetupContext("import_array", 0); __Pyx_TraceCall("import_array", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4882,7 +4992,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -4892,7 +5002,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L3_error)) __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4906,7 +5016,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -4922,7 +5032,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -4938,7 +5048,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { } goto __pyx_L5_except_error; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4954,7 +5064,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4978,7 +5088,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -5004,7 +5114,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_RefNannySetupContext("import_umath", 0); __Pyx_TraceCall("import_umath", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5021,7 +5131,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -5031,7 +5141,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L3_error)) __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5045,7 +5155,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -5061,7 +5171,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -5077,7 +5187,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { } goto __pyx_L5_except_error; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5093,7 +5203,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -5117,7 +5227,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -5143,7 +5253,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_RefNannySetupContext("import_ufunc", 0); __Pyx_TraceCall("import_ufunc", __pyx_f[1], 991, 0, __PYX_ERR(1, 991, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5160,7 +5270,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -5170,7 +5280,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L3_error)) __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5184,7 +5294,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -5200,7 +5310,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -5216,7 +5326,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { } goto __pyx_L5_except_error; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5232,7 +5342,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -5256,7 +5366,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -5274,7 +5384,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannySetupContext("is_timedelta64_object", 0); __Pyx_TraceCall("is_timedelta64_object", __pyx_f[1], 998, 0, __PYX_ERR(1, 998, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -5285,7 +5395,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -5303,7 +5413,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -5321,7 +5431,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannySetupContext("is_datetime64_object", 0); __Pyx_TraceCall("is_datetime64_object", __pyx_f[1], 1013, 0, __PYX_ERR(1, 1013, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -5332,7 +5442,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -5350,7 +5460,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -5369,7 +5479,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * #endif __Pyx_TraceCall("get_datetime64_value", __pyx_f[1], 1028, 1, __PYX_ERR(1, 1028, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -5380,7 +5490,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -5403,7 +5513,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -5422,7 +5532,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject #endif __Pyx_TraceCall("get_timedelta64_value", __pyx_f[1], 1038, 1, __PYX_ERR(1, 1038, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1042 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -5433,7 +5543,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -5456,7 +5566,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -5475,7 +5585,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec #endif __Pyx_TraceCall("get_datetime64_unit", __pyx_f[1], 1045, 1, __PYX_ERR(1, 1045, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1049 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -5484,7 +5594,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -5507,7 +5617,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec return __pyx_r; } -/* "hddm_wfpt/pdf.pxi":28 +/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 * T max[T](T a, T b) * * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< @@ -5535,7 +5645,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double #endif __Pyx_TraceCall("ftt_01w", __pyx_f[2], 28, 1, __PYX_ERR(2, 28, __pyx_L1_error)); - /* "hddm_wfpt/pdf.pxi":36 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":36 * * # calculate number of terms needed for large t * if M_PI*tt*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< @@ -5546,7 +5656,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_t_1 = (((M_PI * __pyx_v_tt) * __pyx_v_err) < 1.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":37 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":37 * # calculate number of terms needed for large t * if M_PI*tt*err<1: # if error threshold is set low enough * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound # <<<<<<<<<<<<<< @@ -5556,7 +5666,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(37,1,__PYX_ERR(2, 37, __pyx_L1_error)) __pyx_v_kl = sqrt(((-2.0 * log(((M_PI * __pyx_v_tt) * __pyx_v_err))) / (pow(M_PI, 2.0) * __pyx_v_tt))); - /* "hddm_wfpt/pdf.pxi":38 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":38 * if M_PI*tt*err<1: # if error threshold is set low enough * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met # <<<<<<<<<<<<<< @@ -5566,7 +5676,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(38,1,__PYX_ERR(2, 38, __pyx_L1_error)) __pyx_v_kl = std::max(__pyx_v_kl, (1. / (M_PI * sqrt(__pyx_v_tt)))); - /* "hddm_wfpt/pdf.pxi":36 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":36 * * # calculate number of terms needed for large t * if M_PI*tt*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< @@ -5576,7 +5686,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double goto __pyx_L3; } - /* "hddm_wfpt/pdf.pxi":40 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":40 * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met * else: # if error threshold set too high * kl=1./(M_PI*sqrt(tt)) # set to boundary condition # <<<<<<<<<<<<<< @@ -5589,7 +5699,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double } __pyx_L3:; - /* "hddm_wfpt/pdf.pxi":43 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":43 * * # calculate number of terms needed for small t * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< @@ -5600,7 +5710,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_t_1 = (((2.0 * sqrt(((2.0 * M_PI) * __pyx_v_tt))) * __pyx_v_err) < 1.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":44 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":44 * # calculate number of terms needed for small t * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound # <<<<<<<<<<<<<< @@ -5610,7 +5720,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(44,1,__PYX_ERR(2, 44, __pyx_L1_error)) __pyx_v_ks = (2.0 + sqrt(((-2.0 * __pyx_v_tt) * log(((2.0 * sqrt(((2.0 * M_PI) * __pyx_v_tt))) * __pyx_v_err))))); - /* "hddm_wfpt/pdf.pxi":45 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":45 * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met # <<<<<<<<<<<<<< @@ -5620,7 +5730,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(45,1,__PYX_ERR(2, 45, __pyx_L1_error)) __pyx_v_ks = std::max(__pyx_v_ks, (sqrt(__pyx_v_tt) + 1.0)); - /* "hddm_wfpt/pdf.pxi":43 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":43 * * # calculate number of terms needed for small t * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< @@ -5630,7 +5740,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double goto __pyx_L4; } - /* "hddm_wfpt/pdf.pxi":47 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":47 * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met * else: # if error threshold was set too high * ks=2 # minimal kappa for that case # <<<<<<<<<<<<<< @@ -5643,7 +5753,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double } __pyx_L4:; - /* "hddm_wfpt/pdf.pxi":50 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":50 * * # compute f(tt|0,1,w) * p=0 #initialize density # <<<<<<<<<<<<<< @@ -5653,7 +5763,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(50,1,__PYX_ERR(2, 50, __pyx_L1_error)) __pyx_v_p = 0.0; - /* "hddm_wfpt/pdf.pxi":51 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":51 * # compute f(tt|0,1,w) * p=0 #initialize density * if ks(ceil(ks)) # round to smallest integer meeting error # <<<<<<<<<<<<<< @@ -5674,7 +5784,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(52,1,__PYX_ERR(2, 52, __pyx_L1_error)) __pyx_v_K = ((int)ceil(__pyx_v_ks)); - /* "hddm_wfpt/pdf.pxi":53 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":53 * if ks(ceil(ks)) # round to smallest integer meeting error * lower = (-floor((K-1)/2.)) # <<<<<<<<<<<<<< @@ -5684,7 +5794,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(53,1,__PYX_ERR(2, 53, __pyx_L1_error)) __pyx_v_lower = ((int)(-floor((((double)(__pyx_v_K - 1)) / 2.)))); - /* "hddm_wfpt/pdf.pxi":54 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":54 * K=(ceil(ks)) # round to smallest integer meeting error * lower = (-floor((K-1)/2.)) * upper = (ceil((K-1)/2.)) # <<<<<<<<<<<<<< @@ -5694,7 +5804,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(54,1,__PYX_ERR(2, 54, __pyx_L1_error)) __pyx_v_upper = ((int)ceil((((double)(__pyx_v_K - 1)) / 2.))); - /* "hddm_wfpt/pdf.pxi":55 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":55 * lower = (-floor((K-1)/2.)) * upper = (ceil((K-1)/2.)) * for k from lower <= k <= upper: # loop over k # <<<<<<<<<<<<<< @@ -5705,7 +5815,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_t_2 = __pyx_v_upper; for (__pyx_v_k = __pyx_v_lower; __pyx_v_k <= __pyx_t_2; __pyx_v_k++) { - /* "hddm_wfpt/pdf.pxi":56 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":56 * upper = (ceil((K-1)/2.)) * for k from lower <= k <= upper: # loop over k * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum # <<<<<<<<<<<<<< @@ -5716,7 +5826,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_v_p = (__pyx_v_p + ((__pyx_v_w + (2 * __pyx_v_k)) * exp((((-pow((__pyx_v_w + (2 * __pyx_v_k)), 2.0)) / 2.0) / __pyx_v_tt)))); } - /* "hddm_wfpt/pdf.pxi":57 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":57 * for k from lower <= k <= upper: # loop over k * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum * p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term # <<<<<<<<<<<<<< @@ -5726,7 +5836,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceLine(57,1,__PYX_ERR(2, 57, __pyx_L1_error)) __pyx_v_p = (__pyx_v_p / sqrt(((2.0 * M_PI) * pow(__pyx_v_tt, 3.0)))); - /* "hddm_wfpt/pdf.pxi":51 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":51 * # compute f(tt|0,1,w) * p=0 #initialize density * if ks(ceil(kl)) # round to smallest integer meeting error # <<<<<<<<<<<<<< @@ -5747,7 +5857,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double /*else*/ { __pyx_v_K = ((int)ceil(__pyx_v_kl)); - /* "hddm_wfpt/pdf.pxi":61 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":61 * else: # if large t is better... * K=(ceil(kl)) # round to smallest integer meeting error * for k from 1 <= k <= K: # <<<<<<<<<<<<<< @@ -5758,7 +5868,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_t_2 = __pyx_v_K; for (__pyx_v_k = 1; __pyx_v_k <= __pyx_t_2; __pyx_v_k++) { - /* "hddm_wfpt/pdf.pxi":62 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":62 * K=(ceil(kl)) # round to smallest integer meeting error * for k from 1 <= k <= K: * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum # <<<<<<<<<<<<<< @@ -5769,7 +5879,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_v_p = (__pyx_v_p + ((__pyx_v_k * exp(((((-pow(__pyx_v_k, 2.0)) * pow(M_PI, 2.0)) * __pyx_v_tt) / 2.0))) * sin(((__pyx_v_k * M_PI) * __pyx_v_w)))); } - /* "hddm_wfpt/pdf.pxi":63 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":63 * for k from 1 <= k <= K: * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum * p*=M_PI # add con_stant term # <<<<<<<<<<<<<< @@ -5781,7 +5891,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double } __pyx_L5:; - /* "hddm_wfpt/pdf.pxi":65 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":65 * p*=M_PI # add con_stant term * * return p # <<<<<<<<<<<<<< @@ -5792,7 +5902,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_r = __pyx_v_p; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":28 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 * T max[T](T a, T b) * * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< @@ -5815,7 +5925,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double return __pyx_r; } -/* "hddm_wfpt/pdf.pxi":67 +/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 * return p * * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< @@ -5835,7 +5945,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx #endif __Pyx_TraceCall("prob_ub", __pyx_f[2], 67, 1, __PYX_ERR(2, 67, __pyx_L1_error)); - /* "hddm_wfpt/pdf.pxi":69 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":69 * cdef inline double prob_ub(double v, double a, double z) nogil: * """Probability of hitting upper boundary.""" * if v == 0: # <<<<<<<<<<<<<< @@ -5846,7 +5956,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx __pyx_t_1 = (__pyx_v_v == 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":70 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":70 * """Probability of hitting upper boundary.""" * if v == 0: * return z # <<<<<<<<<<<<<< @@ -5857,7 +5967,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx __pyx_r = __pyx_v_z; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":69 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":69 * cdef inline double prob_ub(double v, double a, double z) nogil: * """Probability of hitting upper boundary.""" * if v == 0: # <<<<<<<<<<<<<< @@ -5866,7 +5976,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx */ } - /* "hddm_wfpt/pdf.pxi":72 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":72 * return z * else: * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) # <<<<<<<<<<<<<< @@ -5879,7 +5989,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx goto __pyx_L0; } - /* "hddm_wfpt/pdf.pxi":67 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 * return p * * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< @@ -5902,7 +6012,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx return __pyx_r; } -/* "hddm_wfpt/pdf.pxi":74 +/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) * * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< @@ -5915,6 +6025,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx double __pyx_v_p; double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations int __pyx_t_1; double __pyx_t_2; int __pyx_lineno = 0; @@ -5923,9 +6034,10 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif + __Pyx_RefNannySetupContext("pdf", 1); __Pyx_TraceCall("pdf", __pyx_f[2], 74, 1, __PYX_ERR(2, 74, __pyx_L1_error)); - /* "hddm_wfpt/pdf.pxi":78 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":78 * and implementation of Navarro & Fuss, 2009. * """ * if x <= 0: # <<<<<<<<<<<<<< @@ -5936,7 +6048,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx __pyx_t_1 = (__pyx_v_x <= 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":79 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":79 * """ * if x <= 0: * return 0 # <<<<<<<<<<<<<< @@ -5947,7 +6059,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx __pyx_r = 0.0; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":78 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":78 * and implementation of Navarro & Fuss, 2009. * """ * if x <= 0: # <<<<<<<<<<<<<< @@ -5956,7 +6068,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx */ } - /* "hddm_wfpt/pdf.pxi":81 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":81 * return 0 * * cdef double tt = x/a**2 # use normalized time # <<<<<<<<<<<<<< @@ -5966,7 +6078,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx __Pyx_TraceLine(81,1,__PYX_ERR(2, 81, __pyx_L1_error)) __pyx_v_tt = (__pyx_v_x / pow(__pyx_v_a, 2.0)); - /* "hddm_wfpt/pdf.pxi":82 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":82 * * cdef double tt = x/a**2 # use normalized time * cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) # <<<<<<<<<<<<<< @@ -5977,7 +6089,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx __pyx_t_2 = __pyx_f_4wfpt_ftt_01w(__pyx_v_tt, __pyx_v_w, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 82, __pyx_L1_error) __pyx_v_p = __pyx_t_2; - /* "hddm_wfpt/pdf.pxi":85 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":85 * * # convert to f(t|v,a,w) * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) # <<<<<<<<<<<<<< @@ -5988,7 +6100,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx __pyx_r = ((__pyx_v_p * exp(((((-__pyx_v_v) * __pyx_v_a) * __pyx_v_w) - ((pow(__pyx_v_v, 2.0) * __pyx_v_x) / 2.)))) / pow(__pyx_v_a, 2.0)); goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":74 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) * * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< @@ -6008,10 +6120,11 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } -/* "hddm_wfpt/pdf.pxi":87 +/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) * * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< @@ -6024,6 +6137,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ double __pyx_v_p; double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations int __pyx_t_1; double __pyx_t_2; int __pyx_lineno = 0; @@ -6032,9 +6146,10 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif + __Pyx_RefNannySetupContext("pdf_sv", 1); __Pyx_TraceCall("pdf_sv", __pyx_f[2], 87, 1, __PYX_ERR(2, 87, __pyx_L1_error)); - /* "hddm_wfpt/pdf.pxi":92 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":92 * sv is the std of the drift rate * """ * if x <= 0: # <<<<<<<<<<<<<< @@ -6045,7 +6160,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ __pyx_t_1 = (__pyx_v_x <= 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":93 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":93 * """ * if x <= 0: * return 0 # <<<<<<<<<<<<<< @@ -6056,7 +6171,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ __pyx_r = 0.0; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":92 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":92 * sv is the std of the drift rate * """ * if x <= 0: # <<<<<<<<<<<<<< @@ -6065,7 +6180,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ */ } - /* "hddm_wfpt/pdf.pxi":95 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":95 * return 0 * * if sv==0: # <<<<<<<<<<<<<< @@ -6076,7 +6191,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ __pyx_t_1 = (__pyx_v_sv == 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":96 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":96 * * if sv==0: * return pdf(x, v, a, z, err) # <<<<<<<<<<<<<< @@ -6088,7 +6203,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ __pyx_r = __pyx_t_2; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":95 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":95 * return 0 * * if sv==0: # <<<<<<<<<<<<<< @@ -6097,7 +6212,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ */ } - /* "hddm_wfpt/pdf.pxi":98 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":98 * return pdf(x, v, a, z, err) * * cdef double tt = x/(pow(a,2)) # use normalized time # <<<<<<<<<<<<<< @@ -6107,7 +6222,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ __Pyx_TraceLine(98,1,__PYX_ERR(2, 98, __pyx_L1_error)) __pyx_v_tt = (__pyx_v_x / pow(__pyx_v_a, 2.0)); - /* "hddm_wfpt/pdf.pxi":99 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":99 * * cdef double tt = x/(pow(a,2)) # use normalized time * cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) # <<<<<<<<<<<<<< @@ -6118,7 +6233,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ __pyx_t_2 = __pyx_f_4wfpt_ftt_01w(__pyx_v_tt, __pyx_v_z, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 99, __pyx_L1_error) __pyx_v_p = __pyx_t_2; - /* "hddm_wfpt/pdf.pxi":102 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":102 * * # convert to f(t|v,a,w) * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) # <<<<<<<<<<<<<< @@ -6129,7 +6244,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ __pyx_r = ((exp((log(__pyx_v_p) + (((pow(((__pyx_v_a * __pyx_v_z) * __pyx_v_sv), 2.0) - (((2.0 * __pyx_v_a) * __pyx_v_v) * __pyx_v_z)) - (pow(__pyx_v_v, 2.0) * __pyx_v_x)) / (((2.0 * pow(__pyx_v_sv, 2.0)) * __pyx_v_x) + 2.0)))) / sqrt(((pow(__pyx_v_sv, 2.0) * __pyx_v_x) + 1.0))) / pow(__pyx_v_a, 2.0)); goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":87 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) * * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< @@ -6149,10 +6264,11 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } -/* "hddm_wfpt/pdf.pxi":104 +/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< @@ -6174,6 +6290,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double double __pyx_v_simps_err = ((double)1e-3); double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; double __pyx_t_3; @@ -6184,6 +6301,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double PyGILState_STATE __pyx_gilstate_save; #endif __Pyx_TraceFrameInit(__pyx_codeobj__3) + __Pyx_RefNannySetupContext("full_pdf", 1); __Pyx_TraceCall("full_pdf", __pyx_f[2], 104, 1, __PYX_ERR(2, 104, __pyx_L1_error)); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { @@ -6200,7 +6318,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double } } - /* "hddm_wfpt/pdf.pxi":111 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 * * # Check if parpameters are valid * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< @@ -6257,7 +6375,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double goto __pyx_L4_bool_binop_done; } - /* "hddm_wfpt/pdf.pxi":112 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":112 * # Check if parpameters are valid * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): # <<<<<<<<<<<<<< @@ -6287,7 +6405,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "hddm_wfpt/pdf.pxi":111 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 * * # Check if parpameters are valid * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< @@ -6297,7 +6415,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __Pyx_TraceLine(111,1,__PYX_ERR(2, 111, __pyx_L1_error)) if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":113 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":113 * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): * return 0 # <<<<<<<<<<<<<< @@ -6308,7 +6426,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_r = 0.0; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":111 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 * * # Check if parpameters are valid * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< @@ -6317,7 +6435,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":116 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":116 * * # transform x,v,z if x is upper bound response * if x > 0: # <<<<<<<<<<<<<< @@ -6328,7 +6446,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_t_1 = (__pyx_v_x > 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":117 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":117 * # transform x,v,z if x is upper bound response * if x > 0: * v = -v # <<<<<<<<<<<<<< @@ -6338,7 +6456,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __Pyx_TraceLine(117,1,__PYX_ERR(2, 117, __pyx_L1_error)) __pyx_v_v = (-__pyx_v_v); - /* "hddm_wfpt/pdf.pxi":118 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":118 * if x > 0: * v = -v * z = 1.-z # <<<<<<<<<<<<<< @@ -6348,7 +6466,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __Pyx_TraceLine(118,1,__PYX_ERR(2, 118, __pyx_L1_error)) __pyx_v_z = (1. - __pyx_v_z); - /* "hddm_wfpt/pdf.pxi":116 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":116 * * # transform x,v,z if x is upper bound response * if x > 0: # <<<<<<<<<<<<<< @@ -6357,7 +6475,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":120 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":120 * z = 1.-z * * x = fabs(x) # <<<<<<<<<<<<<< @@ -6367,7 +6485,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __Pyx_TraceLine(120,1,__PYX_ERR(2, 120, __pyx_L1_error)) __pyx_v_x = fabs(__pyx_v_x); - /* "hddm_wfpt/pdf.pxi":122 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":122 * x = fabs(x) * * if st<1e-3: # <<<<<<<<<<<<<< @@ -6378,7 +6496,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_t_1 = (__pyx_v_st < 1e-3); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":123 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":123 * * if st<1e-3: * st = 0 # <<<<<<<<<<<<<< @@ -6388,7 +6506,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __Pyx_TraceLine(123,1,__PYX_ERR(2, 123, __pyx_L1_error)) __pyx_v_st = 0.0; - /* "hddm_wfpt/pdf.pxi":122 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":122 * x = fabs(x) * * if st<1e-3: # <<<<<<<<<<<<<< @@ -6397,7 +6515,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":124 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":124 * if st<1e-3: * st = 0 * if sz <1e-3: # <<<<<<<<<<<<<< @@ -6408,7 +6526,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_t_1 = (__pyx_v_sz < 1e-3); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":125 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":125 * st = 0 * if sz <1e-3: * sz = 0 # <<<<<<<<<<<<<< @@ -6418,7 +6536,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __Pyx_TraceLine(125,1,__PYX_ERR(2, 125, __pyx_L1_error)) __pyx_v_sz = 0.0; - /* "hddm_wfpt/pdf.pxi":124 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":124 * if st<1e-3: * st = 0 * if sz <1e-3: # <<<<<<<<<<<<<< @@ -6427,7 +6545,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":127 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":127 * sz = 0 * * if (sz==0): # <<<<<<<<<<<<<< @@ -6438,7 +6556,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_t_1 = (__pyx_v_sz == 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":128 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":128 * * if (sz==0): * if (st==0): #sv=0,sz=0,st=0 # <<<<<<<<<<<<<< @@ -6449,7 +6567,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_t_1 = (__pyx_v_st == 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":129 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":129 * if (sz==0): * if (st==0): #sv=0,sz=0,st=0 * return pdf_sv(x - t, v, sv, a, z, err) # <<<<<<<<<<<<<< @@ -6461,7 +6579,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_r = __pyx_t_3; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":128 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":128 * * if (sz==0): * if (st==0): #sv=0,sz=0,st=0 # <<<<<<<<<<<<<< @@ -6470,7 +6588,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":131 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":131 * return pdf_sv(x - t, v, sv, a, z, err) * else: #sv=0,sz=0,st=$ * if use_adaptive>0: # <<<<<<<<<<<<<< @@ -6482,7 +6600,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_t_1 = (__pyx_v_use_adaptive > 0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":132 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":132 * else: #sv=0,sz=0,st=$ * if use_adaptive>0: * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) # <<<<<<<<<<<<<< @@ -6494,7 +6612,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_r = __pyx_t_3; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":131 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":131 * return pdf_sv(x - t, v, sv, a, z, err) * else: #sv=0,sz=0,st=$ * if use_adaptive>0: # <<<<<<<<<<<<<< @@ -6503,7 +6621,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":134 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":134 * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) * else: * return simpson_1D(x, v, sv, a, z, t, err, z, z, 0, t-st/2., t+st/2., n_st) # <<<<<<<<<<<<<< @@ -6518,7 +6636,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double } } - /* "hddm_wfpt/pdf.pxi":127 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":127 * sz = 0 * * if (sz==0): # <<<<<<<<<<<<<< @@ -6527,7 +6645,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":137 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":137 * * else: #sz=$ * if (st==0): #sv=0,sz=$,st=0 # <<<<<<<<<<<<<< @@ -6539,7 +6657,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_t_1 = (__pyx_v_st == 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/pdf.pxi":138 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":138 * else: #sz=$ * if (st==0): #sv=0,sz=$,st=0 * if use_adaptive: # <<<<<<<<<<<<<< @@ -6549,7 +6667,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __Pyx_TraceLine(138,1,__PYX_ERR(2, 138, __pyx_L1_error)) if (__pyx_v_use_adaptive) { - /* "hddm_wfpt/pdf.pxi":139 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":139 * if (st==0): #sv=0,sz=$,st=0 * if use_adaptive: * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) # <<<<<<<<<<<<<< @@ -6561,7 +6679,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_r = __pyx_t_3; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":138 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":138 * else: #sz=$ * if (st==0): #sv=0,sz=$,st=0 * if use_adaptive: # <<<<<<<<<<<<<< @@ -6570,7 +6688,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":141 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":141 * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) * else: * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) # <<<<<<<<<<<<<< @@ -6584,7 +6702,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double goto __pyx_L0; } - /* "hddm_wfpt/pdf.pxi":137 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":137 * * else: #sz=$ * if (st==0): #sv=0,sz=$,st=0 # <<<<<<<<<<<<<< @@ -6593,7 +6711,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":143 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":143 * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) * else: #sv=0,sz=$,st=$ * if use_adaptive: # <<<<<<<<<<<<<< @@ -6604,7 +6722,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double /*else*/ { if (__pyx_v_use_adaptive) { - /* "hddm_wfpt/pdf.pxi":144 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":144 * else: #sv=0,sz=$,st=$ * if use_adaptive: * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) # <<<<<<<<<<<<<< @@ -6616,7 +6734,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_r = __pyx_t_3; goto __pyx_L0; - /* "hddm_wfpt/pdf.pxi":143 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":143 * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) * else: #sv=0,sz=$,st=$ * if use_adaptive: # <<<<<<<<<<<<<< @@ -6625,7 +6743,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double */ } - /* "hddm_wfpt/pdf.pxi":146 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":146 * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) * else: * return simpson_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t-st/2., t+st/2., n_st) # <<<<<<<<<<<<<< @@ -6639,7 +6757,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double } } - /* "hddm_wfpt/pdf.pxi":104 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< @@ -6659,6 +6777,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } @@ -6693,18 +6812,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_v_use_adaptive; double __pyx_v_simps_err; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("full_pdf (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(2, 104, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,0}; - PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -6740,61 +6868,88 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 1); __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 2); __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 3); __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 4); __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 5); __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 6); __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 7); __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 8); __PYX_ERR(2, 104, __pyx_L3_error) @@ -6803,28 +6958,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[9] = value; kw_args--; } + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[10] = value; kw_args--; } + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[11] = value; kw_args--; } + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[12] = value; kw_args--; } + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) } } @@ -6888,7 +7043,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, __pyx_nargs); __PYX_ERR(2, 104, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.full_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; @@ -6896,6 +7058,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_4wfpt_full_pdf(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err); /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6938,7 +7106,7 @@ static PyObject *__pyx_pf_4wfpt_full_pdf(CYTHON_UNUSED PyObject *__pyx_self, dou return __pyx_r; } -/* "hddm_wfpt/integrate.pxi":12 +/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 * include 'pdf.pxi' * * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< @@ -6957,6 +7125,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl int __pyx_v_i; double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations int __pyx_t_1; double __pyx_t_2; int __pyx_t_3; @@ -6966,9 +7135,10 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif + __Pyx_RefNannySetupContext("simpson_1D", 1); __Pyx_TraceCall("simpson_1D", __pyx_f[3], 12, 1, __PYX_ERR(3, 12, __pyx_L1_error)); - /* "hddm_wfpt/integrate.pxi":18 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":18 * * cdef double ht, hz * cdef int n = max(n_st, n_sz) # <<<<<<<<<<<<<< @@ -6978,7 +7148,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(18,1,__PYX_ERR(3, 18, __pyx_L1_error)) __pyx_v_n = std::max(__pyx_v_n_st, __pyx_v_n_sz); - /* "hddm_wfpt/integrate.pxi":19 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":19 * cdef double ht, hz * cdef int n = max(n_st, n_sz) * if n_st==0: #integration over z # <<<<<<<<<<<<<< @@ -6989,7 +7159,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_1 = (__pyx_v_n_st == 0); if (__pyx_t_1) { - /* "hddm_wfpt/integrate.pxi":20 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":20 * cdef int n = max(n_st, n_sz) * if n_st==0: #integration over z * hz = (ub_z-lb_z)/n # <<<<<<<<<<<<<< @@ -6999,7 +7169,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(20,1,__PYX_ERR(3, 20, __pyx_L1_error)) __pyx_v_hz = ((__pyx_v_ub_z - __pyx_v_lb_z) / ((double)__pyx_v_n)); - /* "hddm_wfpt/integrate.pxi":21 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":21 * if n_st==0: #integration over z * hz = (ub_z-lb_z)/n * ht = 0 # <<<<<<<<<<<<<< @@ -7009,7 +7179,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(21,1,__PYX_ERR(3, 21, __pyx_L1_error)) __pyx_v_ht = 0.0; - /* "hddm_wfpt/integrate.pxi":22 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":22 * hz = (ub_z-lb_z)/n * ht = 0 * lb_t = t # <<<<<<<<<<<<<< @@ -7019,7 +7189,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(22,1,__PYX_ERR(3, 22, __pyx_L1_error)) __pyx_v_lb_t = __pyx_v_t; - /* "hddm_wfpt/integrate.pxi":23 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":23 * ht = 0 * lb_t = t * ub_t = t # <<<<<<<<<<<<<< @@ -7029,7 +7199,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(23,1,__PYX_ERR(3, 23, __pyx_L1_error)) __pyx_v_ub_t = __pyx_v_t; - /* "hddm_wfpt/integrate.pxi":19 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":19 * cdef double ht, hz * cdef int n = max(n_st, n_sz) * if n_st==0: #integration over z # <<<<<<<<<<<<<< @@ -7039,7 +7209,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl goto __pyx_L3; } - /* "hddm_wfpt/integrate.pxi":25 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":25 * ub_t = t * else: #integration over t * hz = 0 # <<<<<<<<<<<<<< @@ -7050,7 +7220,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl /*else*/ { __pyx_v_hz = 0.0; - /* "hddm_wfpt/integrate.pxi":26 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":26 * else: #integration over t * hz = 0 * ht = (ub_t-lb_t)/n # <<<<<<<<<<<<<< @@ -7060,7 +7230,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(26,1,__PYX_ERR(3, 26, __pyx_L1_error)) __pyx_v_ht = ((__pyx_v_ub_t - __pyx_v_lb_t) / ((double)__pyx_v_n)); - /* "hddm_wfpt/integrate.pxi":27 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":27 * hz = 0 * ht = (ub_t-lb_t)/n * lb_z = z # <<<<<<<<<<<<<< @@ -7070,7 +7240,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(27,1,__PYX_ERR(3, 27, __pyx_L1_error)) __pyx_v_lb_z = __pyx_v_z; - /* "hddm_wfpt/integrate.pxi":28 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":28 * ht = (ub_t-lb_t)/n * lb_z = z * ub_z = z # <<<<<<<<<<<<<< @@ -7082,7 +7252,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl } __pyx_L3:; - /* "hddm_wfpt/integrate.pxi":30 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":30 * ub_z = z * * cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) # <<<<<<<<<<<<<< @@ -7093,7 +7263,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_lb_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_lb_z, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 30, __pyx_L1_error) __pyx_v_S = __pyx_t_2; - /* "hddm_wfpt/integrate.pxi":34 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":34 * cdef int i * * for i from 1 <= i <= n: # <<<<<<<<<<<<<< @@ -7104,7 +7274,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 1; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) { - /* "hddm_wfpt/integrate.pxi":35 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":35 * * for i from 1 <= i <= n: * z_tag = lb_z + hz * i # <<<<<<<<<<<<<< @@ -7114,7 +7284,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(35,1,__PYX_ERR(3, 35, __pyx_L1_error)) __pyx_v_z_tag = (__pyx_v_lb_z + (__pyx_v_hz * __pyx_v_i)); - /* "hddm_wfpt/integrate.pxi":36 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":36 * for i from 1 <= i <= n: * z_tag = lb_z + hz * i * t_tag = lb_t + ht * i # <<<<<<<<<<<<<< @@ -7124,7 +7294,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(36,1,__PYX_ERR(3, 36, __pyx_L1_error)) __pyx_v_t_tag = (__pyx_v_lb_t + (__pyx_v_ht * __pyx_v_i)); - /* "hddm_wfpt/integrate.pxi":37 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":37 * z_tag = lb_z + hz * i * t_tag = lb_t + ht * i * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) # <<<<<<<<<<<<<< @@ -7135,7 +7305,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_tag), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_tag, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 37, __pyx_L1_error) __pyx_v_y = __pyx_t_2; - /* "hddm_wfpt/integrate.pxi":38 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":38 * t_tag = lb_t + ht * i * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) * if i&1: #check if i is odd # <<<<<<<<<<<<<< @@ -7146,7 +7316,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_1 = ((__pyx_v_i & 1) != 0); if (__pyx_t_1) { - /* "hddm_wfpt/integrate.pxi":39 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":39 * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) * if i&1: #check if i is odd * S += (4 * y) # <<<<<<<<<<<<<< @@ -7156,7 +7326,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(39,1,__PYX_ERR(3, 39, __pyx_L1_error)) __pyx_v_S = (__pyx_v_S + (4.0 * __pyx_v_y)); - /* "hddm_wfpt/integrate.pxi":38 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":38 * t_tag = lb_t + ht * i * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) * if i&1: #check if i is odd # <<<<<<<<<<<<<< @@ -7166,7 +7336,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl goto __pyx_L6; } - /* "hddm_wfpt/integrate.pxi":41 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":41 * S += (4 * y) * else: * S += (2 * y) # <<<<<<<<<<<<<< @@ -7180,7 +7350,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_L6:; } - /* "hddm_wfpt/integrate.pxi":42 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":42 * else: * S += (2 * y) * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y # <<<<<<<<<<<<<< @@ -7190,7 +7360,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(42,1,__PYX_ERR(3, 42, __pyx_L1_error)) __pyx_v_S = (__pyx_v_S - __pyx_v_y); - /* "hddm_wfpt/integrate.pxi":43 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":43 * S += (2 * y) * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st # <<<<<<<<<<<<<< @@ -7200,7 +7370,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(43,1,__PYX_ERR(3, 43, __pyx_L1_error)) __pyx_v_S = (__pyx_v_S / ((__pyx_v_ub_t - __pyx_v_lb_t) + (__pyx_v_ub_z - __pyx_v_lb_z))); - /* "hddm_wfpt/integrate.pxi":45 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":45 * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st * * return ((ht+hz) * S / 3) # <<<<<<<<<<<<<< @@ -7211,7 +7381,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_r = (((__pyx_v_ht + __pyx_v_hz) * __pyx_v_S) / 3.0); goto __pyx_L0; - /* "hddm_wfpt/integrate.pxi":12 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 * include 'pdf.pxi' * * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< @@ -7231,10 +7401,11 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } -/* "hddm_wfpt/integrate.pxi":47 +/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 * return ((ht+hz) * S / 3) * * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< @@ -7250,6 +7421,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl int __pyx_v_i_t; double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations double __pyx_t_1; int __pyx_t_2; int __pyx_t_3; @@ -7259,9 +7431,10 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif + __Pyx_RefNannySetupContext("simpson_2D", 1); __Pyx_TraceCall("simpson_2D", __pyx_f[3], 47, 1, __PYX_ERR(3, 47, __pyx_L1_error)); - /* "hddm_wfpt/integrate.pxi":56 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":56 * cdef int i_t * * ht = (ub_t-lb_t)/n_st # <<<<<<<<<<<<<< @@ -7271,7 +7444,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(56,1,__PYX_ERR(3, 56, __pyx_L1_error)) __pyx_v_ht = ((__pyx_v_ub_t - __pyx_v_lb_t) / ((double)__pyx_v_n_st)); - /* "hddm_wfpt/integrate.pxi":58 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":58 * ht = (ub_t-lb_t)/n_st * * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) # <<<<<<<<<<<<<< @@ -7282,7 +7455,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_1 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_lb_t, __pyx_v_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_n_sz, 0.0, 0.0, 0); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 58, __pyx_L1_error) __pyx_v_S = __pyx_t_1; - /* "hddm_wfpt/integrate.pxi":60 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":60 * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) * * for i_t from 1 <= i_t <= n_st: # <<<<<<<<<<<<<< @@ -7293,7 +7466,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_2 = __pyx_v_n_st; for (__pyx_v_i_t = 1; __pyx_v_i_t <= __pyx_t_2; __pyx_v_i_t++) { - /* "hddm_wfpt/integrate.pxi":61 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":61 * * for i_t from 1 <= i_t <= n_st: * t_tag = lb_t + ht * i_t # <<<<<<<<<<<<<< @@ -7303,7 +7476,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(61,1,__PYX_ERR(3, 61, __pyx_L1_error)) __pyx_v_t_tag = (__pyx_v_lb_t + (__pyx_v_ht * __pyx_v_i_t)); - /* "hddm_wfpt/integrate.pxi":62 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":62 * for i_t from 1 <= i_t <= n_st: * t_tag = lb_t + ht * i_t * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) # <<<<<<<<<<<<<< @@ -7314,7 +7487,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_1 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_tag, __pyx_v_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_n_sz, 0.0, 0.0, 0); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 62, __pyx_L1_error) __pyx_v_y = __pyx_t_1; - /* "hddm_wfpt/integrate.pxi":63 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":63 * t_tag = lb_t + ht * i_t * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) * if i_t&1: #check if i is odd # <<<<<<<<<<<<<< @@ -7325,7 +7498,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_t_3 = ((__pyx_v_i_t & 1) != 0); if (__pyx_t_3) { - /* "hddm_wfpt/integrate.pxi":64 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":64 * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) * if i_t&1: #check if i is odd * S += (4 * y) # <<<<<<<<<<<<<< @@ -7335,7 +7508,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(64,1,__PYX_ERR(3, 64, __pyx_L1_error)) __pyx_v_S = (__pyx_v_S + (4.0 * __pyx_v_y)); - /* "hddm_wfpt/integrate.pxi":63 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":63 * t_tag = lb_t + ht * i_t * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) * if i_t&1: #check if i is odd # <<<<<<<<<<<<<< @@ -7345,7 +7518,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl goto __pyx_L5; } - /* "hddm_wfpt/integrate.pxi":66 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":66 * S += (4 * y) * else: * S += (2 * y) # <<<<<<<<<<<<<< @@ -7359,7 +7532,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_L5:; } - /* "hddm_wfpt/integrate.pxi":67 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":67 * else: * S += (2 * y) * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y # <<<<<<<<<<<<<< @@ -7369,7 +7542,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(67,1,__PYX_ERR(3, 67, __pyx_L1_error)) __pyx_v_S = (__pyx_v_S - __pyx_v_y); - /* "hddm_wfpt/integrate.pxi":68 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":68 * S += (2 * y) * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y * S = S/ (ub_t-lb_t) # <<<<<<<<<<<<<< @@ -7379,7 +7552,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceLine(68,1,__PYX_ERR(3, 68, __pyx_L1_error)) __pyx_v_S = (__pyx_v_S / (__pyx_v_ub_t - __pyx_v_lb_t)); - /* "hddm_wfpt/integrate.pxi":70 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":70 * S = S/ (ub_t-lb_t) * * return (ht * S / 3) # <<<<<<<<<<<<<< @@ -7390,7 +7563,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl __pyx_r = ((__pyx_v_ht * __pyx_v_S) / 3.0); goto __pyx_L0; - /* "hddm_wfpt/integrate.pxi":47 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 * return ((ht+hz) * S / 3) * * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< @@ -7410,10 +7583,11 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } -/* "hddm_wfpt/integrate.pxi":72 +/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 * return (ht * S / 3) * * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< @@ -7436,6 +7610,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v double __pyx_v_S2; double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations int __pyx_t_1; double __pyx_t_2; int __pyx_t_3; @@ -7446,9 +7621,10 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif + __Pyx_RefNannySetupContext("adaptiveSimpsonsAux", 1); __Pyx_TraceCall("adaptiveSimpsonsAux", __pyx_f[3], 72, 1, __PYX_ERR(3, 72, __pyx_L1_error)); - /* "hddm_wfpt/integrate.pxi":81 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":81 * #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) * * if (ub_t-lb_t) == 0: #integration over sz # <<<<<<<<<<<<<< @@ -7459,7 +7635,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __pyx_t_1 = ((__pyx_v_ub_t - __pyx_v_lb_t) == 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/integrate.pxi":82 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":82 * * if (ub_t-lb_t) == 0: #integration over sz * h = ub_z - lb_z # <<<<<<<<<<<<<< @@ -7469,7 +7645,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(82,1,__PYX_ERR(3, 82, __pyx_L1_error)) __pyx_v_h = (__pyx_v_ub_z - __pyx_v_lb_z); - /* "hddm_wfpt/integrate.pxi":83 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":83 * if (ub_t-lb_t) == 0: #integration over sz * h = ub_z - lb_z * z_c = (ub_z + lb_z)/2. # <<<<<<<<<<<<<< @@ -7479,7 +7655,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(83,1,__PYX_ERR(3, 83, __pyx_L1_error)) __pyx_v_z_c = ((__pyx_v_ub_z + __pyx_v_lb_z) / 2.); - /* "hddm_wfpt/integrate.pxi":84 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":84 * h = ub_z - lb_z * z_c = (ub_z + lb_z)/2. * z_d = (lb_z + z_c)/2. # <<<<<<<<<<<<<< @@ -7489,7 +7665,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(84,1,__PYX_ERR(3, 84, __pyx_L1_error)) __pyx_v_z_d = ((__pyx_v_lb_z + __pyx_v_z_c) / 2.); - /* "hddm_wfpt/integrate.pxi":85 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":85 * z_c = (ub_z + lb_z)/2. * z_d = (lb_z + z_c)/2. * z_e = (z_c + ub_z)/2. # <<<<<<<<<<<<<< @@ -7499,7 +7675,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(85,1,__PYX_ERR(3, 85, __pyx_L1_error)) __pyx_v_z_e = ((__pyx_v_z_c + __pyx_v_ub_z) / 2.); - /* "hddm_wfpt/integrate.pxi":86 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":86 * z_d = (lb_z + z_c)/2. * z_e = (z_c + ub_z)/2. * t_c = t # <<<<<<<<<<<<<< @@ -7509,7 +7685,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(86,1,__PYX_ERR(3, 86, __pyx_L1_error)) __pyx_v_t_c = __pyx_v_t; - /* "hddm_wfpt/integrate.pxi":87 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":87 * z_e = (z_c + ub_z)/2. * t_c = t * t_d = t # <<<<<<<<<<<<<< @@ -7519,7 +7695,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(87,1,__PYX_ERR(3, 87, __pyx_L1_error)) __pyx_v_t_d = __pyx_v_t; - /* "hddm_wfpt/integrate.pxi":88 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":88 * t_c = t * t_d = t * t_e = t # <<<<<<<<<<<<<< @@ -7529,7 +7705,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(88,1,__PYX_ERR(3, 88, __pyx_L1_error)) __pyx_v_t_e = __pyx_v_t; - /* "hddm_wfpt/integrate.pxi":81 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":81 * #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) * * if (ub_t-lb_t) == 0: #integration over sz # <<<<<<<<<<<<<< @@ -7539,7 +7715,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v goto __pyx_L3; } - /* "hddm_wfpt/integrate.pxi":91 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":91 * * else: #integration over t * h = ub_t - lb_t # <<<<<<<<<<<<<< @@ -7550,7 +7726,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v /*else*/ { __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); - /* "hddm_wfpt/integrate.pxi":92 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":92 * else: #integration over t * h = ub_t - lb_t * t_c = (ub_t + lb_t)/2. # <<<<<<<<<<<<<< @@ -7560,7 +7736,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(92,1,__PYX_ERR(3, 92, __pyx_L1_error)) __pyx_v_t_c = ((__pyx_v_ub_t + __pyx_v_lb_t) / 2.); - /* "hddm_wfpt/integrate.pxi":93 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":93 * h = ub_t - lb_t * t_c = (ub_t + lb_t)/2. * t_d = (lb_t + t_c)/2. # <<<<<<<<<<<<<< @@ -7570,7 +7746,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(93,1,__PYX_ERR(3, 93, __pyx_L1_error)) __pyx_v_t_d = ((__pyx_v_lb_t + __pyx_v_t_c) / 2.); - /* "hddm_wfpt/integrate.pxi":94 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":94 * t_c = (ub_t + lb_t)/2. * t_d = (lb_t + t_c)/2. * t_e = (t_c + ub_t)/2. # <<<<<<<<<<<<<< @@ -7580,7 +7756,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(94,1,__PYX_ERR(3, 94, __pyx_L1_error)) __pyx_v_t_e = ((__pyx_v_t_c + __pyx_v_ub_t) / 2.); - /* "hddm_wfpt/integrate.pxi":95 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":95 * t_d = (lb_t + t_c)/2. * t_e = (t_c + ub_t)/2. * z_c = z # <<<<<<<<<<<<<< @@ -7590,7 +7766,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(95,1,__PYX_ERR(3, 95, __pyx_L1_error)) __pyx_v_z_c = __pyx_v_z; - /* "hddm_wfpt/integrate.pxi":96 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":96 * t_e = (t_c + ub_t)/2. * z_c = z * z_d = z # <<<<<<<<<<<<<< @@ -7600,7 +7776,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(96,1,__PYX_ERR(3, 96, __pyx_L1_error)) __pyx_v_z_d = __pyx_v_z; - /* "hddm_wfpt/integrate.pxi":97 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":97 * z_c = z * z_d = z * z_e = z # <<<<<<<<<<<<<< @@ -7612,7 +7788,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v } __pyx_L3:; - /* "hddm_wfpt/integrate.pxi":99 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":99 * z_e = z * * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT # <<<<<<<<<<<<<< @@ -7623,7 +7799,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_d), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_d, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 99, __pyx_L1_error) __pyx_v_fd = (__pyx_t_2 / __pyx_v_ZT); - /* "hddm_wfpt/integrate.pxi":100 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":100 * * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT # <<<<<<<<<<<<<< @@ -7634,7 +7810,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_e), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_e, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 100, __pyx_L1_error) __pyx_v_fe = (__pyx_t_2 / __pyx_v_ZT); - /* "hddm_wfpt/integrate.pxi":102 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":102 * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) # <<<<<<<<<<<<<< @@ -7644,7 +7820,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(102,1,__PYX_ERR(3, 102, __pyx_L1_error)) __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_fd)) + __pyx_v_f_mid)); - /* "hddm_wfpt/integrate.pxi":103 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":103 * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) * Sright = (h/12)*(f_mid + 4*fe + f_end) # <<<<<<<<<<<<<< @@ -7654,7 +7830,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(103,1,__PYX_ERR(3, 103, __pyx_L1_error)) __pyx_v_Sright = ((__pyx_v_h / 12.0) * ((__pyx_v_f_mid + (4.0 * __pyx_v_fe)) + __pyx_v_f_end)); - /* "hddm_wfpt/integrate.pxi":104 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":104 * Sleft = (h/12)*(f_beg + 4*fd + f_mid) * Sright = (h/12)*(f_mid + 4*fe + f_end) * S2 = Sleft + Sright # <<<<<<<<<<<<<< @@ -7664,7 +7840,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(104,1,__PYX_ERR(3, 104, __pyx_L1_error)) __pyx_v_S2 = (__pyx_v_Sleft + __pyx_v_Sright); - /* "hddm_wfpt/integrate.pxi":105 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":105 * Sright = (h/12)*(f_mid + 4*fe + f_end) * S2 = Sleft + Sright * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): # <<<<<<<<<<<<<< @@ -7683,7 +7859,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __pyx_L5_bool_binop_done:; if (__pyx_t_1) { - /* "hddm_wfpt/integrate.pxi":106 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":106 * S2 = Sleft + Sright * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): * return S2 + (S2 - S)/15 # <<<<<<<<<<<<<< @@ -7694,7 +7870,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __pyx_r = (__pyx_v_S2 + ((__pyx_v_S2 - __pyx_v_S) / 15.0)); goto __pyx_L0; - /* "hddm_wfpt/integrate.pxi":105 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":105 * Sright = (h/12)*(f_mid + 4*fe + f_end) * S2 = Sleft + Sright * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): # <<<<<<<<<<<<<< @@ -7703,7 +7879,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v */ } - /* "hddm_wfpt/integrate.pxi":107 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":107 * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): * return S2 + (S2 - S)/15 * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< @@ -7713,7 +7889,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(107,1,__PYX_ERR(3, 107, __pyx_L1_error)) __pyx_t_2 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_z_c, __pyx_v_lb_t, __pyx_v_t_c, __pyx_v_ZT, (__pyx_v_simps_err / 2.0), __pyx_v_Sleft, __pyx_v_f_beg, __pyx_v_f_mid, __pyx_v_fd, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 107, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":110 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":110 * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, * Sleft, f_beg, f_mid, fd, bottom-1) + \ * adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< @@ -7723,7 +7899,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(110,1,__PYX_ERR(3, 110, __pyx_L1_error)) __pyx_t_4 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_z_c, __pyx_v_ub_z, __pyx_v_t_c, __pyx_v_ub_t, __pyx_v_ZT, (__pyx_v_simps_err / 2.0), __pyx_v_Sright, __pyx_v_f_mid, __pyx_v_f_end, __pyx_v_fe, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_4 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 110, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":109 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":109 * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, * Sleft, f_beg, f_mid, fd, bottom-1) + \ # <<<<<<<<<<<<<< @@ -7734,7 +7910,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __pyx_r = (__pyx_t_2 + __pyx_t_4); goto __pyx_L0; - /* "hddm_wfpt/integrate.pxi":72 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 * return (ht * S / 3) * * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< @@ -7754,10 +7930,11 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } -/* "hddm_wfpt/integrate.pxi":114 +/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 * Sright, f_mid, f_end, fe, bottom-1) * * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< @@ -7777,6 +7954,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v double __pyx_v_res; double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations int __pyx_t_1; double __pyx_t_2; int __pyx_lineno = 0; @@ -7785,9 +7963,10 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif + __Pyx_RefNannySetupContext("adaptiveSimpsons_1D", 1); __Pyx_TraceCall("adaptiveSimpsons_1D", __pyx_f[3], 114, 1, __PYX_ERR(3, 114, __pyx_L1_error)); - /* "hddm_wfpt/integrate.pxi":120 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":120 * cdef double h * * if (ub_t - lb_t) == 0: #integration over z # <<<<<<<<<<<<<< @@ -7798,7 +7977,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __pyx_t_1 = ((__pyx_v_ub_t - __pyx_v_lb_t) == 0.0); if (__pyx_t_1) { - /* "hddm_wfpt/integrate.pxi":121 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":121 * * if (ub_t - lb_t) == 0: #integration over z * lb_t = t # <<<<<<<<<<<<<< @@ -7808,7 +7987,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(121,1,__PYX_ERR(3, 121, __pyx_L1_error)) __pyx_v_lb_t = __pyx_v_t; - /* "hddm_wfpt/integrate.pxi":122 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":122 * if (ub_t - lb_t) == 0: #integration over z * lb_t = t * ub_t = t # <<<<<<<<<<<<<< @@ -7818,7 +7997,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(122,1,__PYX_ERR(3, 122, __pyx_L1_error)) __pyx_v_ub_t = __pyx_v_t; - /* "hddm_wfpt/integrate.pxi":123 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":123 * lb_t = t * ub_t = t * h = ub_z - lb_z # <<<<<<<<<<<<<< @@ -7828,7 +8007,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(123,1,__PYX_ERR(3, 123, __pyx_L1_error)) __pyx_v_h = (__pyx_v_ub_z - __pyx_v_lb_z); - /* "hddm_wfpt/integrate.pxi":120 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":120 * cdef double h * * if (ub_t - lb_t) == 0: #integration over z # <<<<<<<<<<<<<< @@ -7838,7 +8017,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v goto __pyx_L3; } - /* "hddm_wfpt/integrate.pxi":125 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":125 * h = ub_z - lb_z * else: #integration over t * h = (ub_t-lb_t) # <<<<<<<<<<<<<< @@ -7849,7 +8028,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v /*else*/ { __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); - /* "hddm_wfpt/integrate.pxi":126 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":126 * else: #integration over t * h = (ub_t-lb_t) * lb_z = z # <<<<<<<<<<<<<< @@ -7859,7 +8038,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(126,1,__PYX_ERR(3, 126, __pyx_L1_error)) __pyx_v_lb_z = __pyx_v_z; - /* "hddm_wfpt/integrate.pxi":127 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":127 * h = (ub_t-lb_t) * lb_z = z * ub_z = z # <<<<<<<<<<<<<< @@ -7871,7 +8050,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v } __pyx_L3:; - /* "hddm_wfpt/integrate.pxi":129 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":129 * ub_z = z * * cdef double ZT = h # <<<<<<<<<<<<<< @@ -7881,7 +8060,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(129,1,__PYX_ERR(3, 129, __pyx_L1_error)) __pyx_v_ZT = __pyx_v_h; - /* "hddm_wfpt/integrate.pxi":130 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":130 * * cdef double ZT = h * cdef double c_t = (lb_t + ub_t)/2. # <<<<<<<<<<<<<< @@ -7891,7 +8070,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(130,1,__PYX_ERR(3, 130, __pyx_L1_error)) __pyx_v_c_t = ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.); - /* "hddm_wfpt/integrate.pxi":131 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":131 * cdef double ZT = h * cdef double c_t = (lb_t + ub_t)/2. * cdef double c_z = (lb_z + ub_z)/2. # <<<<<<<<<<<<<< @@ -7901,7 +8080,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(131,1,__PYX_ERR(3, 131, __pyx_L1_error)) __pyx_v_c_z = ((__pyx_v_lb_z + __pyx_v_ub_z) / 2.); - /* "hddm_wfpt/integrate.pxi":134 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":134 * * cdef double f_beg, f_end, f_mid, S * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT # <<<<<<<<<<<<<< @@ -7912,7 +8091,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_lb_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_lb_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 134, __pyx_L1_error) __pyx_v_f_beg = (__pyx_t_2 / __pyx_v_ZT); - /* "hddm_wfpt/integrate.pxi":135 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":135 * cdef double f_beg, f_end, f_mid, S * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT # <<<<<<<<<<<<<< @@ -7923,7 +8102,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_ub_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_ub_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 135, __pyx_L1_error) __pyx_v_f_end = (__pyx_t_2 / __pyx_v_ZT); - /* "hddm_wfpt/integrate.pxi":136 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":136 * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT # <<<<<<<<<<<<<< @@ -7934,7 +8113,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_c_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_c_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 136, __pyx_L1_error) __pyx_v_f_mid = (__pyx_t_2 / __pyx_v_ZT); - /* "hddm_wfpt/integrate.pxi":137 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":137 * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT * S = (h/6)*(f_beg + 4*f_mid + f_end) # <<<<<<<<<<<<<< @@ -7944,7 +8123,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(137,1,__PYX_ERR(3, 137, __pyx_L1_error)) __pyx_v_S = ((__pyx_v_h / 6.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_f_mid)) + __pyx_v_f_end)); - /* "hddm_wfpt/integrate.pxi":138 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":138 * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT * S = (h/6)*(f_beg + 4*f_mid + f_end) * cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< @@ -7955,7 +8134,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __pyx_t_2 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_ub_t, __pyx_v_ZT, __pyx_v_simps_err, __pyx_v_S, __pyx_v_f_beg, __pyx_v_f_end, __pyx_v_f_mid, __pyx_v_maxRecursionDepth); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 138, __pyx_L1_error) __pyx_v_res = __pyx_t_2; - /* "hddm_wfpt/integrate.pxi":141 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":141 * lb_z, ub_z, lb_t, ub_t, ZT, simps_err, * S, f_beg, f_end, f_mid, maxRecursionDepth) * return res # <<<<<<<<<<<<<< @@ -7966,7 +8145,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "hddm_wfpt/integrate.pxi":114 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 * Sright, f_mid, f_end, fe, bottom-1) * * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< @@ -7986,10 +8165,11 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } -/* "hddm_wfpt/integrate.pxi":143 +/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 * return res * * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< @@ -8009,6 +8189,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py double __pyx_v_h; double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations double __pyx_t_1; int __pyx_t_2; int __pyx_t_3; @@ -8019,9 +8200,10 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif + __Pyx_RefNannySetupContext("adaptiveSimpsonsAux_2D", 1); __Pyx_TraceCall("adaptiveSimpsonsAux_2D", __pyx_f[3], 143, 1, __PYX_ERR(3, 143, __pyx_L1_error)); - /* "hddm_wfpt/integrate.pxi":156 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":156 * #print "in AdaptiveSimpsAux_2D: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) * * cdef double t_c = (ub_t + lb_t)/2. # <<<<<<<<<<<<<< @@ -8031,7 +8213,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(156,1,__PYX_ERR(3, 156, __pyx_L1_error)) __pyx_v_t_c = ((__pyx_v_ub_t + __pyx_v_lb_t) / 2.); - /* "hddm_wfpt/integrate.pxi":157 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":157 * * cdef double t_c = (ub_t + lb_t)/2. * cdef double t_d = (lb_t + t_c)/2. # <<<<<<<<<<<<<< @@ -8041,7 +8223,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(157,1,__PYX_ERR(3, 157, __pyx_L1_error)) __pyx_v_t_d = ((__pyx_v_lb_t + __pyx_v_t_c) / 2.); - /* "hddm_wfpt/integrate.pxi":158 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":158 * cdef double t_c = (ub_t + lb_t)/2. * cdef double t_d = (lb_t + t_c)/2. * cdef double t_e = (t_c + ub_t)/2. # <<<<<<<<<<<<<< @@ -8051,7 +8233,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(158,1,__PYX_ERR(3, 158, __pyx_L1_error)) __pyx_v_t_e = ((__pyx_v_t_c + __pyx_v_ub_t) / 2.); - /* "hddm_wfpt/integrate.pxi":159 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":159 * cdef double t_d = (lb_t + t_c)/2. * cdef double t_e = (t_c + ub_t)/2. * cdef double h = ub_t - lb_t # <<<<<<<<<<<<<< @@ -8061,7 +8243,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(159,1,__PYX_ERR(3, 159, __pyx_L1_error)) __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); - /* "hddm_wfpt/integrate.pxi":161 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":161 * cdef double h = ub_t - lb_t * * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< @@ -8071,7 +8253,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(161,1,__PYX_ERR(3, 161, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_d, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 161, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":162 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":162 * * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< @@ -8081,7 +8263,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(162,1,__PYX_ERR(3, 162, __pyx_L1_error)) __pyx_v_fd = (__pyx_t_1 / __pyx_v_st); - /* "hddm_wfpt/integrate.pxi":163 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":163 * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< @@ -8091,7 +8273,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(163,1,__PYX_ERR(3, 163, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_e, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 163, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":164 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":164 * 0, 0, err_1d, maxRecursionDepth_sz)/st * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< @@ -8101,7 +8283,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(164,1,__PYX_ERR(3, 164, __pyx_L1_error)) __pyx_v_fe = (__pyx_t_1 / __pyx_v_st); - /* "hddm_wfpt/integrate.pxi":166 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":166 * 0, 0, err_1d, maxRecursionDepth_sz)/st * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) # <<<<<<<<<<<<<< @@ -8111,7 +8293,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(166,1,__PYX_ERR(3, 166, __pyx_L1_error)) __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_fd)) + __pyx_v_f_mid)); - /* "hddm_wfpt/integrate.pxi":167 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":167 * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) * Sright = (h/12)*(f_mid + 4*fe + f_end) # <<<<<<<<<<<<<< @@ -8121,7 +8303,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(167,1,__PYX_ERR(3, 167, __pyx_L1_error)) __pyx_v_Sright = ((__pyx_v_h / 12.0) * ((__pyx_v_f_mid + (4.0 * __pyx_v_fe)) + __pyx_v_f_end)); - /* "hddm_wfpt/integrate.pxi":168 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":168 * Sleft = (h/12)*(f_beg + 4*fd + f_mid) * Sright = (h/12)*(f_mid + 4*fe + f_end) * S2 = Sleft + Sright # <<<<<<<<<<<<<< @@ -8131,7 +8313,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(168,1,__PYX_ERR(3, 168, __pyx_L1_error)) __pyx_v_S2 = (__pyx_v_Sleft + __pyx_v_Sright); - /* "hddm_wfpt/integrate.pxi":170 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":170 * S2 = Sleft + Sright * * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): # <<<<<<<<<<<<<< @@ -8150,7 +8332,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "hddm_wfpt/integrate.pxi":171 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":171 * * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): * return S2 + (S2 - S)/15; # <<<<<<<<<<<<<< @@ -8161,7 +8343,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __pyx_r = (__pyx_v_S2 + ((__pyx_v_S2 - __pyx_v_S) / 15.0)); goto __pyx_L0; - /* "hddm_wfpt/integrate.pxi":170 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":170 * S2 = Sleft + Sright * * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): # <<<<<<<<<<<<<< @@ -8170,7 +8352,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py */ } - /* "hddm_wfpt/integrate.pxi":173 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":173 * return S2 + (S2 - S)/15; * * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< @@ -8180,7 +8362,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(173,1,__PYX_ERR(3, 173, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_t_c, __pyx_v_st, (__pyx_v_err_2d / 2.0), __pyx_v_Sleft, __pyx_v_f_beg, __pyx_v_f_mid, __pyx_v_fd, __pyx_v_maxRecursionDepth_sz, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 173, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":176 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":176 * lb_z, ub_z, lb_t, t_c, st, err_2d/2, * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ * adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< @@ -8190,7 +8372,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __Pyx_TraceLine(176,1,__PYX_ERR(3, 176, __pyx_L1_error)) __pyx_t_4 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_t_c, __pyx_v_ub_t, __pyx_v_st, (__pyx_v_err_2d / 2.0), __pyx_v_Sright, __pyx_v_f_mid, __pyx_v_f_end, __pyx_v_fe, __pyx_v_maxRecursionDepth_sz, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_4 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 176, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":175 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":175 * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, * lb_z, ub_z, lb_t, t_c, st, err_2d/2, * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ # <<<<<<<<<<<<<< @@ -8201,7 +8383,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __pyx_r = (__pyx_t_1 + __pyx_t_4); goto __pyx_L0; - /* "hddm_wfpt/integrate.pxi":143 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 * return res * * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< @@ -8221,10 +8403,11 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } -/* "hddm_wfpt/integrate.pxi":181 +/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 * * * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< @@ -8246,6 +8429,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v double __pyx_v_res; double __pyx_r; __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations double __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -8253,9 +8437,10 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif + __Pyx_RefNannySetupContext("adaptiveSimpsons_2D", 1); __Pyx_TraceCall("adaptiveSimpsons_2D", __pyx_f[3], 181, 1, __PYX_ERR(3, 181, __pyx_L1_error)); - /* "hddm_wfpt/integrate.pxi":185 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":185 * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: * * cdef double h = (ub_t-lb_t) # <<<<<<<<<<<<<< @@ -8265,7 +8450,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(185,1,__PYX_ERR(3, 185, __pyx_L1_error)) __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); - /* "hddm_wfpt/integrate.pxi":187 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":187 * cdef double h = (ub_t-lb_t) * * cdef double st = (ub_t - lb_t) # <<<<<<<<<<<<<< @@ -8275,7 +8460,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(187,1,__PYX_ERR(3, 187, __pyx_L1_error)) __pyx_v_st = (__pyx_v_ub_t - __pyx_v_lb_t); - /* "hddm_wfpt/integrate.pxi":188 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":188 * * cdef double st = (ub_t - lb_t) * cdef double c_t = (lb_t + ub_t)/2. # <<<<<<<<<<<<<< @@ -8285,7 +8470,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(188,1,__PYX_ERR(3, 188, __pyx_L1_error)) __pyx_v_c_t = ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.); - /* "hddm_wfpt/integrate.pxi":189 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":189 * cdef double st = (ub_t - lb_t) * cdef double c_t = (lb_t + ub_t)/2. * cdef double c_z = (lb_z + ub_z)/2. # <<<<<<<<<<<<<< @@ -8295,7 +8480,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(189,1,__PYX_ERR(3, 189, __pyx_L1_error)) __pyx_v_c_z = ((__pyx_v_lb_z + __pyx_v_ub_z) / 2.); - /* "hddm_wfpt/integrate.pxi":192 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":192 * * cdef double f_beg, f_end, f_mid, S * cdef double err_1d = simps_err # <<<<<<<<<<<<<< @@ -8305,7 +8490,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(192,1,__PYX_ERR(3, 192, __pyx_L1_error)) __pyx_v_err_1d = __pyx_v_simps_err; - /* "hddm_wfpt/integrate.pxi":193 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":193 * cdef double f_beg, f_end, f_mid, S * cdef double err_1d = simps_err * cdef double err_2d = simps_err # <<<<<<<<<<<<<< @@ -8315,7 +8500,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(193,1,__PYX_ERR(3, 193, __pyx_L1_error)) __pyx_v_err_2d = __pyx_v_simps_err; - /* "hddm_wfpt/integrate.pxi":195 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":195 * cdef double err_2d = simps_err * * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< @@ -8325,7 +8510,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(195,1,__PYX_ERR(3, 195, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_lb_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 195, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":196 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":196 * * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< @@ -8335,7 +8520,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(196,1,__PYX_ERR(3, 196, __pyx_L1_error)) __pyx_v_f_beg = (__pyx_t_1 / __pyx_v_st); - /* "hddm_wfpt/integrate.pxi":198 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":198 * 0, 0, err_1d, maxRecursionDepth_sz)/st * * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< @@ -8345,7 +8530,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(198,1,__PYX_ERR(3, 198, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_ub_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 198, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":199 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":199 * * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< @@ -8355,7 +8540,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(199,1,__PYX_ERR(3, 199, __pyx_L1_error)) __pyx_v_f_end = (__pyx_t_1 / __pyx_v_st); - /* "hddm_wfpt/integrate.pxi":200 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":200 * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< @@ -8365,7 +8550,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(200,1,__PYX_ERR(3, 200, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.0), __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 200, __pyx_L1_error) - /* "hddm_wfpt/integrate.pxi":201 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":201 * 0, 0, err_1d, maxRecursionDepth_sz)/st * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< @@ -8375,7 +8560,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(201,1,__PYX_ERR(3, 201, __pyx_L1_error)) __pyx_v_f_mid = (__pyx_t_1 / __pyx_v_st); - /* "hddm_wfpt/integrate.pxi":202 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":202 * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st * S = (h/6)*(f_beg + 4*f_mid + f_end) # <<<<<<<<<<<<<< @@ -8385,7 +8570,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __Pyx_TraceLine(202,1,__PYX_ERR(3, 202, __pyx_L1_error)) __pyx_v_S = ((__pyx_v_h / 6.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_f_mid)) + __pyx_v_f_end)); - /* "hddm_wfpt/integrate.pxi":203 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":203 * 0, 0, err_1d, maxRecursionDepth_sz)/st * S = (h/6)*(f_beg + 4*f_mid + f_end) * cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< @@ -8396,7 +8581,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_ub_t, __pyx_v_st, __pyx_v_err_2d, __pyx_v_S, __pyx_v_f_beg, __pyx_v_f_end, __pyx_v_f_mid, __pyx_v_maxRecursionDepth_sz, __pyx_v_maxRecursionDepth_st); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 203, __pyx_L1_error) __pyx_v_res = __pyx_t_1; - /* "hddm_wfpt/integrate.pxi":206 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":206 * lb_z, ub_z, lb_t, ub_t, st, err_2d, * S, f_beg, f_end, f_mid, maxRecursionDepth_sz, maxRecursionDepth_st) * return res # <<<<<<<<<<<<<< @@ -8405,7 +8590,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "hddm_wfpt/integrate.pxi":181 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 * * * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< @@ -8425,6 +8610,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v #endif __pyx_L0:; __Pyx_TraceReturn(Py_None, 1); + __Pyx_RefNannyFinishContextNogil() return __pyx_r; } @@ -8470,18 +8656,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pdf_array (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 32, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_logp,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -8523,54 +8718,78 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 1); __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 2); __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 3); __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 4); __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 5); __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 6); __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 7); __PYX_ERR(0, 32, __pyx_L3_error) @@ -8579,56 +8798,56 @@ PyObject *__pyx_args, PyObject *__pyx_kwds case 8: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err); - if (value) { values[8] = value; kw_args--; } + if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_logp); - if (value) { values[9] = value; kw_args--; } + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[10] = value; kw_args--; } + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[11] = value; kw_args--; } + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[12] = value; kw_args--; } + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[13] = value; kw_args--; } + if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[14] = value; kw_args--; } + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[15] = value; kw_args--; } + if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } } @@ -8718,7 +8937,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.pdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; @@ -8731,6 +8957,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8792,7 +9024,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) */ __Pyx_TraceLine(36,0,__PYX_ERR(0, 36, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); /* "wfpt.pyx":38 @@ -8813,7 +9045,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -9105,7 +9337,8 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_14 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); @@ -9115,6 +9348,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P __pyx_t_14 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_y)}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); @@ -9275,18 +9509,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 54, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -9326,61 +9569,88 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 1); __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 2); __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 3); __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 4); __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 5); __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 6); __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 7); __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 8); __PYX_ERR(0, 54, __pyx_L3_error) @@ -9389,42 +9659,42 @@ PyObject *__pyx_args, PyObject *__pyx_kwds case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[9] = value; kw_args--; } + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[10] = value; kw_args--; } + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[11] = value; kw_args--; } + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[12] = value; kw_args--; } + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[13] = value; kw_args--; } + if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[14] = value; kw_args--; } + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) } } @@ -9502,7 +9772,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; @@ -9515,6 +9792,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9565,7 +9848,7 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, * cdef double p */ __Pyx_TraceLine(57,0,__PYX_ERR(0, 57, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); /* "wfpt.pyx":60 @@ -9736,7 +10019,7 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, * * return sum_logp # <<<<<<<<<<<<<< * - * def wiener_logp_array(np.ndarray[double, ndim=1] x, + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, */ __Pyx_TraceLine(76,0,__PYX_ERR(0, 76, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -9779,22 +10062,22 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, /* "wfpt.pyx":78 * return sum_logp * - * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] v, - * np.ndarray[double, ndim=1] sv, + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_7wiener_logp_array(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_7wiener_like_multi(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_6wiener_logp_array, "wiener_logp_array(ndarray x, ndarray v, ndarray sv, ndarray a, ndarray z, ndarray sz, ndarray t, ndarray st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0.1)"); -static PyMethodDef __pyx_mdef_4wfpt_7wiener_logp_array = {"wiener_logp_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_7wiener_logp_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_6wiener_logp_array}; -static PyObject *__pyx_pw_4wfpt_7wiener_logp_array(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_6wiener_like_multi, "wiener_like_multi(ndarray x, v, sv, a, z, sz, t, st, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_7wiener_like_multi = {"wiener_like_multi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_7wiener_like_multi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_6wiener_like_multi}; +static PyObject *__pyx_pw_4wfpt_7wiener_like_multi(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9802,14 +10085,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_v = 0; - PyArrayObject *__pyx_v_sv = 0; - PyArrayObject *__pyx_v_a = 0; - PyArrayObject *__pyx_v_z = 0; - PyArrayObject *__pyx_v_sz = 0; - PyArrayObject *__pyx_v_t = 0; - PyArrayObject *__pyx_v_st = 0; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_v_sv = 0; + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_z = 0; + PyObject *__pyx_v_sz = 0; + PyObject *__pyx_v_t = 0; + PyObject *__pyx_v_st = 0; double __pyx_v_err; + PyObject *__pyx_v_multi = 0; int __pyx_v_n_st; int __pyx_v_n_sz; int __pyx_v_use_adaptive; @@ -9817,21 +10101,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_logp_array (wrapper)", 0); + __Pyx_RefNannySetupContext("wiener_like_multi (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 78, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_multi,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); @@ -9868,114 +10164,150 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 1); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 1); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 2); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 2); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 3); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 3); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 4); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 4); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 5); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 5); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 6); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 6); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 7); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 7); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 8); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 8); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[9] = value; kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi); + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[10] = value; kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[11] = value; kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[12] = value; kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[13] = value; kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[14] = value; kw_args--; } + if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_logp_array") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) } } else { switch (__pyx_nargs) { + case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); + CYTHON_FALLTHROUGH; case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); CYTHON_FALLTHROUGH; case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); @@ -10002,83 +10334,950 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_v = ((PyArrayObject *)values[1]); - __pyx_v_sv = ((PyArrayObject *)values[2]); - __pyx_v_a = ((PyArrayObject *)values[3]); - __pyx_v_z = ((PyArrayObject *)values[4]); - __pyx_v_sz = ((PyArrayObject *)values[5]); - __pyx_v_t = ((PyArrayObject *)values[6]); - __pyx_v_st = ((PyArrayObject *)values[7]); - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) - if (values[9]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + __pyx_v_v = values[1]; + __pyx_v_sv = values[2]; + __pyx_v_a = values[3]; + __pyx_v_z = values[4]; + __pyx_v_sz = values[5]; + __pyx_v_t = values[6]; + __pyx_v_st = values[7]; + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + __pyx_v_multi = values[9]; + if (values[10]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) } else { __pyx_v_n_st = ((int)((int)10)); } - if (values[10]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) + if (values[11]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) } else { __pyx_v_n_sz = ((int)((int)10)); } - if (values[11]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) + if (values[12]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) } else { __pyx_v_use_adaptive = ((int)((int)1)); } - if (values[12]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) + if (values[13]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) } else { - __pyx_v_simps_err = ((double)((double)1e-8)); + __pyx_v_simps_err = ((double)((double)1e-3)); } - if (values[13]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error) + if (values[14]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } - if (values[14]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) + if (values[15]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) } else { - __pyx_v_w_outlier = ((double)((double)0.1)); + __pyx_v_w_outlier = ((double)((double)0.0)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; - __Pyx_AddTraceback("wfpt.wiener_logp_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 78, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 79, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv), __pyx_ptype_5numpy_ndarray, 1, "sv", 0))) __PYX_ERR(0, 80, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 81, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 82, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sz), __pyx_ptype_5numpy_ndarray, 1, "sz", 0))) __PYX_ERR(0, 83, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_t), __pyx_ptype_5numpy_ndarray, 1, "t", 0))) __PYX_ERR(0, 84, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_st), __pyx_ptype_5numpy_ndarray, 1, "st", 0))) __PYX_ERR(0, 85, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_6wiener_logp_array(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + __pyx_r = __pyx_pf_4wfpt_6wiener_like_multi(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_sv, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_z, PyArrayObject *__pyx_v_sz, PyArrayObject *__pyx_v_t, PyArrayObject *__pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { +static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_v_i; - PyArrayObject *__pyx_v_logp = 0; double __pyx_v_p; + double __pyx_v_sum_logp; double __pyx_v_wp_outlier; - __Pyx_LocalBuf_ND __pyx_pybuffernd_a; - __Pyx_Buffer __pyx_pybuffer_a; - __Pyx_LocalBuf_ND __pyx_pybuffernd_logp; - __Pyx_Buffer __pyx_pybuffer_logp; - __Pyx_LocalBuf_ND __pyx_pybuffernd_st; + PyObject *__pyx_v_params = NULL; + PyObject *__pyx_v_params_iter = NULL; + PyObject *__pyx_v_param = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + npy_intp *__pyx_t_1; + int __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + double __pyx_t_5; + double __pyx_t_6; + double __pyx_t_7; + double __pyx_t_8; + double __pyx_t_9; + double __pyx_t_10; + double __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + PyObject *(*__pyx_t_20)(PyObject *); + Py_ssize_t __pyx_t_21; + struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__6) + __Pyx_RefNannySetupContext("wiener_like_multi", 0); + __Pyx_TraceCall("wiener_like_multi", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error)); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + + /* "wfpt.pyx":81 + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef double p = 0 + */ + __Pyx_TraceLine(81,0,__PYX_ERR(0, 81, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_v_size = (__pyx_t_1[0]); + + /* "wfpt.pyx":83 + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t i + * cdef double p = 0 # <<<<<<<<<<<<<< + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier + */ + __Pyx_TraceLine(83,0,__PYX_ERR(0, 83, __pyx_L1_error)) + __pyx_v_p = 0.0; + + /* "wfpt.pyx":84 + * cdef Py_ssize_t i + * cdef double p = 0 + * cdef double sum_logp = 0 # <<<<<<<<<<<<<< + * cdef double wp_outlier = w_outlier * p_outlier + * + */ + __Pyx_TraceLine(84,0,__PYX_ERR(0, 84, __pyx_L1_error)) + __pyx_v_sum_logp = 0.0; + + /* "wfpt.pyx":85 + * cdef double p = 0 + * cdef double sum_logp = 0 + * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< + * + * if multi is None: + */ + __Pyx_TraceLine(85,0,__PYX_ERR(0, 85, __pyx_L1_error)) + __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); + + /* "wfpt.pyx":87 + * cdef double wp_outlier = w_outlier * p_outlier + * + * if multi is None: # <<<<<<<<<<<<<< + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + */ + __Pyx_TraceLine(87,0,__PYX_ERR(0, 87, __pyx_L1_error)) + __pyx_t_2 = (__pyx_v_multi == Py_None); + if (__pyx_t_2) { + + /* "wfpt.pyx":88 + * + * if multi is None: + * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} + */ + __Pyx_TraceLine(88,0,__PYX_ERR(0, 88, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_11 = __pyx_f_4wfpt_full_pdf(__pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "wfpt.pyx":87 + * cdef double wp_outlier = w_outlier * p_outlier + * + * if multi is None: # <<<<<<<<<<<<<< + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + */ + } + + /* "wfpt.pyx":90 + * return full_pdf(x, v, sv, a, z, sz, t, st, err) + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} # <<<<<<<<<<<<<< + * params_iter = copy(params) + * for i in range(size): + */ + __Pyx_TraceLine(90,0,__PYX_ERR(0, 90, __pyx_L1_error)) + /*else*/ { + __pyx_t_12 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_v_params = ((PyObject*)__pyx_t_12); + __pyx_t_12 = 0; + + /* "wfpt.pyx":91 + * else: + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} + * params_iter = copy(params) # <<<<<<<<<<<<<< + * for i in range(size): + * for param in multi: + */ + __Pyx_TraceLine(91,0,__PYX_ERR(0, 91, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = NULL; + __pyx_t_15 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + __pyx_t_15 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_params}; + __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __pyx_v_params_iter = __pyx_t_12; + __pyx_t_12 = 0; + + /* "wfpt.pyx":92 + * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} + * params_iter = copy(params) + * for i in range(size): # <<<<<<<<<<<<<< + * for param in multi: + * params_iter[param] = params[param][i] + */ + __Pyx_TraceLine(92,0,__PYX_ERR(0, 92, __pyx_L1_error)) + __pyx_t_16 = __pyx_v_size; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + + /* "wfpt.pyx":93 + * params_iter = copy(params) + * for i in range(size): + * for param in multi: # <<<<<<<<<<<<<< + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: + */ + __Pyx_TraceLine(93,0,__PYX_ERR(0, 93, __pyx_L1_error)) + if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { + __pyx_t_12 = __pyx_v_multi; __Pyx_INCREF(__pyx_t_12); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + } else { + __pyx_t_19 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 93, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_20)) { + if (likely(PyList_CheckExact(__pyx_t_12))) { + if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 93, __pyx_L1_error) + #else + __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + #endif + } else { + if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 93, __pyx_L1_error) + #else + __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + #endif + } + } else { + __pyx_t_13 = __pyx_t_20(__pyx_t_12); + if (unlikely(!__pyx_t_13)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 93, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_13); + } + __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_13); + __pyx_t_13 = 0; + + /* "wfpt.pyx":94 + * for i in range(size): + * for param in multi: + * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< + * if abs(x[i]) != 999.: + * p = full_pdf(x[i], params_iter['v'], + */ + __Pyx_TraceLine(94,0,__PYX_ERR(0, 94, __pyx_L1_error)) + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_14) < 0))) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "wfpt.pyx":93 + * params_iter = copy(params) + * for i in range(size): + * for param in multi: # <<<<<<<<<<<<<< + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: + */ + __Pyx_TraceLine(93,0,__PYX_ERR(0, 93, __pyx_L1_error)) + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "wfpt.pyx":95 + * for param in multi: + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< + * p = full_pdf(x[i], params_iter['v'], + * params_iter['sv'], params_iter['a'], params_iter['z'], + */ + __Pyx_TraceLine(95,0,__PYX_ERR(0, 95, __pyx_L1_error)) + __pyx_t_21 = __pyx_v_i; + __pyx_t_2 = (fabs((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides))) != 999.); + if (__pyx_t_2) { + + /* "wfpt.pyx":96 + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: + * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter['t'], params_iter['st'], + */ + __Pyx_TraceLine(96,0,__PYX_ERR(0, 96, __pyx_L1_error)) + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "wfpt.pyx":97 + * if abs(x[i]) != 999.: + * p = full_pdf(x[i], params_iter['v'], + * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< + * params_iter['sz'], params_iter['t'], params_iter['st'], + * err, n_st, n_sz, use_adaptive, simps_err) + */ + __Pyx_TraceLine(97,0,__PYX_ERR(0, 97, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "wfpt.pyx":98 + * p = full_pdf(x[i], params_iter['v'], + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter['t'], params_iter['st'], # <<<<<<<<<<<<<< + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier + */ + __Pyx_TraceLine(98,0,__PYX_ERR(0, 98, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "wfpt.pyx":96 + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: + * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< + * params_iter['sv'], params_iter['a'], params_iter['z'], + * params_iter['sz'], params_iter['t'], params_iter['st'], + */ + __Pyx_TraceLine(96,0,__PYX_ERR(0, 96, __pyx_L1_error)) + __pyx_t_22.__pyx_n = 4; + __pyx_t_22.n_st = __pyx_v_n_st; + __pyx_t_22.n_sz = __pyx_v_n_sz; + __pyx_t_22.use_adaptive = __pyx_v_use_adaptive; + __pyx_t_22.simps_err = __pyx_v_simps_err; + __pyx_t_4 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5, __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_v_p = __pyx_t_4; + + /* "wfpt.pyx":100 + * params_iter['sz'], params_iter['t'], params_iter['st'], + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< + * elif x[i] == 999.: + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + */ + __Pyx_TraceLine(100,0,__PYX_ERR(0, 100, __pyx_L1_error)) + __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); + + /* "wfpt.pyx":95 + * for param in multi: + * params_iter[param] = params[param][i] + * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< + * p = full_pdf(x[i], params_iter['v'], + * params_iter['sv'], params_iter['a'], params_iter['z'], + */ + goto __pyx_L9; + } + + /* "wfpt.pyx":101 + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier + * elif x[i] == 999.: # <<<<<<<<<<<<<< + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + * else: # x[i] == -999. + */ + __Pyx_TraceLine(101,0,__PYX_ERR(0, 101, __pyx_L1_error)) + __pyx_t_21 = __pyx_v_i; + __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)) == 999.); + if (__pyx_t_2) { + + /* "wfpt.pyx":102 + * p = p * (1 - p_outlier) + wp_outlier + * elif x[i] == 999.: + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< + * else: # x[i] == -999. + * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + */ + __Pyx_TraceLine(102,0,__PYX_ERR(0, 102, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __pyx_f_4wfpt_prob_ub(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_v_p = __pyx_t_7; + + /* "wfpt.pyx":101 + * err, n_st, n_sz, use_adaptive, simps_err) + * p = p * (1 - p_outlier) + wp_outlier + * elif x[i] == 999.: # <<<<<<<<<<<<<< + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + * else: # x[i] == -999. + */ + goto __pyx_L9; + } + + /* "wfpt.pyx":104 + * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + * else: # x[i] == -999. + * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< + * + * sum_logp += log(p) + */ + __Pyx_TraceLine(104,0,__PYX_ERR(0, 104, __pyx_L1_error)) + /*else*/ { + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = __pyx_f_4wfpt_prob_ub(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_v_p = (1.0 - __pyx_t_4); + } + __pyx_L9:; + + /* "wfpt.pyx":106 + * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) + * + * sum_logp += log(p) # <<<<<<<<<<<<<< + * + * return sum_logp + */ + __Pyx_TraceLine(106,0,__PYX_ERR(0, 106, __pyx_L1_error)) + __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); + } + + /* "wfpt.pyx":108 + * sum_logp += log(p) + * + * return sum_logp # <<<<<<<<<<<<<< + * + * def wiener_logp_array(np.ndarray[double, ndim=1] x, + */ + __Pyx_TraceLine(108,0,__PYX_ERR(0, 108, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + } + + /* "wfpt.pyx":78 + * return sum_logp + * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_params); + __Pyx_XDECREF(__pyx_v_params_iter); + __Pyx_XDECREF(__pyx_v_param); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "wfpt.pyx":110 + * return sum_logp + * + * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< + * np.ndarray[double, ndim=1] v, + * np.ndarray[double, ndim=1] sv, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4wfpt_9wiener_logp_array(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4wfpt_8wiener_logp_array, "wiener_logp_array(ndarray x, ndarray v, ndarray sv, ndarray a, ndarray z, ndarray sz, ndarray t, ndarray st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0.1)"); +static PyMethodDef __pyx_mdef_4wfpt_9wiener_logp_array = {"wiener_logp_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_9wiener_logp_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_8wiener_logp_array}; +static PyObject *__pyx_pw_4wfpt_9wiener_logp_array(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_v = 0; + PyArrayObject *__pyx_v_sv = 0; + PyArrayObject *__pyx_v_a = 0; + PyArrayObject *__pyx_v_z = 0; + PyArrayObject *__pyx_v_sz = 0; + PyArrayObject *__pyx_v_t = 0; + PyArrayObject *__pyx_v_st = 0; + double __pyx_v_err; + int __pyx_v_n_st; + int __pyx_v_n_sz; + int __pyx_v_use_adaptive; + double __pyx_v_simps_err; + double __pyx_v_p_outlier; + double __pyx_v_w_outlier; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wiener_logp_array (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 110, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 1); __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 2); __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 3); __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 4); __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 5); __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 6); __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 7); __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 8); __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); + if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_logp_array") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_v = ((PyArrayObject *)values[1]); + __pyx_v_sv = ((PyArrayObject *)values[2]); + __pyx_v_a = ((PyArrayObject *)values[3]); + __pyx_v_z = ((PyArrayObject *)values[4]); + __pyx_v_sz = ((PyArrayObject *)values[5]); + __pyx_v_t = ((PyArrayObject *)values[6]); + __pyx_v_st = ((PyArrayObject *)values[7]); + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) + if (values[9]) { + __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error) + } else { + __pyx_v_n_st = ((int)((int)10)); + } + if (values[10]) { + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L3_error) + } else { + __pyx_v_n_sz = ((int)((int)10)); + } + if (values[11]) { + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) + } else { + __pyx_v_use_adaptive = ((int)((int)1)); + } + if (values[12]) { + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) + } else { + __pyx_v_simps_err = ((double)((double)1e-8)); + } + if (values[13]) { + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L3_error) + } else { + __pyx_v_p_outlier = ((double)((double)0.0)); + } + if (values[14]) { + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) + } else { + __pyx_v_w_outlier = ((double)((double)0.1)); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error) + goto __pyx_L3_error; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("wfpt.wiener_logp_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 111, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv), __pyx_ptype_5numpy_ndarray, 1, "sv", 0))) __PYX_ERR(0, 112, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 113, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 114, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sz), __pyx_ptype_5numpy_ndarray, 1, "sz", 0))) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_t), __pyx_ptype_5numpy_ndarray, 1, "t", 0))) __PYX_ERR(0, 116, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_st), __pyx_ptype_5numpy_ndarray, 1, "st", 0))) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_8wiener_logp_array(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_sv, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_z, PyArrayObject *__pyx_v_sz, PyArrayObject *__pyx_v_t, PyArrayObject *__pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_logp = 0; + double __pyx_v_p; + double __pyx_v_wp_outlier; + __Pyx_LocalBuf_ND __pyx_pybuffernd_a; + __Pyx_Buffer __pyx_pybuffer_a; + __Pyx_LocalBuf_ND __pyx_pybuffernd_logp; + __Pyx_Buffer __pyx_pybuffer_logp; + __Pyx_LocalBuf_ND __pyx_pybuffernd_st; __Pyx_Buffer __pyx_pybuffer_st; __Pyx_LocalBuf_ND __pyx_pybuffernd_sv; __Pyx_Buffer __pyx_pybuffer_sv; @@ -10121,9 +11320,9 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__6) + __Pyx_TraceFrameInit(__pyx_codeobj__7) __Pyx_RefNannySetupContext("wiener_logp_array", 0); - __Pyx_TraceCall("wiener_logp_array", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error)); + __Pyx_TraceCall("wiener_logp_array", __pyx_f[0], 110, 0, __PYX_ERR(0, 110, __pyx_L1_error)); __pyx_pybuffer_logp.pybuffer.buf = NULL; __pyx_pybuffer_logp.refcount = 0; __pyx_pybuffernd_logp.data = NULL; @@ -10162,97 +11361,97 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx __pyx_pybuffernd_st.rcbuffer = &__pyx_pybuffer_st; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) } __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_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_pybuffernd_sv.diminfo[0].strides = __pyx_pybuffernd_sv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv.diminfo[0].shape = __pyx_pybuffernd_sv.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) } __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_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sz.rcbuffer->pybuffer, (PyObject*)__pyx_v_sz, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sz.rcbuffer->pybuffer, (PyObject*)__pyx_v_sz, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_pybuffernd_sz.diminfo[0].strides = __pyx_pybuffernd_sz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sz.diminfo[0].shape = __pyx_pybuffernd_sz.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t.rcbuffer->pybuffer, (PyObject*)__pyx_v_t, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t.rcbuffer->pybuffer, (PyObject*)__pyx_v_t, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_st.rcbuffer->pybuffer, (PyObject*)__pyx_v_st, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_st.rcbuffer->pybuffer, (PyObject*)__pyx_v_st, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_pybuffernd_st.diminfo[0].strides = __pyx_pybuffernd_st.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_st.diminfo[0].shape = __pyx_pybuffernd_st.rcbuffer->pybuffer.shape[0]; - /* "wfpt.pyx":94 + /* "wfpt.pyx":126 * double w_outlier=0.1): * * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) */ - __Pyx_TraceLine(94,0,__PYX_ERR(0, 94, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); - /* "wfpt.pyx":96 + /* "wfpt.pyx":128 * cdef Py_ssize_t size = x.shape[0] * cdef Py_ssize_t i * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< * cdef double p * cdef double wp_outlier = w_outlier * p_outlier */ - __Pyx_TraceLine(96,0,__PYX_ERR(0, 96, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 96, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_logp.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_logp = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 96, __pyx_L1_error) + __PYX_ERR(0, 128, __pyx_L1_error) } else {__pyx_pybuffernd_logp.diminfo[0].strides = __pyx_pybuffernd_logp.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_logp.diminfo[0].shape = __pyx_pybuffernd_logp.rcbuffer->pybuffer.shape[0]; } } @@ -10260,61 +11459,61 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx __pyx_v_logp = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "wfpt.pyx":98 + /* "wfpt.pyx":130 * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) * cdef double p * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< * * if not p_outlier_in_range(p_outlier): */ - __Pyx_TraceLine(98,0,__PYX_ERR(0, 98, __pyx_L1_error)) + __Pyx_TraceLine(130,0,__PYX_ERR(0, 130, __pyx_L1_error)) __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - /* "wfpt.pyx":100 + /* "wfpt.pyx":132 * cdef double wp_outlier = w_outlier * p_outlier * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * logp[:] = -np.inf * return logp */ - __Pyx_TraceLine(100,0,__PYX_ERR(0, 100, __pyx_L1_error)) - __pyx_t_8 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error)) + __pyx_t_8 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { - /* "wfpt.pyx":101 + /* "wfpt.pyx":133 * * if not p_outlier_in_range(p_outlier): * logp[:] = -np.inf # <<<<<<<<<<<<<< * return logp * */ - __Pyx_TraceLine(101,0,__PYX_ERR(0, 101, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_logp), __pyx_slice__7, __pyx_t_6) < 0))) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_logp), __pyx_slice__8, __pyx_t_6) < 0))) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "wfpt.pyx":102 + /* "wfpt.pyx":134 * if not p_outlier_in_range(p_outlier): * logp[:] = -np.inf * return logp # <<<<<<<<<<<<<< * * for i in range(size): */ - __Pyx_TraceLine(102,0,__PYX_ERR(0, 102, __pyx_L1_error)) + __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_logp); __pyx_r = ((PyObject *)__pyx_v_logp); goto __pyx_L0; - /* "wfpt.pyx":100 + /* "wfpt.pyx":132 * cdef double wp_outlier = w_outlier * p_outlier * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< @@ -10323,27 +11522,27 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx */ } - /* "wfpt.pyx":104 + /* "wfpt.pyx":136 * return logp * * for i in range(size): # <<<<<<<<<<<<<< - * # print(x[i]) - * # print(v[i]) + * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, + * n_st, n_sz, use_adaptive, simps_err) */ - __Pyx_TraceLine(104,0,__PYX_ERR(0, 104, __pyx_L1_error)) + __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error)) __pyx_t_10 = __pyx_v_size; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "wfpt.pyx":114 - * # print(st[i]) - * # print('params printed') + /* "wfpt.pyx":137 + * + * for i in range(size): * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err) - * # print(p) + * */ - __Pyx_TraceLine(114,0,__PYX_ERR(0, 114, __pyx_L1_error)) + __Pyx_TraceLine(137,0,__PYX_ERR(0, 137, __pyx_L1_error)) __pyx_t_13 = __pyx_v_i; __pyx_t_14 = __pyx_v_i; __pyx_t_15 = __pyx_v_i; @@ -10353,67 +11552,67 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx __pyx_t_19 = __pyx_v_i; __pyx_t_20 = __pyx_v_i; - /* "wfpt.pyx":115 - * # print('params printed') + /* "wfpt.pyx":138 + * for i in range(size): * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< - * # print(p) * + * # If one probability = 0, the log sum will be -Inf */ - __Pyx_TraceLine(115,0,__PYX_ERR(0, 115, __pyx_L1_error)) + __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error)) __pyx_t_22.__pyx_n = 4; __pyx_t_22.n_st = __pyx_v_n_st; __pyx_t_22.n_sz = __pyx_v_n_sz; __pyx_t_22.use_adaptive = __pyx_v_use_adaptive; __pyx_t_22.simps_err = __pyx_v_simps_err; - __pyx_t_21 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sv.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_sv.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_z.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sz.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_sz.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_t.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_t.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_st.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_st.diminfo[0].strides)), __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_21 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sv.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_sv.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_z.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sz.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_sz.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_t.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_t.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_st.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_st.diminfo[0].strides)), __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error) __pyx_v_p = __pyx_t_21; - /* "wfpt.pyx":119 + /* "wfpt.pyx":141 * * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * # print(p) + * * if p == 0: */ - __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error)) + __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error)) __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - /* "wfpt.pyx":121 + /* "wfpt.pyx":143 * p = p * (1 - p_outlier) + wp_outlier - * # print(p) + * * if p == 0: # <<<<<<<<<<<<<< * logp[i] = -np.inf * else: */ - __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error)) + __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error)) __pyx_t_9 = (__pyx_v_p == 0.0); if (__pyx_t_9) { - /* "wfpt.pyx":122 - * # print(p) + /* "wfpt.pyx":144 + * * if p == 0: * logp[i] = -np.inf # <<<<<<<<<<<<<< * else: * logp[i] = np.log(p) */ - __Pyx_TraceLine(122,0,__PYX_ERR(0, 122, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_TraceLine(144,0,__PYX_ERR(0, 144, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = __pyx_v_i; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_logp.diminfo[0].strides) = __pyx_t_21; - /* "wfpt.pyx":121 + /* "wfpt.pyx":143 * p = p * (1 - p_outlier) + wp_outlier - * # print(p) + * * if p == 0: # <<<<<<<<<<<<<< * logp[i] = -np.inf * else: @@ -10421,25 +11620,26 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx goto __pyx_L6; } - /* "wfpt.pyx":124 + /* "wfpt.pyx":146 * logp[i] = -np.inf * else: * logp[i] = np.log(p) # <<<<<<<<<<<<<< * * return logp */ - __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error)) + __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error)) /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_23 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -10449,16 +11649,17 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx __pyx_t_23 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_23, 1+__pyx_t_23); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = __pyx_v_i; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_logp.diminfo[0].strides) = __pyx_t_21; @@ -10466,21 +11667,21 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx __pyx_L6:; } - /* "wfpt.pyx":126 + /* "wfpt.pyx":148 * logp[i] = np.log(p) * * return logp # <<<<<<<<<<<<<< * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, */ - __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error)) + __Pyx_TraceLine(148,0,__PYX_ERR(0, 148, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_logp); __pyx_r = ((PyObject *)__pyx_v_logp); goto __pyx_L0; - /* "wfpt.pyx":78 - * return sum_logp + /* "wfpt.pyx":110 + * return sum_logp * * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] v, @@ -10529,7 +11730,7 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "wfpt.pyx":128 +/* "wfpt.pyx":150 * return logp * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< @@ -10538,16 +11739,16 @@ static PyObject *__pyx_pf_4wfpt_6wiener_logp_array(CYTHON_UNUSED PyObject *__pyx */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_9wiener_like_rlddm(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_11wiener_like_rlddm(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_8wiener_like_rlddm, "wiener_like_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_9wiener_like_rlddm = {"wiener_like_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_9wiener_like_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_8wiener_like_rlddm}; -static PyObject *__pyx_pw_4wfpt_9wiener_like_rlddm(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_10wiener_like_rlddm, "wiener_like_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_11wiener_like_rlddm = {"wiener_like_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_11wiener_like_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_10wiener_like_rlddm}; +static PyObject *__pyx_pw_4wfpt_11wiener_like_rlddm(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10576,18 +11777,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_rlddm (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 150, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_alpha,&__pyx_n_s_pos_alpha,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -10639,153 +11849,198 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 1); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 1); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 2); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 2); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 3); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 3); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 4); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 4); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 5); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 5); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos_alpha)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos_alpha)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 6); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 6); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 7); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 7); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 8); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 8); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 9); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 9); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: - if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[10]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 10); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 10); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: - if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[11]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 11); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 11); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: - if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[12]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 12); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 12); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: - if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[13]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 13); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 13); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: - if (likely((values[14] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (likely((values[14] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[14]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 14); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 14); __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[15] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[16] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (value) { values[16] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 17: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[17] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (value) { values[17] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 18: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[18] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (value) { values[18] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 19: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[19] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (value) { values[19] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 20: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[20] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + if (value) { values[20] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlddm") < 0)) __PYX_ERR(0, 128, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlddm") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -10824,72 +12079,85 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_response = ((PyArrayObject *)values[1]); __pyx_v_feedback = ((PyArrayObject *)values[2]); __pyx_v_split_by = ((PyArrayObject *)values[3]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) - __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) - __pyx_v_pos_alpha = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_pos_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) - __pyx_v_v = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) - __pyx_v_err = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_q = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) + __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) + __pyx_v_pos_alpha = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_pos_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) + __pyx_v_v = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) if (values[15]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_n_st = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) } else { __pyx_v_n_st = ((int)((int)10)); } if (values[16]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) } else { __pyx_v_n_sz = ((int)((int)10)); } if (values[17]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) } else { __pyx_v_use_adaptive = ((int)((int)1)); } if (values[18]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[18]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[18]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) } else { __pyx_v_simps_err = ((double)((double)1e-8)); } if (values[19]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[19]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[19]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[20]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[20]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[20]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, __pyx_nargs); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, __pyx_nargs); __PYX_ERR(0, 150, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 128, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 129, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 130, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 131, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_8wiener_like_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_alpha, __pyx_v_pos_alpha, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 152, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_10wiener_like_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_alpha, __pyx_v_pos_alpha, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { +static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { CYTHON_UNUSED Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_j; @@ -10961,9 +12229,9 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__8) + __Pyx_TraceFrameInit(__pyx_codeobj__9) __Pyx_RefNannySetupContext("wiener_like_rlddm", 0); - __Pyx_TraceCall("wiener_like_rlddm", __pyx_f[0], 128, 0, __PYX_ERR(0, 128, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_rlddm", __pyx_f[0], 150, 0, __PYX_ERR(0, 150, __pyx_L1_error)); __pyx_pybuffer_qs.pybuffer.buf = NULL; __pyx_pybuffer_qs.refcount = 0; __pyx_pybuffernd_qs.data = NULL; @@ -11002,84 +12270,85 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 128, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 128, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) } __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 128, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) } __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 128, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) } __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; - /* "wfpt.pyx":136 + /* "wfpt.pyx":158 * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0): * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i, j * cdef Py_ssize_t s_size */ - __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_TraceLine(158,0,__PYX_ERR(0, 158, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); - /* "wfpt.pyx":141 + /* "wfpt.pyx":163 * cdef int s * cdef double p * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier * cdef double alfa */ - __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error)) + __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; - /* "wfpt.pyx":142 + /* "wfpt.pyx":164 * cdef double p * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< * cdef double alfa * cdef double pos_alfa */ - __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error)) + __Pyx_TraceLine(164,0,__PYX_ERR(0, 164, __pyx_L1_error)) __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - /* "wfpt.pyx":145 + /* "wfpt.pyx":167 * cdef double alfa * cdef double pos_alfa * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim=1] xs * cdef np.ndarray[double, ndim=1] feedbacks */ - __Pyx_TraceLine(145,0,__PYX_ERR(0, 145, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_TraceLine(167,0,__PYX_ERR(0, 167, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -11089,22 +12358,23 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 145, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 145, __pyx_L1_error) + __PYX_ERR(0, 167, __pyx_L1_error) } else {__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]; } } @@ -11112,22 +12382,23 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":149 + /* "wfpt.pyx":171 * cdef np.ndarray[double, ndim=1] feedbacks * cdef np.ndarray[long, ndim=1] responses * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< * * if not p_outlier_in_range(p_outlier): */ - __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -11137,21 +12408,22 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 171, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 149, __pyx_L1_error) + __PYX_ERR(0, 171, __pyx_L1_error) } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; } } @@ -11159,40 +12431,40 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":151 + /* "wfpt.pyx":173 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(151,0,__PYX_ERR(0, 151, __pyx_L1_error)) - __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error)) + __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_10); if (__pyx_t_11) { - /* "wfpt.pyx":152 + /* "wfpt.pyx":174 * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< * * if pos_alpha==100.00: */ - __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error)) + __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":151 + /* "wfpt.pyx":173 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< @@ -11201,28 +12473,28 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx */ } - /* "wfpt.pyx":154 + /* "wfpt.pyx":176 * return -np.inf * * if pos_alpha==100.00: # <<<<<<<<<<<<<< * pos_alfa = alpha * else: */ - __Pyx_TraceLine(154,0,__PYX_ERR(0, 154, __pyx_L1_error)) + __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error)) __pyx_t_11 = (__pyx_v_pos_alpha == 100.00); if (__pyx_t_11) { - /* "wfpt.pyx":155 + /* "wfpt.pyx":177 * * if pos_alpha==100.00: * pos_alfa = alpha # <<<<<<<<<<<<<< * else: * pos_alfa = pos_alpha */ - __Pyx_TraceLine(155,0,__PYX_ERR(0, 155, __pyx_L1_error)) + __Pyx_TraceLine(177,0,__PYX_ERR(0, 177, __pyx_L1_error)) __pyx_v_pos_alfa = __pyx_v_alpha; - /* "wfpt.pyx":154 + /* "wfpt.pyx":176 * return -np.inf * * if pos_alpha==100.00: # <<<<<<<<<<<<<< @@ -11232,60 +12504,60 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx goto __pyx_L4; } - /* "wfpt.pyx":157 + /* "wfpt.pyx":179 * pos_alfa = alpha * else: * pos_alfa = pos_alpha # <<<<<<<<<<<<<< * * # unique represent # of conditions */ - __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error)) + __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error)) /*else*/ { __pyx_v_pos_alfa = __pyx_v_pos_alpha; } __pyx_L4:; - /* "wfpt.pyx":160 + /* "wfpt.pyx":182 * * # unique represent # of conditions * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< * s = unique[j] * # select trials for current condition, identified by the split_by-array */ - __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_t_12 = (__pyx_t_1[0]); __pyx_t_13 = __pyx_t_12; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "wfpt.pyx":161 + /* "wfpt.pyx":183 * # unique represent # of conditions * for j in range(unique.shape[0]): * s = unique[j] # <<<<<<<<<<<<<< * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] */ - __Pyx_TraceLine(161,0,__PYX_ERR(0, 161, __pyx_L1_error)) + __Pyx_TraceLine(183,0,__PYX_ERR(0, 183, __pyx_L1_error)) __pyx_t_15 = __pyx_v_j; __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_unique.diminfo[0].strides)); - /* "wfpt.pyx":163 + /* "wfpt.pyx":185 * s = unique[j] * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< * responses = response[split_by == s] * xs = x[split_by == s] */ - __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_TraceLine(185,0,__PYX_ERR(0, 185, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 163, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 185, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -11302,28 +12574,28 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; } __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) } __pyx_t_16 = 0; __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "wfpt.pyx":164 + /* "wfpt.pyx":186 * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] * responses = response[split_by == s] # <<<<<<<<<<<<<< * xs = x[split_by == s] * s_size = xs.shape[0] */ - __Pyx_TraceLine(164,0,__PYX_ERR(0, 164, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_TraceLine(186,0,__PYX_ERR(0, 186, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 164, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 186, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -11340,28 +12612,28 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx __pyx_t_19 = __pyx_t_18 = __pyx_t_17 = 0; } __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) } __pyx_t_20 = 0; __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "wfpt.pyx":165 + /* "wfpt.pyx":187 * feedbacks = feedback[split_by == s] * responses = response[split_by == s] * xs = x[split_by == s] # <<<<<<<<<<<<<< * s_size = xs.shape[0] * qs[0] = q */ - __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 165, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 187, __pyx_L1_error) __pyx_t_21 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -11378,70 +12650,70 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; } __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) } __pyx_t_21 = 0; __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "wfpt.pyx":166 + /* "wfpt.pyx":188 * responses = response[split_by == s] * xs = x[split_by == s] * s_size = xs.shape[0] # <<<<<<<<<<<<<< * qs[0] = q * qs[1] = q */ - __Pyx_TraceLine(166,0,__PYX_ERR(0, 166, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) __pyx_v_s_size = (__pyx_t_1[0]); - /* "wfpt.pyx":167 + /* "wfpt.pyx":189 * xs = x[split_by == s] * s_size = xs.shape[0] * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q * */ - __Pyx_TraceLine(167,0,__PYX_ERR(0, 167, __pyx_L1_error)) + __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error)) __pyx_t_15 = 0; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":168 + /* "wfpt.pyx":190 * s_size = xs.shape[0] * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< * * # don't calculate pdf for first trial but still update q */ - __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error)) + __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error)) __pyx_t_15 = 1; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":171 + /* "wfpt.pyx":193 * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: */ - __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error)) + __Pyx_TraceLine(193,0,__PYX_ERR(0, 193, __pyx_L1_error)) __pyx_t_15 = 0; __pyx_t_22 = 0; __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides))); if (__pyx_t_11) { - /* "wfpt.pyx":172 + /* "wfpt.pyx":194 * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) */ - __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error)) + __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error)) __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - /* "wfpt.pyx":171 + /* "wfpt.pyx":193 * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< @@ -11451,138 +12723,138 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx goto __pyx_L7; } - /* "wfpt.pyx":174 + /* "wfpt.pyx":196 * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ - __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error)) + __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error)) /*else*/ { __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); } __pyx_L7:; - /* "wfpt.pyx":178 + /* "wfpt.pyx":200 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses[0]]) * */ - __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error)) + __Pyx_TraceLine(200,0,__PYX_ERR(0, 200, __pyx_L1_error)) __pyx_t_22 = 0; __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); - /* "wfpt.pyx":179 + /* "wfpt.pyx":201 * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ * alfa * (feedbacks[0] - qs[responses[0]]) # <<<<<<<<<<<<<< * * # loop through all trials in current condition */ - __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error)) + __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error)) __pyx_t_15 = 0; __pyx_t_24 = 0; __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_responses.diminfo[0].strides)); - /* "wfpt.pyx":178 + /* "wfpt.pyx":200 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses[0]]) * */ - __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error)) + __Pyx_TraceLine(200,0,__PYX_ERR(0, 200, __pyx_L1_error)) __pyx_t_26 = 0; __pyx_t_27 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_responses.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides))))); - /* "wfpt.pyx":182 + /* "wfpt.pyx":204 * * # loop through all trials in current condition * for i in range(1, s_size): # <<<<<<<<<<<<<< * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) */ - __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error)) + __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error)) __pyx_t_28 = __pyx_v_s_size; __pyx_t_29 = __pyx_t_28; for (__pyx_t_30 = 1; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) { __pyx_v_i = __pyx_t_30; - /* "wfpt.pyx":183 + /* "wfpt.pyx":205 * # loop through all trials in current condition * for i in range(1, s_size): * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, # <<<<<<<<<<<<<< * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) * # If one probability = 0, the log sum will be -Inf */ - __Pyx_TraceLine(183,0,__PYX_ERR(0, 183, __pyx_L1_error)) + __Pyx_TraceLine(205,0,__PYX_ERR(0, 205, __pyx_L1_error)) __pyx_t_24 = __pyx_v_i; __pyx_t_25 = 1; __pyx_t_15 = 0; - /* "wfpt.pyx":184 + /* "wfpt.pyx":206 * for i in range(1, s_size): * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier */ - __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error)) + __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error)) __pyx_t_32.__pyx_n = 4; __pyx_t_32.n_st = __pyx_v_n_st; __pyx_t_32.n_sz = __pyx_v_n_sz; __pyx_t_32.use_adaptive = __pyx_v_use_adaptive; __pyx_t_32.simps_err = __pyx_v_simps_err; - __pyx_t_31 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_xs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_xs.diminfo[0].strides)), (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v), __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_32); if (unlikely(__pyx_t_31 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_31 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_xs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_xs.diminfo[0].strides)), (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v), __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_32); if (unlikely(__pyx_t_31 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error) __pyx_v_p = __pyx_t_31; - /* "wfpt.pyx":186 + /* "wfpt.pyx":208 * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< * if p == 0: * return -np.inf */ - __Pyx_TraceLine(186,0,__PYX_ERR(0, 186, __pyx_L1_error)) + __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error)) __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - /* "wfpt.pyx":187 + /* "wfpt.pyx":209 * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier * if p == 0: # <<<<<<<<<<<<<< * return -np.inf * sum_logp += log(p) */ - __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error)) + __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error)) __pyx_t_11 = (__pyx_v_p == 0.0); if (__pyx_t_11) { - /* "wfpt.pyx":188 + /* "wfpt.pyx":210 * p = p * (1 - p_outlier) + wp_outlier * if p == 0: * return -np.inf # <<<<<<<<<<<<<< * sum_logp += log(p) * */ - __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error)) + __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":187 + /* "wfpt.pyx":209 * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier * if p == 0: # <<<<<<<<<<<<<< @@ -11591,41 +12863,41 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx */ } - /* "wfpt.pyx":189 + /* "wfpt.pyx":211 * if p == 0: * return -np.inf * sum_logp += log(p) # <<<<<<<<<<<<<< * * # get learning rate for current trial. if pos_alpha is not in */ - __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error)) + __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error)) __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - /* "wfpt.pyx":194 + /* "wfpt.pyx":216 * # include it will be same as alpha so can still use this * # calculation: * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: */ - __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error)) + __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error)) __pyx_t_15 = __pyx_v_i; __pyx_t_25 = __pyx_v_i; __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))); if (__pyx_t_11) { - /* "wfpt.pyx":195 + /* "wfpt.pyx":217 * # calculation: * if feedbacks[i] > qs[responses[i]]: * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) */ - __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error)) + __Pyx_TraceLine(217,0,__PYX_ERR(0, 217, __pyx_L1_error)) __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - /* "wfpt.pyx":194 + /* "wfpt.pyx":216 * # include it will be same as alpha so can still use this * # calculation: * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< @@ -11635,72 +12907,72 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx goto __pyx_L11; } - /* "wfpt.pyx":197 + /* "wfpt.pyx":219 * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ - __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error)) + __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error)) /*else*/ { __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); } __pyx_L11:; - /* "wfpt.pyx":201 + /* "wfpt.pyx":223 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses[i]]) * return sum_logp */ - __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error)) + __Pyx_TraceLine(223,0,__PYX_ERR(0, 223, __pyx_L1_error)) __pyx_t_25 = __pyx_v_i; __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); - /* "wfpt.pyx":202 + /* "wfpt.pyx":224 * # received on current trial. * qs[responses[i]] = qs[responses[i]] + \ * alfa * (feedbacks[i] - qs[responses[i]]) # <<<<<<<<<<<<<< * return sum_logp * */ - __Pyx_TraceLine(202,0,__PYX_ERR(0, 202, __pyx_L1_error)) + __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error)) __pyx_t_15 = __pyx_v_i; __pyx_t_22 = __pyx_v_i; __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); - /* "wfpt.pyx":201 + /* "wfpt.pyx":223 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses[i]]) * return sum_logp */ - __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error)) + __Pyx_TraceLine(223,0,__PYX_ERR(0, 223, __pyx_L1_error)) __pyx_t_26 = __pyx_v_i; __pyx_t_27 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_responses.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides))))); } } - /* "wfpt.pyx":203 + /* "wfpt.pyx":225 * qs[responses[i]] = qs[responses[i]] + \ * alfa * (feedbacks[i] - qs[responses[i]]) * return sum_logp # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error)) + __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":128 + /* "wfpt.pyx":150 * return logp * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< @@ -11754,7 +13026,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "wfpt.pyx":206 +/* "wfpt.pyx":228 * * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< @@ -11763,16 +13035,16 @@ static PyObject *__pyx_pf_4wfpt_8wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_11wiener_like_rlssm_nn(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_13wiener_like_rlssm_nn(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_10wiener_like_rlssm_nn, "wiener_like_rlssm_nn(unicode model, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_ssm, ndarray params_rl, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); -static PyMethodDef __pyx_mdef_4wfpt_11wiener_like_rlssm_nn = {"wiener_like_rlssm_nn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_11wiener_like_rlssm_nn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_10wiener_like_rlssm_nn}; -static PyObject *__pyx_pw_4wfpt_11wiener_like_rlssm_nn(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_12wiener_like_rlssm_nn, "wiener_like_rlssm_nn(unicode model, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_ssm, ndarray params_rl, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); +static PyMethodDef __pyx_mdef_4wfpt_13wiener_like_rlssm_nn = {"wiener_like_rlssm_nn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_13wiener_like_rlssm_nn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_12wiener_like_rlssm_nn}; +static PyObject *__pyx_pw_4wfpt_13wiener_like_rlssm_nn(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11792,27 +13064,36 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_w_outlier; PyObject *__pyx_v_network = 0; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_rlssm_nn (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 228, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_model,&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_params_ssm,&__pyx_n_s_params_rl,&__pyx_n_s_params_bnds,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; - PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; - /* "wfpt.pyx":215 + /* "wfpt.pyx":237 * np.ndarray[double, ndim=1] params_rl, * np.ndarray[double, ndim=2] params_bnds, * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< * * cdef double v = params_ssm[0] */ - values[11] = ((PyObject *)((PyObject *)Py_None)); + values[11] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -11846,90 +13127,117 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_model)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_model)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 1); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 1); __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 2); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 2); __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 3); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 3); __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 4); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 4); __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 5); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 5); __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_ssm)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_ssm)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 6); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 6); __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_rl)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_rl)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 7); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 7); __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_bnds)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_bnds)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 8); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 8); __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[9] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[10] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); - if (value) { values[11] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlssm_nn") < 0)) __PYX_ERR(0, 206, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlssm_nn") < 0)) __PYX_ERR(0, 228, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -11957,17 +13265,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_response = ((PyArrayObject *)values[2]); __pyx_v_feedback = ((PyArrayObject *)values[3]); __pyx_v_split_by = ((PyArrayObject *)values[4]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L3_error) + __pyx_v_q = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L3_error) __pyx_v_params_ssm = ((PyArrayObject *)values[6]); __pyx_v_params_rl = ((PyArrayObject *)values[7]); __pyx_v_params_bnds = ((PyArrayObject *)values[8]); if (values[9]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[10]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } @@ -11975,23 +13283,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, __pyx_nargs); __PYX_ERR(0, 206, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, __pyx_nargs); __PYX_ERR(0, 228, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model), (&PyUnicode_Type), 1, "model", 1))) __PYX_ERR(0, 206, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 207, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 208, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 209, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 210, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_ssm), __pyx_ptype_5numpy_ndarray, 1, "params_ssm", 0))) __PYX_ERR(0, 212, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_rl), __pyx_ptype_5numpy_ndarray, 1, "params_rl", 0))) __PYX_ERR(0, 213, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_bnds), __pyx_ptype_5numpy_ndarray, 1, "params_bnds", 0))) __PYX_ERR(0, 214, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_10wiener_like_rlssm_nn(__pyx_self, __pyx_v_model, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_ssm, __pyx_v_params_rl, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model), (&PyUnicode_Type), 1, "model", 1))) __PYX_ERR(0, 228, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 229, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 231, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_ssm), __pyx_ptype_5numpy_ndarray, 1, "params_ssm", 0))) __PYX_ERR(0, 234, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_rl), __pyx_ptype_5numpy_ndarray, 1, "params_rl", 0))) __PYX_ERR(0, 235, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_bnds), __pyx_ptype_5numpy_ndarray, 1, "params_bnds", 0))) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_12wiener_like_rlssm_nn(__pyx_self, __pyx_v_model, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_ssm, __pyx_v_params_rl, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); - /* "wfpt.pyx":206 + /* "wfpt.pyx":228 * * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< @@ -12004,11 +13319,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_model, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_ssm, PyArrayObject *__pyx_v_params_rl, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { +static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_model, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_ssm, PyArrayObject *__pyx_v_params_rl, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { double __pyx_v_v; double __pyx_v_rl_alpha; Py_ssize_t __pyx_v_size; @@ -12107,9 +13428,9 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__9) + __Pyx_TraceFrameInit(__pyx_codeobj__10) __Pyx_RefNannySetupContext("wiener_like_rlssm_nn", 0); - __Pyx_TraceCall("wiener_like_rlssm_nn", __pyx_f[0], 206, 0, __PYX_ERR(0, 206, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_rlssm_nn", __pyx_f[0], 228, 0, __PYX_ERR(0, 228, __pyx_L1_error)); __pyx_pybuffer_qs.pybuffer.buf = NULL; __pyx_pybuffer_qs.refcount = 0; __pyx_pybuffernd_qs.data = NULL; @@ -12168,131 +13489,132 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_params_bnds.rcbuffer = &__pyx_pybuffer_params_bnds; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_ssm.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_ssm, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_ssm.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_ssm, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_pybuffernd_params_ssm.diminfo[0].strides = __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_ssm.diminfo[0].shape = __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_rl.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_rl, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_rl.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_rl, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_pybuffernd_params_rl.diminfo[0].strides = __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_rl.diminfo[0].shape = __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_bnds, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_bnds, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_pybuffernd_params_bnds.diminfo[0].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_bnds.diminfo[0].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_params_bnds.diminfo[1].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_params_bnds.diminfo[1].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[1]; - /* "wfpt.pyx":217 + /* "wfpt.pyx":239 * double p_outlier=0, double w_outlier=0, network = None): * * cdef double v = params_ssm[0] # <<<<<<<<<<<<<< * cdef double rl_alpha = params_rl[0] * */ - __Pyx_TraceLine(217,0,__PYX_ERR(0, 217, __pyx_L1_error)) + __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error)) __pyx_t_1 = 0; __pyx_v_v = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides)); - /* "wfpt.pyx":218 + /* "wfpt.pyx":240 * * cdef double v = params_ssm[0] * cdef double rl_alpha = params_rl[0] # <<<<<<<<<<<<<< * * cdef Py_ssize_t size = x.shape[0] */ - __Pyx_TraceLine(218,0,__PYX_ERR(0, 218, __pyx_L1_error)) + __Pyx_TraceLine(240,0,__PYX_ERR(0, 240, __pyx_L1_error)) __pyx_t_1 = 0; __pyx_v_rl_alpha = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); - /* "wfpt.pyx":220 + /* "wfpt.pyx":242 * cdef double rl_alpha = params_rl[0] * * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i, j, i_p * cdef Py_ssize_t s_size */ - __Pyx_TraceLine(220,0,__PYX_ERR(0, 220, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_TraceLine(242,0,__PYX_ERR(0, 242, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_v_size = (__pyx_t_2[0]); - /* "wfpt.pyx":224 + /* "wfpt.pyx":246 * cdef Py_ssize_t s_size * cdef int s * cdef double log_p = 0 # <<<<<<<<<<<<<< * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier */ - __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error)) + __Pyx_TraceLine(246,0,__PYX_ERR(0, 246, __pyx_L1_error)) __pyx_v_log_p = 0.0; - /* "wfpt.pyx":225 + /* "wfpt.pyx":247 * cdef int s * cdef double log_p = 0 * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier * cdef double alfa */ - __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error)) + __Pyx_TraceLine(247,0,__PYX_ERR(0, 247, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; - /* "wfpt.pyx":226 + /* "wfpt.pyx":248 * cdef double log_p = 0 * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< * cdef double alfa * cdef double pos_alfa */ - __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error)) + __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error)) __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - /* "wfpt.pyx":229 + /* "wfpt.pyx":251 * cdef double alfa * cdef double pos_alfa * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim=1] xs * cdef np.ndarray[double, ndim=1] feedbacks */ - __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); - PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); @@ -12302,22 +13624,23 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 229, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 251, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 229, __pyx_L1_error) + __PYX_ERR(0, 251, __pyx_L1_error) } else {__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]; } } @@ -12325,22 +13648,23 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_v_qs = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "wfpt.pyx":234 + /* "wfpt.pyx":256 * cdef np.ndarray[long, ndim=1] responses * cdef np.ndarray[long, ndim=1] responses_qs * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) */ - __Pyx_TraceLine(234,0,__PYX_ERR(0, 234, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_unique); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_unique); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); @@ -12350,21 +13674,22 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_split_by)}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 234, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 234, __pyx_L1_error) + __PYX_ERR(0, 256, __pyx_L1_error) } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; } } @@ -12372,68 +13697,68 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_v_unique = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "wfpt.pyx":235 + /* "wfpt.pyx":257 * cdef np.ndarray[long, ndim=1] responses_qs * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] # <<<<<<<<<<<<<< * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) * cdef float ll_min = -16.11809 */ - __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_params_ssm)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_TraceLine(257,0,__PYX_ERR(0, 257, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_params_ssm)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L1_error) __pyx_v_n_params = (__pyx_t_2[0]); - /* "wfpt.pyx":236 + /* "wfpt.pyx":258 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) # <<<<<<<<<<<<<< * cdef float ll_min = -16.11809 * cdef int cumm_s_size = 0 */ - __Pyx_TraceLine(236,0,__PYX_ERR(0, 236, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_TraceLine(258,0,__PYX_ERR(0, 258, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_n_params + 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_n_params + 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 258, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 258, __pyx_L1_error) } else {__pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; } } @@ -12441,60 +13766,60 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_v_data = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":237 + /* "wfpt.pyx":259 * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< * cdef int cumm_s_size = 0 * */ - __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error)) + __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error)) __pyx_v_ll_min = -16.11809; - /* "wfpt.pyx":238 + /* "wfpt.pyx":260 * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) * cdef float ll_min = -16.11809 * cdef int cumm_s_size = 0 # <<<<<<<<<<<<<< * * if not p_outlier_in_range(p_outlier): */ - __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error)) + __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error)) __pyx_v_cumm_s_size = 0; - /* "wfpt.pyx":240 + /* "wfpt.pyx":262 * cdef int cumm_s_size = 0 * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(240,0,__PYX_ERR(0, 240, __pyx_L1_error)) - __pyx_t_12 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error)) + __pyx_t_12 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_12); if (__pyx_t_13) { - /* "wfpt.pyx":241 + /* "wfpt.pyx":263 * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< * * # Check for boundary violations -- if true, return -np.inf */ - __Pyx_TraceLine(241,0,__PYX_ERR(0, 241, __pyx_L1_error)) + __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "wfpt.pyx":240 + /* "wfpt.pyx":262 * cdef int cumm_s_size = 0 * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< @@ -12503,25 +13828,26 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ */ } - /* "wfpt.pyx":244 + /* "wfpt.pyx":266 * * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, len(params_ssm)): # <<<<<<<<<<<<<< * lower_bnd = params_bnds[0][i_p] * upper_bnd = params_bnds[1][i_p] */ - __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_params_ssm)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 244, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_params_ssm)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); @@ -12531,12 +13857,13 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_int_1, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -12544,9 +13871,9 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_14 = 0; __pyx_t_15 = NULL; } else { - __pyx_t_14 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_14 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 266, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -12554,17 +13881,17 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -12574,62 +13901,62 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 244, __pyx_L1_error) + else __PYX_ERR(0, 266, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_i_p = __pyx_t_16; - /* "wfpt.pyx":245 + /* "wfpt.pyx":267 * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, len(params_ssm)): * lower_bnd = params_bnds[0][i_p] # <<<<<<<<<<<<<< * upper_bnd = params_bnds[1][i_p] * */ - __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error)) - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_TraceLine(267,0,__PYX_ERR(0, 267, __pyx_L1_error)) + __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_lower_bnd, __pyx_t_6); __pyx_t_6 = 0; - /* "wfpt.pyx":246 + /* "wfpt.pyx":268 * for i_p in np.arange(1, len(params_ssm)): * lower_bnd = params_bnds[0][i_p] * upper_bnd = params_bnds[1][i_p] # <<<<<<<<<<<<<< * * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: */ - __Pyx_TraceLine(246,0,__PYX_ERR(0, 246, __pyx_L1_error)) - __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error)) + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_upper_bnd, __pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":248 + /* "wfpt.pyx":270 * upper_bnd = params_bnds[1][i_p] * * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error)) + __Pyx_TraceLine(270,0,__PYX_ERR(0, 270, __pyx_L1_error)) __pyx_t_1 = __pyx_v_i_p; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_lower_bnd, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_lower_bnd, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_12) { } else { @@ -12637,31 +13964,31 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ goto __pyx_L7_bool_binop_done; } __pyx_t_1 = __pyx_v_i_p; - __pyx_t_6 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_upper_bnd, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_upper_bnd, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __pyx_t_12; __pyx_L7_bool_binop_done:; if (__pyx_t_13) { - /* "wfpt.pyx":249 + /* "wfpt.pyx":271 * * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: * return -np.inf # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(249,0,__PYX_ERR(0, 249, __pyx_L1_error)) + __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; @@ -12669,7 +13996,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; - /* "wfpt.pyx":248 + /* "wfpt.pyx":270 * upper_bnd = params_bnds[1][i_p] * * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: # <<<<<<<<<<<<<< @@ -12678,41 +14005,41 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ */ } - /* "wfpt.pyx":244 + /* "wfpt.pyx":266 * * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, len(params_ssm)): # <<<<<<<<<<<<<< * lower_bnd = params_bnds[0][i_p] * upper_bnd = params_bnds[1][i_p] */ - __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error)) + __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error)) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "wfpt.pyx":252 + /* "wfpt.pyx":274 * * * if len(params_rl) == 2: # <<<<<<<<<<<<<< * pos_alfa = params_rl[1] * else: */ - __Pyx_TraceLine(252,0,__PYX_ERR(0, 252, __pyx_L1_error)) - __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_params_rl)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error)) + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_params_rl)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 274, __pyx_L1_error) __pyx_t_13 = (__pyx_t_14 == 2); if (__pyx_t_13) { - /* "wfpt.pyx":253 + /* "wfpt.pyx":275 * * if len(params_rl) == 2: * pos_alfa = params_rl[1] # <<<<<<<<<<<<<< * else: * pos_alfa = params_rl[0] */ - __Pyx_TraceLine(253,0,__PYX_ERR(0, 253, __pyx_L1_error)) + __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error)) __pyx_t_1 = 1; __pyx_v_pos_alfa = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); - /* "wfpt.pyx":252 + /* "wfpt.pyx":274 * * * if len(params_rl) == 2: # <<<<<<<<<<<<<< @@ -12722,61 +14049,61 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ goto __pyx_L10; } - /* "wfpt.pyx":255 + /* "wfpt.pyx":277 * pos_alfa = params_rl[1] * else: * pos_alfa = params_rl[0] # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(255,0,__PYX_ERR(0, 255, __pyx_L1_error)) + __Pyx_TraceLine(277,0,__PYX_ERR(0, 277, __pyx_L1_error)) /*else*/ { __pyx_t_1 = 0; __pyx_v_pos_alfa = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); } __pyx_L10:; - /* "wfpt.pyx":259 + /* "wfpt.pyx":281 * * # unique represent # of conditions * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< * s = unique[j] * # select trials for current condition, identified by the split_by-array */ - __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error) __pyx_t_17 = (__pyx_t_2[0]); __pyx_t_18 = __pyx_t_17; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_18; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "wfpt.pyx":260 + /* "wfpt.pyx":282 * # unique represent # of conditions * for j in range(unique.shape[0]): * s = unique[j] # <<<<<<<<<<<<<< * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] */ - __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error)) + __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error)) __pyx_t_1 = __pyx_v_j; __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_unique.diminfo[0].strides)); - /* "wfpt.pyx":262 + /* "wfpt.pyx":284 * s = unique[j] * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< * responses = response[split_by == s] * xs = x[split_by == s] */ - __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 262, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 284, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -12793,28 +14120,28 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0; } __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 262, __pyx_L1_error) + if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 284, __pyx_L1_error) } __pyx_t_19 = 0; __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* "wfpt.pyx":263 + /* "wfpt.pyx":285 * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] * responses = response[split_by == s] # <<<<<<<<<<<<<< * xs = x[split_by == s] * s_size = xs.shape[0] */ - __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_TraceLine(285,0,__PYX_ERR(0, 285, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 263, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 285, __pyx_L1_error) __pyx_t_23 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -12831,28 +14158,28 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_22 = __pyx_t_21 = __pyx_t_20 = 0; } __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 263, __pyx_L1_error) + if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) } __pyx_t_23 = 0; __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* "wfpt.pyx":264 + /* "wfpt.pyx":286 * feedbacks = feedback[split_by == s] * responses = response[split_by == s] * xs = x[split_by == s] # <<<<<<<<<<<<<< * s_size = xs.shape[0] * qs[0] = q */ - __Pyx_TraceLine(264,0,__PYX_ERR(0, 264, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 264, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 286, __pyx_L1_error) __pyx_t_24 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -12869,53 +14196,53 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0; } __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 264, __pyx_L1_error) + if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) } __pyx_t_24 = 0; __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* "wfpt.pyx":265 + /* "wfpt.pyx":287 * responses = response[split_by == s] * xs = x[split_by == s] * s_size = xs.shape[0] # <<<<<<<<<<<<<< * qs[0] = q * qs[1] = q */ - __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error)) + __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error) __pyx_v_s_size = (__pyx_t_2[0]); - /* "wfpt.pyx":266 + /* "wfpt.pyx":288 * xs = x[split_by == s] * s_size = xs.shape[0] * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q * */ - __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error)) + __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error)) __pyx_t_1 = 0; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":267 + /* "wfpt.pyx":289 * s_size = xs.shape[0] * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< * * responses_qs = responses */ - __Pyx_TraceLine(267,0,__PYX_ERR(0, 267, __pyx_L1_error)) + __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error)) __pyx_t_1 = 1; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":269 + /* "wfpt.pyx":291 * qs[1] = q * * responses_qs = responses # <<<<<<<<<<<<<< * responses_qs[responses_qs == -1] = 0 * */ - __Pyx_TraceLine(269,0,__PYX_ERR(0, 269, __pyx_L1_error)) + __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error)) { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); @@ -12931,48 +14258,48 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_22 = __pyx_t_21 = __pyx_t_20 = 0; } __pyx_pybuffernd_responses_qs.diminfo[0].strides = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses_qs.diminfo[0].shape = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 269, __pyx_L1_error) + if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 291, __pyx_L1_error) } __Pyx_INCREF((PyObject *)__pyx_v_responses); __Pyx_XDECREF_SET(__pyx_v_responses_qs, ((PyArrayObject *)__pyx_v_responses)); - /* "wfpt.pyx":270 + /* "wfpt.pyx":292 * * responses_qs = responses * responses_qs[responses_qs == -1] = 0 # <<<<<<<<<<<<<< * * # don't calculate pdf for first trial but still update q */ - __Pyx_TraceLine(270,0,__PYX_ERR(0, 270, __pyx_L1_error)) - __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_responses_qs), __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_responses_qs), __pyx_t_5, __pyx_int_0) < 0))) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_TraceLine(292,0,__PYX_ERR(0, 292, __pyx_L1_error)) + __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_responses_qs), __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_responses_qs), __pyx_t_5, __pyx_int_0) < 0))) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "wfpt.pyx":273 + /* "wfpt.pyx":295 * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses_qs[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: */ - __Pyx_TraceLine(273,0,__PYX_ERR(0, 273, __pyx_L1_error)) + __Pyx_TraceLine(295,0,__PYX_ERR(0, 295, __pyx_L1_error)) __pyx_t_1 = 0; __pyx_t_25 = 0; __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides))); if (__pyx_t_13) { - /* "wfpt.pyx":274 + /* "wfpt.pyx":296 * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses_qs[0]]: * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< * else: * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) */ - __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error)) + __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error)) __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - /* "wfpt.pyx":273 + /* "wfpt.pyx":295 * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses_qs[0]]: # <<<<<<<<<<<<<< @@ -12982,114 +14309,114 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ goto __pyx_L13; } - /* "wfpt.pyx":276 + /* "wfpt.pyx":298 * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(276,0,__PYX_ERR(0, 276, __pyx_L1_error)) + __Pyx_TraceLine(298,0,__PYX_ERR(0, 298, __pyx_L1_error)) /*else*/ { __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); } __pyx_L13:; - /* "wfpt.pyx":281 + /* "wfpt.pyx":303 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses_qs[0]] = qs[responses_qs[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses_qs[0]]) * */ - __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error)) + __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) __pyx_t_25 = 0; __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - /* "wfpt.pyx":282 + /* "wfpt.pyx":304 * # received on current trial. * qs[responses_qs[0]] = qs[responses_qs[0]] + \ * alfa * (feedbacks[0] - qs[responses_qs[0]]) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error)) + __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error)) __pyx_t_1 = 0; __pyx_t_27 = 0; __pyx_t_28 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - /* "wfpt.pyx":281 + /* "wfpt.pyx":303 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses_qs[0]] = qs[responses_qs[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses_qs[0]]) * */ - __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error)) + __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) __pyx_t_29 = 0; __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_qs.diminfo[0].strides))))); - /* "wfpt.pyx":285 + /* "wfpt.pyx":307 * * * data[0, 0] = 0.0 # <<<<<<<<<<<<<< * # loop through all trials in current condition * for i in range(1, s_size): */ - __Pyx_TraceLine(285,0,__PYX_ERR(0, 285, __pyx_L1_error)) + __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error)) __pyx_t_27 = 0; __pyx_t_28 = 0; *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_data.diminfo[1].strides) = 0.0; - /* "wfpt.pyx":287 + /* "wfpt.pyx":309 * data[0, 0] = 0.0 * # loop through all trials in current condition * for i in range(1, s_size): # <<<<<<<<<<<<<< * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v * # Check for boundary violations -- if true, return -np.inf */ - __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error)) + __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error)) __pyx_t_16 = __pyx_v_s_size; __pyx_t_31 = __pyx_t_16; for (__pyx_t_32 = 1; __pyx_t_32 < __pyx_t_31; __pyx_t_32+=1) { __pyx_v_i = __pyx_t_32; - /* "wfpt.pyx":288 + /* "wfpt.pyx":310 * # loop through all trials in current condition * for i in range(1, s_size): * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v # <<<<<<<<<<<<<< * # Check for boundary violations -- if true, return -np.inf * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: */ - __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error)) + __Pyx_TraceLine(310,0,__PYX_ERR(0, 310, __pyx_L1_error)) __pyx_t_28 = 1; __pyx_t_27 = 0; __pyx_t_1 = (__pyx_v_cumm_s_size + __pyx_v_i); __pyx_t_25 = 0; *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_data.diminfo[1].strides) = (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v); - /* "wfpt.pyx":290 + /* "wfpt.pyx":312 * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v * # Check for boundary violations -- if true, return -np.inf * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(290,0,__PYX_ERR(0, 290, __pyx_L1_error)) + __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error)) __pyx_t_27 = (__pyx_v_cumm_s_size + __pyx_v_i); __pyx_t_28 = 0; - __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_12) { } else { @@ -13098,44 +14425,44 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ } __pyx_t_28 = (__pyx_v_cumm_s_size + __pyx_v_i); __pyx_t_27 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __pyx_t_12; __pyx_L17_bool_binop_done:; if (__pyx_t_13) { - /* "wfpt.pyx":291 + /* "wfpt.pyx":313 * # Check for boundary violations -- if true, return -np.inf * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: * return -np.inf # <<<<<<<<<<<<<< * * # get learning rate for current trial. if pos_alpha is not in */ - __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error)) + __Pyx_TraceLine(313,0,__PYX_ERR(0, 313, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_6 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "wfpt.pyx":290 + /* "wfpt.pyx":312 * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v * # Check for boundary violations -- if true, return -np.inf * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< @@ -13144,31 +14471,31 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ */ } - /* "wfpt.pyx":296 + /* "wfpt.pyx":318 * # include it will be same as alpha so can still use this * # calculation: * if feedbacks[i] > qs[responses_qs[i]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: */ - __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error)) + __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error)) __pyx_t_27 = __pyx_v_i; __pyx_t_28 = __pyx_v_i; __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides))); if (__pyx_t_13) { - /* "wfpt.pyx":297 + /* "wfpt.pyx":319 * # calculation: * if feedbacks[i] > qs[responses_qs[i]]: * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< * else: * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) */ - __Pyx_TraceLine(297,0,__PYX_ERR(0, 297, __pyx_L1_error)) + __Pyx_TraceLine(319,0,__PYX_ERR(0, 319, __pyx_L1_error)) __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - /* "wfpt.pyx":296 + /* "wfpt.pyx":318 * # include it will be same as alpha so can still use this * # calculation: * if feedbacks[i] > qs[responses_qs[i]]: # <<<<<<<<<<<<<< @@ -13178,94 +14505,95 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ goto __pyx_L19; } - /* "wfpt.pyx":299 + /* "wfpt.pyx":321 * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ - __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error)) + __Pyx_TraceLine(321,0,__PYX_ERR(0, 321, __pyx_L1_error)) /*else*/ { __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); } __pyx_L19:; - /* "wfpt.pyx":303 + /* "wfpt.pyx":325 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size */ - __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) + __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error)) __pyx_t_28 = __pyx_v_i; __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - /* "wfpt.pyx":304 + /* "wfpt.pyx":326 * # received on current trial. * qs[responses_qs[i]] = qs[responses_qs[i]] + \ * alfa * (feedbacks[i] - qs[responses_qs[i]]) # <<<<<<<<<<<<<< * cumm_s_size += s_size * */ - __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error)) + __Pyx_TraceLine(326,0,__PYX_ERR(0, 326, __pyx_L1_error)) __pyx_t_27 = __pyx_v_i; __pyx_t_1 = __pyx_v_i; __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - /* "wfpt.pyx":303 + /* "wfpt.pyx":325 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size */ - __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) + __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error)) __pyx_t_29 = __pyx_v_i; __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides))))); } - /* "wfpt.pyx":305 + /* "wfpt.pyx":327 * qs[responses_qs[i]] = qs[responses_qs[i]] + \ * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(305,0,__PYX_ERR(0, 305, __pyx_L1_error)) + __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error)) __pyx_v_cumm_s_size = (__pyx_v_cumm_s_size + __pyx_v_s_size); } - /* "wfpt.pyx":308 + /* "wfpt.pyx":330 * * * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) # <<<<<<<<<<<<<< * data[:, n_params:] = np.stack([x, response], axis = 1) * */ - __Pyx_TraceLine(308,0,__PYX_ERR(0, 308, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_params_ssm), __pyx_slice__10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_params_ssm), __pyx_slice__11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_33 = PyTuple_New(2); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_33 = PyTuple_New(2); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_int_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_int_1)) __PYX_ERR(0, 330, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); @@ -13275,27 +14603,29 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_33}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); @@ -13305,123 +14635,125 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_33}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_33 = PySlice_New(__pyx_int_1, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_33 = PySlice_New(__pyx_int_1, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_slice__7); - __Pyx_GIVEREF(__pyx_slice__7); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__7); + __Pyx_INCREF(__pyx_slice__8); + __Pyx_GIVEREF(__pyx_slice__8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__8)) __PYX_ERR(0, 330, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_33); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_33); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_33)) __PYX_ERR(0, 330, __pyx_L1_error); __pyx_t_33 = 0; - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_t_7, __pyx_t_6) < 0))) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_t_7, __pyx_t_6) < 0))) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "wfpt.pyx":309 + /* "wfpt.pyx":331 * * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) * data[:, n_params:] = np.stack([x, response], axis = 1) # <<<<<<<<<<<<<< * * # Call to network: */ - __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_stack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_stack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); - PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_x)); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_x))) __PYX_ERR(0, 331, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_response); __Pyx_GIVEREF((PyObject *)__pyx_v_response); - PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_response)); - __pyx_t_33 = PyTuple_New(1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 309, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_response))) __PYX_ERR(0, 331, __pyx_L1_error); + __pyx_t_33 = PyTuple_New(1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 309, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_33, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_33, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_33 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_33 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__7); - __Pyx_GIVEREF(__pyx_slice__7); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__7); + __Pyx_INCREF(__pyx_slice__8); + __Pyx_GIVEREF(__pyx_slice__8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__8)) __PYX_ERR(0, 331, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_33); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_33); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_33)) __PYX_ERR(0, 331, __pyx_L1_error); __pyx_t_33 = 0; - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_t_6, __pyx_t_5) < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_t_6, __pyx_t_5) < 0))) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "wfpt.pyx":312 + /* "wfpt.pyx":334 * * # Call to network: * if p_outlier == 0: # <<<<<<<<<<<<<< * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * else: */ - __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error)) + __Pyx_TraceLine(334,0,__PYX_ERR(0, 334, __pyx_L1_error)) __pyx_t_13 = (__pyx_v_p_outlier == 0.0); if (__pyx_t_13) { - /* "wfpt.pyx":313 + /* "wfpt.pyx":335 * # Call to network: * if p_outlier == 0: * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< * else: * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) */ - __Pyx_TraceLine(313,0,__PYX_ERR(0, 313, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_umath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_umath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_maximum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_maximum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_34 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_34)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); @@ -13431,19 +14763,21 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_34, ((PyObject *)__pyx_v_data)}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_34 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_34)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -13453,19 +14787,21 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_34, __pyx_t_7, __pyx_t_3}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_33))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_33); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); @@ -13475,20 +14811,21 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; } - __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_sum_logp = __pyx_t_35; - /* "wfpt.pyx":312 + /* "wfpt.pyx":334 * * # Call to network: * if p_outlier == 0: # <<<<<<<<<<<<<< @@ -13498,46 +14835,47 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ goto __pyx_L20; } - /* "wfpt.pyx":315 + /* "wfpt.pyx":337 * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * else: * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< * * return sum_logp */ - __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error)) + __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error)) /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_core); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_core); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_37); __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_umath); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_umath); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_maximum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_maximum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_37); __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_38); __pyx_t_39 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_38))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_38))) { __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_38); if (likely(__pyx_t_39)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); @@ -13547,19 +14885,21 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_39, ((PyObject *)__pyx_v_data)}; __pyx_t_36 = __Pyx_PyObject_FastCall(__pyx_t_38, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; - if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 315, __pyx_L1_error) + if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; } - __pyx_t_38 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_38 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_38); __pyx_t_39 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_37))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_37))) { __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_37); if (likely(__pyx_t_39)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); @@ -13569,19 +14909,21 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_39, __pyx_t_36, __pyx_t_38}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_37, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; } __pyx_t_37 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_34))) { __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_34); if (likely(__pyx_t_37)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34); @@ -13591,30 +14933,32 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_37, __pyx_t_7}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_34, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; } - __pyx_t_34 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_34 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_34); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_34); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __pyx_t_34 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_34 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); - __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_34); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_34); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; __pyx_t_34 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_34)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); @@ -13624,18 +14968,20 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_4}; __pyx_t_33 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 315, __pyx_L1_error) + if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = NULL; __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -13645,37 +14991,38 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_33}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_sum_logp = __pyx_t_35; } __pyx_L20:; - /* "wfpt.pyx":317 + /* "wfpt.pyx":339 * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) * * return sum_logp # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(317,0,__PYX_ERR(0, 317, __pyx_L1_error)) + __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "wfpt.pyx":206 + /* "wfpt.pyx":228 * * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< @@ -13749,7 +15096,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "wfpt.pyx":320 +/* "wfpt.pyx":342 * * * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< @@ -13758,16 +15105,16 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_13wiener_like_rl(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_15wiener_like_rl(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_12wiener_like_rl, "wiener_like_rl(ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double z, double err=1e-4, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_13wiener_like_rl = {"wiener_like_rl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_13wiener_like_rl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_12wiener_like_rl}; -static PyObject *__pyx_pw_4wfpt_13wiener_like_rl(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_14wiener_like_rl, "wiener_like_rl(ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double z, double err=1e-4, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_15wiener_like_rl = {"wiener_like_rl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_15wiener_like_rl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_14wiener_like_rl}; +static PyObject *__pyx_pw_4wfpt_15wiener_like_rl(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13790,18 +15137,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_rl (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 342, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_alpha,&__pyx_n_s_pos_alpha,&__pyx_n_s_v,&__pyx_n_s_z,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -13841,111 +15197,135 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 1); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 1); __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 2); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 2); __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 3); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 3); __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 4); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 4); __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos_alpha)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos_alpha)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 5); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 5); __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 6); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 6); __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 7); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 7); __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err); - if (value) { values[8] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[9] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[10] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[11] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[12] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[13] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[14] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L3_error) + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rl") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rl") < 0)) __PYX_ERR(0, 342, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -13978,70 +15358,83 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_response = ((PyArrayObject *)values[0]); __pyx_v_feedback = ((PyArrayObject *)values[1]); __pyx_v_split_by = ((PyArrayObject *)values[2]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) - __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) - __pyx_v_pos_alpha = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_pos_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) - __pyx_v_v = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) + __pyx_v_q = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) + __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) + __pyx_v_pos_alpha = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_pos_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) + __pyx_v_v = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) if (values[8]) { - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) } else { __pyx_v_err = ((double)((double)1e-4)); } if (values[9]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) } else { __pyx_v_n_st = ((int)((int)10)); } if (values[10]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) } else { __pyx_v_n_sz = ((int)((int)10)); } if (values[11]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) } else { __pyx_v_use_adaptive = ((int)((int)1)); } if (values[12]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) } else { __pyx_v_simps_err = ((double)((double)1e-8)); } if (values[13]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[14]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, __pyx_nargs); __PYX_ERR(0, 320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, __pyx_nargs); __PYX_ERR(0, 342, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_rl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 320, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 321, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 322, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_12wiener_like_rl(__pyx_self, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_alpha, __pyx_v_pos_alpha, __pyx_v_v, __pyx_v_z, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 342, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_14wiener_like_rl(__pyx_self, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_alpha, __pyx_v_pos_alpha, __pyx_v_v, __pyx_v_z, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_err, CYTHON_UNUSED int __pyx_v_n_st, CYTHON_UNUSED int __pyx_v_n_sz, CYTHON_UNUSED int __pyx_v_use_adaptive, CYTHON_UNUSED double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { +static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_err, CYTHON_UNUSED int __pyx_v_n_st, CYTHON_UNUSED int __pyx_v_n_sz, CYTHON_UNUSED int __pyx_v_use_adaptive, CYTHON_UNUSED double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { CYTHON_UNUSED Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_j; @@ -14106,9 +15499,9 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__11) + __Pyx_TraceFrameInit(__pyx_codeobj__12) __Pyx_RefNannySetupContext("wiener_like_rl", 0); - __Pyx_TraceCall("wiener_like_rl", __pyx_f[0], 320, 0, __PYX_ERR(0, 320, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_rl", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error)); __pyx_pybuffer_qs.pybuffer.buf = NULL; __pyx_pybuffer_qs.refcount = 0; __pyx_pybuffernd_qs.data = NULL; @@ -14139,79 +15532,80 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 320, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 342, __pyx_L1_error) } __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 320, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 342, __pyx_L1_error) } __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 320, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 342, __pyx_L1_error) } __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; - /* "wfpt.pyx":326 + /* "wfpt.pyx":348 * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0): * cdef Py_ssize_t size = response.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i, j * cdef Py_ssize_t s_size */ - __Pyx_TraceLine(326,0,__PYX_ERR(0, 326, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_response)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_response)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); - /* "wfpt.pyx":332 + /* "wfpt.pyx":354 * cdef double drift * cdef double p * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier * cdef double alfa */ - __Pyx_TraceLine(332,0,__PYX_ERR(0, 332, __pyx_L1_error)) + __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; - /* "wfpt.pyx":333 + /* "wfpt.pyx":355 * cdef double p * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< * cdef double alfa * cdef double pos_alfa */ - __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error)) + __Pyx_TraceLine(355,0,__PYX_ERR(0, 355, __pyx_L1_error)) __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - /* "wfpt.pyx":336 + /* "wfpt.pyx":358 * cdef double alfa * cdef double pos_alfa * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim=1] feedbacks * cdef np.ndarray[long, ndim=1] responses */ - __Pyx_TraceLine(336,0,__PYX_ERR(0, 336, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_TraceLine(358,0,__PYX_ERR(0, 358, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -14221,22 +15615,23 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 336, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 358, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 336, __pyx_L1_error) + __PYX_ERR(0, 358, __pyx_L1_error) } else {__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]; } } @@ -14244,22 +15639,23 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":339 + /* "wfpt.pyx":361 * cdef np.ndarray[double, ndim=1] feedbacks * cdef np.ndarray[long, ndim=1] responses * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< * * if not p_outlier_in_range(p_outlier): */ - __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_TraceLine(361,0,__PYX_ERR(0, 361, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -14269,21 +15665,22 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 339, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 361, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 339, __pyx_L1_error) + __PYX_ERR(0, 361, __pyx_L1_error) } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; } } @@ -14291,40 +15688,40 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":341 + /* "wfpt.pyx":363 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(341,0,__PYX_ERR(0, 341, __pyx_L1_error)) - __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error)) + __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_10); if (__pyx_t_11) { - /* "wfpt.pyx":342 + /* "wfpt.pyx":364 * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< * * if pos_alpha==100.00: */ - __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error)) + __Pyx_TraceLine(364,0,__PYX_ERR(0, 364, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":341 + /* "wfpt.pyx":363 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< @@ -14333,28 +15730,28 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "wfpt.pyx":344 + /* "wfpt.pyx":366 * return -np.inf * * if pos_alpha==100.00: # <<<<<<<<<<<<<< * pos_alfa = alpha * else: */ - __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error)) + __Pyx_TraceLine(366,0,__PYX_ERR(0, 366, __pyx_L1_error)) __pyx_t_11 = (__pyx_v_pos_alpha == 100.00); if (__pyx_t_11) { - /* "wfpt.pyx":345 + /* "wfpt.pyx":367 * * if pos_alpha==100.00: * pos_alfa = alpha # <<<<<<<<<<<<<< * else: * pos_alfa = pos_alpha */ - __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error)) + __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error)) __pyx_v_pos_alfa = __pyx_v_alpha; - /* "wfpt.pyx":344 + /* "wfpt.pyx":366 * return -np.inf * * if pos_alpha==100.00: # <<<<<<<<<<<<<< @@ -14364,60 +15761,60 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L4; } - /* "wfpt.pyx":347 + /* "wfpt.pyx":369 * pos_alfa = alpha * else: * pos_alfa = pos_alpha # <<<<<<<<<<<<<< * * # unique represent # of conditions */ - __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error)) + __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error)) /*else*/ { __pyx_v_pos_alfa = __pyx_v_pos_alpha; } __pyx_L4:; - /* "wfpt.pyx":350 + /* "wfpt.pyx":372 * * # unique represent # of conditions * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< * s = unique[j] * # select trials for current condition, identified by the split_by-array */ - __Pyx_TraceLine(350,0,__PYX_ERR(0, 350, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L1_error) __pyx_t_12 = (__pyx_t_1[0]); __pyx_t_13 = __pyx_t_12; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "wfpt.pyx":351 + /* "wfpt.pyx":373 * # unique represent # of conditions * for j in range(unique.shape[0]): * s = unique[j] # <<<<<<<<<<<<<< * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] */ - __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error)) + __Pyx_TraceLine(373,0,__PYX_ERR(0, 373, __pyx_L1_error)) __pyx_t_15 = __pyx_v_j; __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_unique.diminfo[0].strides)); - /* "wfpt.pyx":353 + /* "wfpt.pyx":375 * s = unique[j] * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< * responses = response[split_by == s] * s_size = responses.shape[0] */ - __Pyx_TraceLine(353,0,__PYX_ERR(0, 353, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_TraceLine(375,0,__PYX_ERR(0, 375, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 353, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 375, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14434,28 +15831,28 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; } __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_t_16 = 0; __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "wfpt.pyx":354 + /* "wfpt.pyx":376 * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] * responses = response[split_by == s] # <<<<<<<<<<<<<< * s_size = responses.shape[0] * qs[0] = q */ - __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_TraceLine(376,0,__PYX_ERR(0, 376, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 354, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 376, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -14472,70 +15869,70 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_19 = __pyx_t_18 = __pyx_t_17 = 0; } __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 354, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) } __pyx_t_20 = 0; __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "wfpt.pyx":355 + /* "wfpt.pyx":377 * feedbacks = feedback[split_by == s] * responses = response[split_by == s] * s_size = responses.shape[0] # <<<<<<<<<<<<<< * qs[0] = q * qs[1] = q */ - __Pyx_TraceLine(355,0,__PYX_ERR(0, 355, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_responses)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_responses)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error) __pyx_v_s_size = (__pyx_t_1[0]); - /* "wfpt.pyx":356 + /* "wfpt.pyx":378 * responses = response[split_by == s] * s_size = responses.shape[0] * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q * */ - __Pyx_TraceLine(356,0,__PYX_ERR(0, 356, __pyx_L1_error)) + __Pyx_TraceLine(378,0,__PYX_ERR(0, 378, __pyx_L1_error)) __pyx_t_15 = 0; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":357 + /* "wfpt.pyx":379 * s_size = responses.shape[0] * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< * * # don't calculate pdf for first trial but still update q */ - __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error)) + __Pyx_TraceLine(379,0,__PYX_ERR(0, 379, __pyx_L1_error)) __pyx_t_15 = 1; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":360 + /* "wfpt.pyx":382 * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: */ - __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error)) + __Pyx_TraceLine(382,0,__PYX_ERR(0, 382, __pyx_L1_error)) __pyx_t_15 = 0; __pyx_t_21 = 0; __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides))); if (__pyx_t_11) { - /* "wfpt.pyx":361 + /* "wfpt.pyx":383 * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) */ - __Pyx_TraceLine(361,0,__PYX_ERR(0, 361, __pyx_L1_error)) + __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error)) __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - /* "wfpt.pyx":360 + /* "wfpt.pyx":382 * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< @@ -14545,101 +15942,101 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L7; } - /* "wfpt.pyx":363 + /* "wfpt.pyx":385 * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ - __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error)) + __Pyx_TraceLine(385,0,__PYX_ERR(0, 385, __pyx_L1_error)) /*else*/ { __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); } __pyx_L7:; - /* "wfpt.pyx":367 + /* "wfpt.pyx":389 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses[0]]) * */ - __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error)) + __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error)) __pyx_t_21 = 0; __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); - /* "wfpt.pyx":368 + /* "wfpt.pyx":390 * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ * alfa * (feedbacks[0] - qs[responses[0]]) # <<<<<<<<<<<<<< * * # loop through all trials in current condition */ - __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error)) + __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error)) __pyx_t_15 = 0; __pyx_t_23 = 0; __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); - /* "wfpt.pyx":367 + /* "wfpt.pyx":389 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses[0]]) * */ - __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error)) + __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error)) __pyx_t_25 = 0; __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))))); - /* "wfpt.pyx":371 + /* "wfpt.pyx":393 * * # loop through all trials in current condition * for i in range(1, s_size): # <<<<<<<<<<<<<< * * drift = (qs[1] - qs[0]) * v */ - __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error)) + __Pyx_TraceLine(393,0,__PYX_ERR(0, 393, __pyx_L1_error)) __pyx_t_27 = __pyx_v_s_size; __pyx_t_28 = __pyx_t_27; for (__pyx_t_29 = 1; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { __pyx_v_i = __pyx_t_29; - /* "wfpt.pyx":373 + /* "wfpt.pyx":395 * for i in range(1, s_size): * * drift = (qs[1] - qs[0]) * v # <<<<<<<<<<<<<< * * if drift == 0: */ - __Pyx_TraceLine(373,0,__PYX_ERR(0, 373, __pyx_L1_error)) + __Pyx_TraceLine(395,0,__PYX_ERR(0, 395, __pyx_L1_error)) __pyx_t_23 = 1; __pyx_t_24 = 0; __pyx_v_drift = (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v); - /* "wfpt.pyx":375 + /* "wfpt.pyx":397 * drift = (qs[1] - qs[0]) * v * * if drift == 0: # <<<<<<<<<<<<<< * p = 0.5 * else: */ - __Pyx_TraceLine(375,0,__PYX_ERR(0, 375, __pyx_L1_error)) + __Pyx_TraceLine(397,0,__PYX_ERR(0, 397, __pyx_L1_error)) __pyx_t_11 = (__pyx_v_drift == 0.0); if (__pyx_t_11) { - /* "wfpt.pyx":376 + /* "wfpt.pyx":398 * * if drift == 0: * p = 0.5 # <<<<<<<<<<<<<< * else: * if responses[i] == 1: */ - __Pyx_TraceLine(376,0,__PYX_ERR(0, 376, __pyx_L1_error)) + __Pyx_TraceLine(398,0,__PYX_ERR(0, 398, __pyx_L1_error)) __pyx_v_p = 0.5; - /* "wfpt.pyx":375 + /* "wfpt.pyx":397 * drift = (qs[1] - qs[0]) * v * * if drift == 0: # <<<<<<<<<<<<<< @@ -14649,30 +16046,30 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L10; } - /* "wfpt.pyx":378 + /* "wfpt.pyx":400 * p = 0.5 * else: * if responses[i] == 1: # <<<<<<<<<<<<<< * p = (2.718281828459**(-2 * z * drift) - 1) / \ * (2.718281828459**(-2 * drift) - 1) */ - __Pyx_TraceLine(378,0,__PYX_ERR(0, 378, __pyx_L1_error)) + __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error)) /*else*/ { __pyx_t_24 = __pyx_v_i; __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_responses.diminfo[0].strides)) == 1); if (__pyx_t_11) { - /* "wfpt.pyx":379 + /* "wfpt.pyx":401 * else: * if responses[i] == 1: * p = (2.718281828459**(-2 * z * drift) - 1) / \ # <<<<<<<<<<<<<< * (2.718281828459**(-2 * drift) - 1) * else: */ - __Pyx_TraceLine(379,0,__PYX_ERR(0, 379, __pyx_L1_error)) + __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error)) __pyx_v_p = ((pow(2.718281828459, ((-2.0 * __pyx_v_z) * __pyx_v_drift)) - 1.0) / (pow(2.718281828459, (-2.0 * __pyx_v_drift)) - 1.0)); - /* "wfpt.pyx":378 + /* "wfpt.pyx":400 * p = 0.5 * else: * if responses[i] == 1: # <<<<<<<<<<<<<< @@ -14682,73 +16079,73 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L11; } - /* "wfpt.pyx":382 + /* "wfpt.pyx":404 * (2.718281828459**(-2 * drift) - 1) * else: * p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ # <<<<<<<<<<<<<< * (2.718281828459**(-2 * drift) - 1) * */ - __Pyx_TraceLine(382,0,__PYX_ERR(0, 382, __pyx_L1_error)) + __Pyx_TraceLine(404,0,__PYX_ERR(0, 404, __pyx_L1_error)) /*else*/ { - /* "wfpt.pyx":383 + /* "wfpt.pyx":405 * else: * p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ * (2.718281828459**(-2 * drift) - 1) # <<<<<<<<<<<<<< * * # If one probability = 0, the log sum will be -Inf */ - __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error)) + __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error)) __pyx_v_p = (1.0 - ((pow(2.718281828459, ((-2.0 * __pyx_v_z) * __pyx_v_drift)) - 1.0) / (pow(2.718281828459, (-2.0 * __pyx_v_drift)) - 1.0))); } __pyx_L11:; } __pyx_L10:; - /* "wfpt.pyx":386 + /* "wfpt.pyx":408 * * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< * if p == 0: * return -np.inf */ - __Pyx_TraceLine(386,0,__PYX_ERR(0, 386, __pyx_L1_error)) + __Pyx_TraceLine(408,0,__PYX_ERR(0, 408, __pyx_L1_error)) __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - /* "wfpt.pyx":387 + /* "wfpt.pyx":409 * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier * if p == 0: # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(387,0,__PYX_ERR(0, 387, __pyx_L1_error)) + __Pyx_TraceLine(409,0,__PYX_ERR(0, 409, __pyx_L1_error)) __pyx_t_11 = (__pyx_v_p == 0.0); if (__pyx_t_11) { - /* "wfpt.pyx":388 + /* "wfpt.pyx":410 * p = p * (1 - p_outlier) + wp_outlier * if p == 0: * return -np.inf # <<<<<<<<<<<<<< * * sum_logp += log(p) */ - __Pyx_TraceLine(388,0,__PYX_ERR(0, 388, __pyx_L1_error)) + __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":387 + /* "wfpt.pyx":409 * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier * if p == 0: # <<<<<<<<<<<<<< @@ -14757,41 +16154,41 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "wfpt.pyx":390 + /* "wfpt.pyx":412 * return -np.inf * * sum_logp += log(p) # <<<<<<<<<<<<<< * * # get learning rate for current trial. if pos_alpha is not in */ - __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error)) + __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error)) __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - /* "wfpt.pyx":395 + /* "wfpt.pyx":417 * # include it will be same as alpha so can still use this * # calculation: * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: */ - __Pyx_TraceLine(395,0,__PYX_ERR(0, 395, __pyx_L1_error)) + __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error)) __pyx_t_24 = __pyx_v_i; __pyx_t_23 = __pyx_v_i; __pyx_t_15 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides))); if (__pyx_t_11) { - /* "wfpt.pyx":396 + /* "wfpt.pyx":418 * # calculation: * if feedbacks[i] > qs[responses[i]]: * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) */ - __Pyx_TraceLine(396,0,__PYX_ERR(0, 396, __pyx_L1_error)) + __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error)) __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - /* "wfpt.pyx":395 + /* "wfpt.pyx":417 * # include it will be same as alpha so can still use this * # calculation: * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< @@ -14801,72 +16198,72 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L13; } - /* "wfpt.pyx":398 + /* "wfpt.pyx":420 * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ - __Pyx_TraceLine(398,0,__PYX_ERR(0, 398, __pyx_L1_error)) + __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error)) /*else*/ { __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); } __pyx_L13:; - /* "wfpt.pyx":402 + /* "wfpt.pyx":424 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses[i]]) * return sum_logp */ - __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error)) + __Pyx_TraceLine(424,0,__PYX_ERR(0, 424, __pyx_L1_error)) __pyx_t_23 = __pyx_v_i; __pyx_t_15 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); - /* "wfpt.pyx":403 + /* "wfpt.pyx":425 * # received on current trial. * qs[responses[i]] = qs[responses[i]] + \ * alfa * (feedbacks[i] - qs[responses[i]]) # <<<<<<<<<<<<<< * return sum_logp * */ - __Pyx_TraceLine(403,0,__PYX_ERR(0, 403, __pyx_L1_error)) + __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) __pyx_t_24 = __pyx_v_i; __pyx_t_21 = __pyx_v_i; __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); - /* "wfpt.pyx":402 + /* "wfpt.pyx":424 * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward * # received on current trial. * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses[i]]) * return sum_logp */ - __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error)) + __Pyx_TraceLine(424,0,__PYX_ERR(0, 424, __pyx_L1_error)) __pyx_t_25 = __pyx_v_i; __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides))))); } } - /* "wfpt.pyx":404 + /* "wfpt.pyx":426 * qs[responses[i]] = qs[responses[i]] + \ * alfa * (feedbacks[i] - qs[responses[i]]) * return sum_logp # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(404,0,__PYX_ERR(0, 404, __pyx_L1_error)) + __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":320 + /* "wfpt.pyx":342 * * * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< @@ -14915,7 +16312,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s return __pyx_r; } -/* "wfpt.pyx":407 +/* "wfpt.pyx":429 * * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< @@ -14924,16 +16321,16 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_15wiener_like_multi(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_17wiener_like_multi(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_14wiener_like_multi, "wiener_like_multi(ndarray x, v, sv, a, z, sz, t, st, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_15wiener_like_multi = {"wiener_like_multi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_15wiener_like_multi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_14wiener_like_multi}; -static PyObject *__pyx_pw_4wfpt_15wiener_like_multi(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_16wiener_like_multi, "wiener_like_multi(ndarray x, v, sv, a, z, sz, t, st, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_17wiener_like_multi = {"wiener_like_multi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_17wiener_like_multi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_16wiener_like_multi}; +static PyObject *__pyx_pw_4wfpt_17wiener_like_multi(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14957,19 +16354,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_multi (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 429, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_multi,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - values[9] = ((PyObject *)((PyObject *)Py_None)); + values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -15011,118 +16417,145 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 1); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 1); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 2); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 2); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 3); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 3); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 4); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 4); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 5); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 5); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 6); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 6); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 7); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 7); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 8); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 8); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi); - if (value) { values[9] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[10] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[11] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[12] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[13] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[14] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[15] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi") < 0)) __PYX_ERR(0, 407, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi") < 0)) __PYX_ERR(0, 429, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -15161,60 +16594,73 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_sz = values[5]; __pyx_v_t = values[6]; __pyx_v_st = values[7]; - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) __pyx_v_multi = values[9]; if (values[10]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error) } else { __pyx_v_n_st = ((int)((int)10)); } if (values[11]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error) } else { __pyx_v_n_sz = ((int)((int)10)); } if (values[12]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error) } else { __pyx_v_use_adaptive = ((int)((int)1)); } if (values[13]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error) } else { __pyx_v_simps_err = ((double)((double)1e-3)); } if (values[14]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[15]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, __pyx_nargs); __PYX_ERR(0, 407, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, __pyx_nargs); __PYX_ERR(0, 429, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 407, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_14wiener_like_multi(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_16wiener_like_multi(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { +static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_v_i; double __pyx_v_p; @@ -15253,96 +16699,96 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__12) + __Pyx_TraceFrameInit(__pyx_codeobj__13) __Pyx_RefNannySetupContext("wiener_like_multi", 0); - __Pyx_TraceCall("wiener_like_multi", __pyx_f[0], 407, 0, __PYX_ERR(0, 407, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_multi", __pyx_f[0], 429, 0, __PYX_ERR(0, 429, __pyx_L1_error)); __pyx_pybuffer_x.pybuffer.buf = NULL; __pyx_pybuffer_x.refcount = 0; __pyx_pybuffernd_x.data = NULL; __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 407, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 429, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - /* "wfpt.pyx":410 + /* "wfpt.pyx":432 * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef double p = 0 */ - __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __Pyx_TraceLine(432,0,__PYX_ERR(0, 432, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); - /* "wfpt.pyx":412 + /* "wfpt.pyx":434 * cdef Py_ssize_t size = x.shape[0] * cdef Py_ssize_t i * cdef double p = 0 # <<<<<<<<<<<<<< * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier */ - __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error)) + __Pyx_TraceLine(434,0,__PYX_ERR(0, 434, __pyx_L1_error)) __pyx_v_p = 0.0; - /* "wfpt.pyx":413 + /* "wfpt.pyx":435 * cdef Py_ssize_t i * cdef double p = 0 * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier * */ - __Pyx_TraceLine(413,0,__PYX_ERR(0, 413, __pyx_L1_error)) + __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; - /* "wfpt.pyx":414 + /* "wfpt.pyx":436 * cdef double p = 0 * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< * * if multi is None: */ - __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error)) + __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error)) __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - /* "wfpt.pyx":416 + /* "wfpt.pyx":438 * cdef double wp_outlier = w_outlier * p_outlier * * if multi is None: # <<<<<<<<<<<<<< * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: */ - __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error)) + __Pyx_TraceLine(438,0,__PYX_ERR(0, 438, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_multi == Py_None); if (__pyx_t_2) { - /* "wfpt.pyx":417 + /* "wfpt.pyx":439 * * if multi is None: * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< * else: * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} */ - __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error)) + __Pyx_TraceLine(439,0,__PYX_ERR(0, 439, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_11 = __pyx_f_4wfpt_full_pdf(__pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_t_12 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_11 = __pyx_f_4wfpt_full_pdf(__pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; - /* "wfpt.pyx":416 + /* "wfpt.pyx":438 * cdef double wp_outlier = w_outlier * p_outlier * * if multi is None: # <<<<<<<<<<<<<< @@ -15351,40 +16797,41 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py */ } - /* "wfpt.pyx":419 + /* "wfpt.pyx":441 * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} # <<<<<<<<<<<<<< * params_iter = copy(params) * for i in range(size): */ - __Pyx_TraceLine(419,0,__PYX_ERR(0, 419, __pyx_L1_error)) + __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error)) /*else*/ { - __pyx_t_12 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 419, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 419, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 419, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 419, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 419, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 419, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 441, __pyx_L1_error) __pyx_v_params = ((PyObject*)__pyx_t_12); __pyx_t_12 = 0; - /* "wfpt.pyx":420 + /* "wfpt.pyx":442 * else: * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} * params_iter = copy(params) # <<<<<<<<<<<<<< * for i in range(size): * for param in multi: */ - __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_TraceLine(442,0,__PYX_ERR(0, 442, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_15 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); @@ -15394,62 +16841,63 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py __pyx_t_15 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_params}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 420, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __pyx_v_params_iter = __pyx_t_12; __pyx_t_12 = 0; - /* "wfpt.pyx":421 + /* "wfpt.pyx":443 * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} * params_iter = copy(params) * for i in range(size): # <<<<<<<<<<<<<< * for param in multi: * params_iter[param] = params[param][i] */ - __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error)) + __Pyx_TraceLine(443,0,__PYX_ERR(0, 443, __pyx_L1_error)) __pyx_t_16 = __pyx_v_size; __pyx_t_17 = __pyx_t_16; for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_i = __pyx_t_18; - /* "wfpt.pyx":422 + /* "wfpt.pyx":444 * params_iter = copy(params) * for i in range(size): * for param in multi: # <<<<<<<<<<<<<< * params_iter[param] = params[param][i] * if abs(x[i]) != 999.: */ - __Pyx_TraceLine(422,0,__PYX_ERR(0, 422, __pyx_L1_error)) + __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error)) if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { __pyx_t_12 = __pyx_v_multi; __Pyx_INCREF(__pyx_t_12); __pyx_t_19 = 0; __pyx_t_20 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 444, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_12))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_12)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 444, __pyx_L1_error) #else - __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_12)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 444, __pyx_L1_error) #else - __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif } @@ -15459,7 +16907,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 422, __pyx_L1_error) + else __PYX_ERR(0, 444, __pyx_L1_error) } break; } @@ -15468,128 +16916,128 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_13); __pyx_t_13 = 0; - /* "wfpt.pyx":423 + /* "wfpt.pyx":445 * for i in range(size): * for param in multi: * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< * if abs(x[i]) != 999.: * p = full_pdf(x[i], params_iter['v'], */ - __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error)) - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 423, __pyx_L1_error) + __Pyx_TraceLine(445,0,__PYX_ERR(0, 445, __pyx_L1_error)) + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_14) < 0))) __PYX_ERR(0, 423, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_14) < 0))) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "wfpt.pyx":422 + /* "wfpt.pyx":444 * params_iter = copy(params) * for i in range(size): * for param in multi: # <<<<<<<<<<<<<< * params_iter[param] = params[param][i] * if abs(x[i]) != 999.: */ - __Pyx_TraceLine(422,0,__PYX_ERR(0, 422, __pyx_L1_error)) + __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error)) } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "wfpt.pyx":424 + /* "wfpt.pyx":446 * for param in multi: * params_iter[param] = params[param][i] * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< * p = full_pdf(x[i], params_iter['v'], * params_iter['sv'], params_iter['a'], params_iter['z'], */ - __Pyx_TraceLine(424,0,__PYX_ERR(0, 424, __pyx_L1_error)) + __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error)) __pyx_t_21 = __pyx_v_i; __pyx_t_2 = (fabs((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides))) != 999.); if (__pyx_t_2) { - /* "wfpt.pyx":425 + /* "wfpt.pyx":447 * params_iter[param] = params[param][i] * if abs(x[i]) != 999.: * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter['t'], params_iter['st'], */ - __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) + __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error)) __pyx_t_21 = __pyx_v_i; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "wfpt.pyx":426 + /* "wfpt.pyx":448 * if abs(x[i]) != 999.: * p = full_pdf(x[i], params_iter['v'], * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< * params_iter['sz'], params_iter['t'], params_iter['st'], * err, n_st, n_sz, use_adaptive, simps_err) */ - __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "wfpt.pyx":427 + /* "wfpt.pyx":449 * p = full_pdf(x[i], params_iter['v'], * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter['t'], params_iter['st'], # <<<<<<<<<<<<<< * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier */ - __Pyx_TraceLine(427,0,__PYX_ERR(0, 427, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "wfpt.pyx":425 + /* "wfpt.pyx":447 * params_iter[param] = params[param][i] * if abs(x[i]) != 999.: * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter['t'], params_iter['st'], */ - __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) + __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error)) __pyx_t_22.__pyx_n = 4; __pyx_t_22.n_st = __pyx_v_n_st; __pyx_t_22.n_sz = __pyx_v_n_sz; __pyx_t_22.use_adaptive = __pyx_v_use_adaptive; __pyx_t_22.simps_err = __pyx_v_simps_err; - __pyx_t_4 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5, __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5, __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) __pyx_v_p = __pyx_t_4; - /* "wfpt.pyx":429 + /* "wfpt.pyx":451 * params_iter['sz'], params_iter['t'], params_iter['st'], * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< * elif x[i] == 999.: * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) */ - __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error)) + __Pyx_TraceLine(451,0,__PYX_ERR(0, 451, __pyx_L1_error)) __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - /* "wfpt.pyx":424 + /* "wfpt.pyx":446 * for param in multi: * params_iter[param] = params[param][i] * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< @@ -15599,42 +17047,42 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py goto __pyx_L9; } - /* "wfpt.pyx":430 + /* "wfpt.pyx":452 * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier * elif x[i] == 999.: # <<<<<<<<<<<<<< * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) * else: # x[i] == -999. */ - __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error)) + __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error)) __pyx_t_21 = __pyx_v_i; __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)) == 999.); if (__pyx_t_2) { - /* "wfpt.pyx":431 + /* "wfpt.pyx":453 * p = p * (1 - p_outlier) + wp_outlier * elif x[i] == 999.: * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< * else: # x[i] == -999. * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) */ - __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_TraceLine(453,0,__PYX_ERR(0, 453, __pyx_L1_error)) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_7 = __pyx_f_4wfpt_prob_ub(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __pyx_f_4wfpt_prob_ub(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) __pyx_v_p = __pyx_t_7; - /* "wfpt.pyx":430 + /* "wfpt.pyx":452 * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier * elif x[i] == 999.: # <<<<<<<<<<<<<< @@ -15644,60 +17092,60 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py goto __pyx_L9; } - /* "wfpt.pyx":433 + /* "wfpt.pyx":455 * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) * else: # x[i] == -999. * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< * * sum_logp += log(p) */ - __Pyx_TraceLine(433,0,__PYX_ERR(0, 433, __pyx_L1_error)) + __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error)) /*else*/ { - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_4 = __pyx_f_4wfpt_prob_ub(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4wfpt_prob_ub(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) __pyx_v_p = (1.0 - __pyx_t_4); } __pyx_L9:; - /* "wfpt.pyx":435 + /* "wfpt.pyx":457 * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) * * sum_logp += log(p) # <<<<<<<<<<<<<< * * return sum_logp */ - __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error)) + __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error)) __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); } - /* "wfpt.pyx":437 + /* "wfpt.pyx":459 * sum_logp += log(p) * * return sum_logp # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error)) + __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; } - /* "wfpt.pyx":407 + /* "wfpt.pyx":429 * * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< @@ -15731,7 +17179,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "wfpt.pyx":440 +/* "wfpt.pyx":462 * * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< @@ -15740,16 +17188,16 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_multi(CYTHON_UNUSED PyObject *__py */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_17wiener_like_multi_rlddm(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_19wiener_like_multi_rlddm(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_16wiener_like_multi_rlddm, "wiener_like_multi_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_17wiener_like_multi_rlddm = {"wiener_like_multi_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_17wiener_like_multi_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_16wiener_like_multi_rlddm}; -static PyObject *__pyx_pw_4wfpt_17wiener_like_multi_rlddm(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_18wiener_like_multi_rlddm, "wiener_like_multi_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); +static PyMethodDef __pyx_mdef_4wfpt_19wiener_like_multi_rlddm = {"wiener_like_multi_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_19wiener_like_multi_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_18wiener_like_multi_rlddm}; +static PyObject *__pyx_pw_4wfpt_19wiener_like_multi_rlddm(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15778,27 +17226,36 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_multi_rlddm (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 462, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_alpha,&__pyx_n_s_err,&__pyx_n_s_multi,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - /* "wfpt.pyx":444 + /* "wfpt.pyx":466 * np.ndarray[double, ndim=1] feedback, * np.ndarray[long, ndim=1] split_by, * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): */ - values[14] = ((PyObject *)((PyObject *)Py_None)); + values[14] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -15850,153 +17307,195 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 1); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 1); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 2); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 2); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 3); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 3); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 4); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 4); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 5); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 5); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 6); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 6); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 7); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 7); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 8); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 8); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 9); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 9); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: - if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[10]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 10); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 10); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: - if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[11]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 11); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 11); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: - if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[12]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 12); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 12); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: - if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[13]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 13); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 13); __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi); - if (value) { values[14] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[15] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[16] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (value) { values[16] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 17: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[17] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (value) { values[17] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 18: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[18] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (value) { values[18] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 19: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[19] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (value) { values[19] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 20: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[20] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) + if (value) { values[20] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_rlddm") < 0)) __PYX_ERR(0, 440, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_rlddm") < 0)) __PYX_ERR(0, 462, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -16036,7 +17535,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_response = ((PyArrayObject *)values[1]); __pyx_v_feedback = ((PyArrayObject *)values[2]); __pyx_v_split_by = ((PyArrayObject *)values[3]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) + __pyx_v_q = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) __pyx_v_v = values[5]; __pyx_v_sv = values[6]; __pyx_v_a = values[7]; @@ -16045,54 +17544,61 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_t = values[10]; __pyx_v_st = values[11]; __pyx_v_alpha = values[12]; - __pyx_v_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) __pyx_v_multi = values[14]; if (values[15]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + __pyx_v_n_st = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) } else { __pyx_v_n_st = ((int)((int)10)); } if (values[16]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) } else { __pyx_v_n_sz = ((int)((int)10)); } if (values[17]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) } else { __pyx_v_use_adaptive = ((int)((int)1)); } if (values[18]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[18]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[18]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) } else { __pyx_v_simps_err = ((double)((double)1e-3)); } if (values[19]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[19]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[19]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[20]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[20]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[20]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, __pyx_nargs); __PYX_ERR(0, 440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, __pyx_nargs); __PYX_ERR(0, 462, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_multi_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 440, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 441, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 442, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 443, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_16wiener_like_multi_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_alpha, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 462, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 463, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 464, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_18wiener_like_multi_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_alpha, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - /* "wfpt.pyx":440 + /* "wfpt.pyx":462 * * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< @@ -16105,11 +17611,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, PyObject *__pyx_v_alpha, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { +static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, PyObject *__pyx_v_alpha, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { Py_ssize_t __pyx_v_size; double __pyx_v_p; double __pyx_v_sum_logp; @@ -16161,9 +17673,9 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__13) + __Pyx_TraceFrameInit(__pyx_codeobj__14) __Pyx_RefNannySetupContext("wiener_like_multi_rlddm", 0); - __Pyx_TraceCall("wiener_like_multi_rlddm", __pyx_f[0], 440, 0, __PYX_ERR(0, 440, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_multi_rlddm", __pyx_f[0], 462, 0, __PYX_ERR(0, 462, __pyx_L1_error)); __pyx_pybuffer_qs.pybuffer.buf = NULL; __pyx_pybuffer_qs.refcount = 0; __pyx_pybuffernd_qs.data = NULL; @@ -16186,94 +17698,95 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) } __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) } __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) } __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; - /* "wfpt.pyx":447 + /* "wfpt.pyx":469 * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t ij * cdef Py_ssize_t s_size */ - __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_TraceLine(469,0,__PYX_ERR(0, 469, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); - /* "wfpt.pyx":450 + /* "wfpt.pyx":472 * cdef Py_ssize_t ij * cdef Py_ssize_t s_size * cdef double p = 0 # <<<<<<<<<<<<<< * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier */ - __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error)) + __Pyx_TraceLine(472,0,__PYX_ERR(0, 472, __pyx_L1_error)) __pyx_v_p = 0.0; - /* "wfpt.pyx":451 + /* "wfpt.pyx":473 * cdef Py_ssize_t s_size * cdef double p = 0 * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier * cdef int s */ - __Pyx_TraceLine(451,0,__PYX_ERR(0, 451, __pyx_L1_error)) + __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; - /* "wfpt.pyx":452 + /* "wfpt.pyx":474 * cdef double p = 0 * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< * cdef int s * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) */ - __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error)) + __Pyx_TraceLine(474,0,__PYX_ERR(0, 474, __pyx_L1_error)) __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - /* "wfpt.pyx":454 + /* "wfpt.pyx":476 * cdef double wp_outlier = w_outlier * p_outlier * cdef int s * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< * * if multi is None: */ - __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -16283,22 +17796,23 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 454, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 476, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 454, __pyx_L1_error) + __PYX_ERR(0, 476, __pyx_L1_error) } else {__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]; } } @@ -16306,42 +17820,42 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":456 + /* "wfpt.pyx":478 * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) * * if multi is None: # <<<<<<<<<<<<<< * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: */ - __Pyx_TraceLine(456,0,__PYX_ERR(0, 456, __pyx_L1_error)) + __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error)) __pyx_t_9 = (__pyx_v_multi == Py_None); if (__pyx_t_9) { - /* "wfpt.pyx":457 + /* "wfpt.pyx":479 * * if multi is None: * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< * else: * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} */ - __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error)) + __Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_10 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_18 = __pyx_f_4wfpt_full_pdf(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_18 = __pyx_f_4wfpt_full_pdf(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":456 + /* "wfpt.pyx":478 * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) * * if multi is None: # <<<<<<<<<<<<<< @@ -16350,41 +17864,42 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject */ } - /* "wfpt.pyx":459 + /* "wfpt.pyx":481 * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} # <<<<<<<<<<<<<< * params_iter = copy(params) * qs[0] = q */ - __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error)) + __Pyx_TraceLine(481,0,__PYX_ERR(0, 481, __pyx_L1_error)) /*else*/ { - __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 459, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 459, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 459, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 459, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 459, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 459, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 459, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_alpha, __pyx_v_alpha) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_alpha, __pyx_v_alpha) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __pyx_v_params = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":460 + /* "wfpt.pyx":482 * else: * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} * params_iter = copy(params) # <<<<<<<<<<<<<< * qs[0] = q * qs[1] = q */ - __Pyx_TraceLine(460,0,__PYX_ERR(0, 460, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_TraceLine(482,0,__PYX_ERR(0, 482, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -16394,59 +17909,60 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_params}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_params_iter = __pyx_t_2; __pyx_t_2 = 0; - /* "wfpt.pyx":461 + /* "wfpt.pyx":483 * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} * params_iter = copy(params) * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q * for i in range(size): */ - __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error)) + __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error)) __pyx_t_19 = 0; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":462 + /* "wfpt.pyx":484 * params_iter = copy(params) * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< * for i in range(size): * for param in multi: */ - __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error)) + __Pyx_TraceLine(484,0,__PYX_ERR(0, 484, __pyx_L1_error)) __pyx_t_19 = 1; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":463 + /* "wfpt.pyx":485 * qs[0] = q * qs[1] = q * for i in range(size): # <<<<<<<<<<<<<< * for param in multi: * params_iter[param] = params[param][i] */ - __Pyx_TraceLine(463,0,__PYX_ERR(0, 463, __pyx_L1_error)) - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_TraceLine(485,0,__PYX_ERR(0, 485, __pyx_L1_error)) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_20 = 0; __pyx_t_21 = NULL; } else { - __pyx_t_20 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_20 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_21 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 485, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -16454,17 +17970,17 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_20 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_20); __Pyx_INCREF(__pyx_t_4); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_20); __Pyx_INCREF(__pyx_t_4); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 485, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_20 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_20); __Pyx_INCREF(__pyx_t_4); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_20); __Pyx_INCREF(__pyx_t_4); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 485, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -16474,7 +17990,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 463, __pyx_L1_error) + else __PYX_ERR(0, 485, __pyx_L1_error) } break; } @@ -16483,38 +17999,38 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":464 + /* "wfpt.pyx":486 * qs[1] = q * for i in range(size): * for param in multi: # <<<<<<<<<<<<<< * params_iter[param] = params[param][i] * */ - __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error)) + __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error)) if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { __pyx_t_4 = __pyx_v_multi; __Pyx_INCREF(__pyx_t_4); __pyx_t_22 = 0; __pyx_t_23 = NULL; } else { - __pyx_t_22 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_22 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_23 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 486, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_23)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_22); __Pyx_INCREF(__pyx_t_6); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_22); __Pyx_INCREF(__pyx_t_6); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_22); __Pyx_INCREF(__pyx_t_6); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_22); __Pyx_INCREF(__pyx_t_6); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -16524,7 +18040,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 464, __pyx_L1_error) + else __PYX_ERR(0, 486, __pyx_L1_error) } break; } @@ -16533,89 +18049,89 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_6); __pyx_t_6 = 0; - /* "wfpt.pyx":465 + /* "wfpt.pyx":487 * for i in range(size): * for param in multi: * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< * * if (i != 0): */ - __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error)) - __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_TraceLine(487,0,__PYX_ERR(0, 487, __pyx_L1_error)) + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_5) < 0))) __PYX_ERR(0, 465, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_5) < 0))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "wfpt.pyx":464 + /* "wfpt.pyx":486 * qs[1] = q * for i in range(size): * for param in multi: # <<<<<<<<<<<<<< * params_iter[param] = params[param][i] * */ - __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error)) + __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error)) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":467 + /* "wfpt.pyx":489 * params_iter[param] = params[param][i] * * if (i != 0): # <<<<<<<<<<<<<< * if (split_by[i] != split_by[i-1]): * qs[0] = q */ - __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error)) - __pyx_t_9 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_i, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_TraceLine(489,0,__PYX_ERR(0, 489, __pyx_L1_error)) + __pyx_t_9 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_i, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 489, __pyx_L1_error) if (__pyx_t_9) { - /* "wfpt.pyx":468 + /* "wfpt.pyx":490 * * if (i != 0): * if (split_by[i] != split_by[i-1]): # <<<<<<<<<<<<<< * qs[0] = q * qs[1] = q */ - __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_split_by), __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_TraceLine(490,0,__PYX_ERR(0, 490, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_split_by), __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_split_by), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_split_by), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { - /* "wfpt.pyx":469 + /* "wfpt.pyx":491 * if (i != 0): * if (split_by[i] != split_by[i-1]): * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q * */ - __Pyx_TraceLine(469,0,__PYX_ERR(0, 469, __pyx_L1_error)) + __Pyx_TraceLine(491,0,__PYX_ERR(0, 491, __pyx_L1_error)) __pyx_t_19 = 0; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":470 + /* "wfpt.pyx":492 * if (split_by[i] != split_by[i-1]): * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< * * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), */ - __Pyx_TraceLine(470,0,__PYX_ERR(0, 470, __pyx_L1_error)) + __Pyx_TraceLine(492,0,__PYX_ERR(0, 492, __pyx_L1_error)) __pyx_t_19 = 1; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":468 + /* "wfpt.pyx":490 * * if (i != 0): * if (split_by[i] != split_by[i-1]): # <<<<<<<<<<<<<< @@ -16624,7 +18140,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject */ } - /* "wfpt.pyx":467 + /* "wfpt.pyx":489 * params_iter[param] = params[param][i] * * if (i != 0): # <<<<<<<<<<<<<< @@ -16633,211 +18149,211 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject */ } - /* "wfpt.pyx":472 + /* "wfpt.pyx":494 * qs[1] = q * * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), # <<<<<<<<<<<<<< * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter[ */ - __Pyx_TraceLine(472,0,__PYX_ERR(0, 472, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_19 = 1; __pyx_t_24 = 0; - __pyx_t_6 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":473 + /* "wfpt.pyx":495 * * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< * params_iter['sz'], params_iter[ * 't'], params_iter['st'], */ - __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) + __Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":474 + /* "wfpt.pyx":496 * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter[ # <<<<<<<<<<<<<< * 't'], params_iter['st'], * err, n_st, n_sz, use_adaptive, simps_err) */ - __Pyx_TraceLine(474,0,__PYX_ERR(0, 474, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":475 + /* "wfpt.pyx":497 * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter[ * 't'], params_iter['st'], # <<<<<<<<<<<<<< * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier */ - __Pyx_TraceLine(475,0,__PYX_ERR(0, 475, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_TraceLine(497,0,__PYX_ERR(0, 497, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":472 + /* "wfpt.pyx":494 * qs[1] = q * * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), # <<<<<<<<<<<<<< * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter[ */ - __Pyx_TraceLine(472,0,__PYX_ERR(0, 472, __pyx_L1_error)) + __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error)) __pyx_t_25.__pyx_n = 4; __pyx_t_25.n_st = __pyx_v_n_st; __pyx_t_25.n_sz = __pyx_v_n_sz; __pyx_t_25.use_adaptive = __pyx_v_use_adaptive; __pyx_t_25.simps_err = __pyx_v_simps_err; - __pyx_t_10 = __pyx_f_4wfpt_full_pdf(__pyx_t_18, __pyx_t_17, __pyx_t_16, __pyx_t_15, __pyx_t_14, __pyx_t_13, __pyx_t_12, __pyx_t_11, __pyx_v_err, 0, &__pyx_t_25); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_10 = __pyx_f_4wfpt_full_pdf(__pyx_t_18, __pyx_t_17, __pyx_t_16, __pyx_t_15, __pyx_t_14, __pyx_t_13, __pyx_t_12, __pyx_t_11, __pyx_v_err, 0, &__pyx_t_25); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error) __pyx_v_p = __pyx_t_10; - /* "wfpt.pyx":477 + /* "wfpt.pyx":499 * 't'], params_iter['st'], * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< * sum_logp += log(p) * */ - __Pyx_TraceLine(477,0,__PYX_ERR(0, 477, __pyx_L1_error)) + __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error)) __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - /* "wfpt.pyx":478 + /* "wfpt.pyx":500 * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier * sum_logp += log(p) # <<<<<<<<<<<<<< * * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) */ - __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error)) + __Pyx_TraceLine(500,0,__PYX_ERR(0, 500, __pyx_L1_error)) __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - /* "wfpt.pyx":480 + /* "wfpt.pyx":502 * sum_logp += log(p) * * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) # <<<<<<<<<<<<<< * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) * */ - __Pyx_TraceLine(480,0,__PYX_ERR(0, 480, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_TraceLine(502,0,__PYX_ERR(0, 502, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Power(__pyx_float_2_718281828459, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_6 = PyNumber_Power(__pyx_float_2_718281828459, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Power(__pyx_float_2_718281828459, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_5 = PyNumber_Power(__pyx_float_2_718281828459, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_5, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_5, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_alfa, __pyx_t_5); __pyx_t_5 = 0; - /* "wfpt.pyx":481 + /* "wfpt.pyx":503 * * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) # <<<<<<<<<<<<<< * * return sum_logp */ - __Pyx_TraceLine(481,0,__PYX_ERR(0, 481, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_TraceLine(503,0,__PYX_ERR(0, 503, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qs), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qs), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qs), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qs), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_v_alfa, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_alfa, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qs), __pyx_t_3, __pyx_t_6) < 0))) __PYX_ERR(0, 481, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qs), __pyx_t_3, __pyx_t_6) < 0))) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "wfpt.pyx":463 + /* "wfpt.pyx":485 * qs[0] = q * qs[1] = q * for i in range(size): # <<<<<<<<<<<<<< * for param in multi: * params_iter[param] = params[param][i] */ - __Pyx_TraceLine(463,0,__PYX_ERR(0, 463, __pyx_L1_error)) + __Pyx_TraceLine(485,0,__PYX_ERR(0, 485, __pyx_L1_error)) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":483 + /* "wfpt.pyx":505 * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) * * return sum_logp # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error)) + __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "wfpt.pyx":440 + /* "wfpt.pyx":462 * * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< @@ -16884,7 +18400,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject return __pyx_r; } -/* "wfpt.pyx":486 +/* "wfpt.pyx":508 * * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< @@ -16893,16 +18409,16 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi_rlddm(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_19wiener_like_rlssm_nn_reg(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_18wiener_like_rlssm_nn_reg, "wiener_like_rlssm_nn_reg(ndarray data, ndarray rl_arr, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); -static PyMethodDef __pyx_mdef_4wfpt_19wiener_like_rlssm_nn_reg = {"wiener_like_rlssm_nn_reg", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_19wiener_like_rlssm_nn_reg, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_18wiener_like_rlssm_nn_reg}; -static PyObject *__pyx_pw_4wfpt_19wiener_like_rlssm_nn_reg(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_20wiener_like_rlssm_nn_reg, "wiener_like_rlssm_nn_reg(ndarray data, ndarray rl_arr, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); +static PyMethodDef __pyx_mdef_4wfpt_21wiener_like_rlssm_nn_reg = {"wiener_like_rlssm_nn_reg", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_20wiener_like_rlssm_nn_reg}; +static PyObject *__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16921,27 +18437,36 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_w_outlier; PyObject *__pyx_v_network = 0; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_rlssm_nn_reg (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 508, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_rl_arr,&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_params_bnds,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; - PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0}; - /* "wfpt.pyx":494 + /* "wfpt.pyx":516 * double q, * np.ndarray[double, ndim=2] params_bnds, * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< * cdef double rl_alpha * cdef Py_ssize_t size = x.shape[0] */ - values[10] = ((PyObject *)((PyObject *)Py_None)); + values[10] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -16973,83 +18498,107 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rl_arr)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rl_arr)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 1); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 1); __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 2); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 2); __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 3); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 3); __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 4); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 4); __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 5); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 5); __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 6); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 6); __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_bnds)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_bnds)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 7); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 7); __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[8] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[9] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); - if (value) { values[10] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlssm_nn_reg") < 0)) __PYX_ERR(0, 486, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlssm_nn_reg") < 0)) __PYX_ERR(0, 508, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -17077,15 +18626,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_response = ((PyArrayObject *)values[3]); __pyx_v_feedback = ((PyArrayObject *)values[4]); __pyx_v_split_by = ((PyArrayObject *)values[5]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error) + __pyx_v_q = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L3_error) __pyx_v_params_bnds = ((PyArrayObject *)values[7]); if (values[8]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[9]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } @@ -17093,22 +18642,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, __pyx_nargs); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, __pyx_nargs); __PYX_ERR(0, 508, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn_reg", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 486, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rl_arr), __pyx_ptype_5numpy_ndarray, 1, "rl_arr", 0))) __PYX_ERR(0, 487, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 488, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 489, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 490, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 491, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_bnds), __pyx_ptype_5numpy_ndarray, 1, "params_bnds", 0))) __PYX_ERR(0, 493, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(__pyx_self, __pyx_v_data, __pyx_v_rl_arr, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 508, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rl_arr), __pyx_ptype_5numpy_ndarray, 1, "rl_arr", 0))) __PYX_ERR(0, 509, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 510, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 511, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 513, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_bnds), __pyx_ptype_5numpy_ndarray, 1, "params_bnds", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(__pyx_self, __pyx_v_data, __pyx_v_rl_arr, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); - /* "wfpt.pyx":486 + /* "wfpt.pyx":508 * * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< @@ -17121,11 +18677,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_rl_arr, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { +static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_rl_arr, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { double __pyx_v_rl_alpha; CYTHON_UNUSED Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_v_i; @@ -17222,9 +18784,9 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__14) + __Pyx_TraceFrameInit(__pyx_codeobj__15) __Pyx_RefNannySetupContext("wiener_like_rlssm_nn_reg", 0); - __Pyx_TraceCall("wiener_like_rlssm_nn_reg", __pyx_f[0], 486, 0, __PYX_ERR(0, 486, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_rlssm_nn_reg", __pyx_f[0], 508, 0, __PYX_ERR(0, 508, __pyx_L1_error)); __pyx_pybuffer_qs.pybuffer.buf = NULL; __pyx_pybuffer_qs.refcount = 0; __pyx_pybuffernd_qs.data = NULL; @@ -17283,109 +18845,110 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_pybuffernd_params_bnds.rcbuffer = &__pyx_pybuffer_params_bnds; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) } __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rl_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rl_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rl_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rl_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) } __pyx_pybuffernd_rl_arr.diminfo[0].strides = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rl_arr.diminfo[0].shape = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rl_arr.diminfo[1].strides = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rl_arr.diminfo[1].shape = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) } __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) } __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) } __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_bnds, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_bnds, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) } __pyx_pybuffernd_params_bnds.diminfo[0].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_bnds.diminfo[0].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_params_bnds.diminfo[1].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_params_bnds.diminfo[1].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[1]; - /* "wfpt.pyx":496 + /* "wfpt.pyx":518 * double p_outlier=0, double w_outlier=0, network = None): * cdef double rl_alpha * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i, j, i_p * cdef Py_ssize_t s_size */ - __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_TraceLine(518,0,__PYX_ERR(0, 518, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); - /* "wfpt.pyx":500 + /* "wfpt.pyx":522 * cdef Py_ssize_t s_size * cdef int s * cdef double log_p = 0 # <<<<<<<<<<<<<< * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier */ - __Pyx_TraceLine(500,0,__PYX_ERR(0, 500, __pyx_L1_error)) + __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error)) __pyx_v_log_p = 0.0; - /* "wfpt.pyx":501 + /* "wfpt.pyx":523 * cdef int s * cdef double log_p = 0 * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier * cdef double alfa */ - __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error)) + __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; - /* "wfpt.pyx":502 + /* "wfpt.pyx":524 * cdef double log_p = 0 * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< * cdef double alfa * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) */ - __Pyx_TraceLine(502,0,__PYX_ERR(0, 502, __pyx_L1_error)) + __Pyx_TraceLine(524,0,__PYX_ERR(0, 524, __pyx_L1_error)) __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - /* "wfpt.pyx":504 + /* "wfpt.pyx":526 * cdef double wp_outlier = w_outlier * p_outlier * cdef double alfa * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim=1] xs * cdef np.ndarray[double, ndim=1] feedbacks */ - __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_TraceLine(526,0,__PYX_ERR(0, 526, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -17395,22 +18958,23 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 504, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 526, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 504, __pyx_L1_error) + __PYX_ERR(0, 526, __pyx_L1_error) } else {__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]; } } @@ -17418,22 +18982,23 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":509 + /* "wfpt.pyx":531 * cdef np.ndarray[long, ndim=1] responses * cdef np.ndarray[long, ndim=1] responses_qs * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< * cdef np.ndarray[float, ndim=2] data_copy = data * cdef float ll_min = -16.11809 */ - __Pyx_TraceLine(509,0,__PYX_ERR(0, 509, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -17443,21 +19008,22 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 509, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 531, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 509, __pyx_L1_error) + __PYX_ERR(0, 531, __pyx_L1_error) } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; } } @@ -17465,79 +19031,79 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":510 + /* "wfpt.pyx":532 * cdef np.ndarray[long, ndim=1] responses_qs * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) * cdef np.ndarray[float, ndim=2] data_copy = data # <<<<<<<<<<<<<< * cdef float ll_min = -16.11809 * cdef int cumm_s_size = 0 */ - __Pyx_TraceLine(510,0,__PYX_ERR(0, 510, __pyx_L1_error)) + __Pyx_TraceLine(532,0,__PYX_ERR(0, 532, __pyx_L1_error)) { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data_copy.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_data), &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_data_copy = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 510, __pyx_L1_error) + __PYX_ERR(0, 532, __pyx_L1_error) } else {__pyx_pybuffernd_data_copy.diminfo[0].strides = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data_copy.diminfo[0].shape = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data_copy.diminfo[1].strides = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data_copy.diminfo[1].shape = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.shape[1]; } } __Pyx_INCREF((PyObject *)__pyx_v_data); __pyx_v_data_copy = ((PyArrayObject *)__pyx_v_data); - /* "wfpt.pyx":511 + /* "wfpt.pyx":533 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) * cdef np.ndarray[float, ndim=2] data_copy = data * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< * cdef int cumm_s_size = 0 * */ - __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error)) + __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error)) __pyx_v_ll_min = -16.11809; - /* "wfpt.pyx":512 + /* "wfpt.pyx":534 * cdef np.ndarray[float, ndim=2] data_copy = data * cdef float ll_min = -16.11809 * cdef int cumm_s_size = 0 # <<<<<<<<<<<<<< * * if not p_outlier_in_range(p_outlier): */ - __Pyx_TraceLine(512,0,__PYX_ERR(0, 512, __pyx_L1_error)) + __Pyx_TraceLine(534,0,__PYX_ERR(0, 534, __pyx_L1_error)) __pyx_v_cumm_s_size = 0; - /* "wfpt.pyx":514 + /* "wfpt.pyx":536 * cdef int cumm_s_size = 0 * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error)) - __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_TraceLine(536,0,__PYX_ERR(0, 536, __pyx_L1_error)) + __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_10); if (__pyx_t_11) { - /* "wfpt.pyx":515 + /* "wfpt.pyx":537 * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< * * # Check for boundary violations -- if true, return -np.inf */ - __Pyx_TraceLine(515,0,__PYX_ERR(0, 515, __pyx_L1_error)) + __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":514 + /* "wfpt.pyx":536 * cdef int cumm_s_size = 0 * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< @@ -17546,25 +19112,26 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec */ } - /* "wfpt.pyx":518 + /* "wfpt.pyx":540 * * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, data.shape[1]-2): # <<<<<<<<<<<<<< * lower_bnd = params_bnds[0][i_p] * upper_bnd = params_bnds[1][i_p] */ - __Pyx_TraceLine(518,0,__PYX_ERR(0, 518, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_data)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(((__pyx_t_1[1]) - 2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_data)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(((__pyx_t_1[1]) - 2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -17574,12 +19141,13 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_int_1, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -17587,9 +19155,9 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 540, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -17597,17 +19165,17 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 540, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 540, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -17617,75 +19185,76 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 518, __pyx_L1_error) + else __PYX_ERR(0, 540, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_i_p = __pyx_t_14; - /* "wfpt.pyx":519 + /* "wfpt.pyx":541 * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, data.shape[1]-2): * lower_bnd = params_bnds[0][i_p] # <<<<<<<<<<<<<< * upper_bnd = params_bnds[1][i_p] * */ - __Pyx_TraceLine(519,0,__PYX_ERR(0, 519, __pyx_L1_error)) - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error)) + __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_lower_bnd, __pyx_t_6); __pyx_t_6 = 0; - /* "wfpt.pyx":520 + /* "wfpt.pyx":542 * for i_p in np.arange(1, data.shape[1]-2): * lower_bnd = params_bnds[0][i_p] * upper_bnd = params_bnds[1][i_p] # <<<<<<<<<<<<<< * * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: */ - __Pyx_TraceLine(520,0,__PYX_ERR(0, 520, __pyx_L1_error)) - __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error)) + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_upper_bnd, __pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":522 + /* "wfpt.pyx":544 * upper_bnd = params_bnds[1][i_p] * * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error)) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_TraceLine(544,0,__PYX_ERR(0, 544, __pyx_L1_error)) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_slice__7); - __Pyx_GIVEREF(__pyx_slice__7); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__7); + __Pyx_INCREF(__pyx_slice__8); + __Pyx_GIVEREF(__pyx_slice__8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__8)) __PYX_ERR(0, 544, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); @@ -17695,42 +19264,44 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[1] = {__pyx_t_6, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lower_bnd, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lower_bnd, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_10) { } else { __pyx_t_11 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__7); - __Pyx_GIVEREF(__pyx_slice__7); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__7); + __Pyx_INCREF(__pyx_slice__8); + __Pyx_GIVEREF(__pyx_slice__8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__8)) __PYX_ERR(0, 544, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -17740,37 +19311,38 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[1] = {__pyx_t_2, }; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_upper_bnd, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_upper_bnd, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = __pyx_t_10; __pyx_L7_bool_binop_done:; if (__pyx_t_11) { - /* "wfpt.pyx":523 + /* "wfpt.pyx":545 * * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: * return -np.inf # <<<<<<<<<<<<<< * * # unique represent # of conditions */ - __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error)) + __Pyx_TraceLine(545,0,__PYX_ERR(0, 545, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_6 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; @@ -17778,7 +19350,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "wfpt.pyx":522 + /* "wfpt.pyx":544 * upper_bnd = params_bnds[1][i_p] * * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: # <<<<<<<<<<<<<< @@ -17787,58 +19359,58 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec */ } - /* "wfpt.pyx":518 + /* "wfpt.pyx":540 * * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, data.shape[1]-2): # <<<<<<<<<<<<<< * lower_bnd = params_bnds[0][i_p] * upper_bnd = params_bnds[1][i_p] */ - __Pyx_TraceLine(518,0,__PYX_ERR(0, 518, __pyx_L1_error)) + __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error)) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":526 + /* "wfpt.pyx":548 * * # unique represent # of conditions * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< * s = unique[j] * # select trials for current condition, identified by the split_by-array */ - __Pyx_TraceLine(526,0,__PYX_ERR(0, 526, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L1_error) __pyx_t_15 = (__pyx_t_1[0]); __pyx_t_16 = __pyx_t_15; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_16; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "wfpt.pyx":527 + /* "wfpt.pyx":549 * # unique represent # of conditions * for j in range(unique.shape[0]): * s = unique[j] # <<<<<<<<<<<<<< * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] */ - __Pyx_TraceLine(527,0,__PYX_ERR(0, 527, __pyx_L1_error)) + __Pyx_TraceLine(549,0,__PYX_ERR(0, 549, __pyx_L1_error)) __pyx_t_17 = __pyx_v_j; __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_unique.diminfo[0].strides)); - /* "wfpt.pyx":529 + /* "wfpt.pyx":551 * s = unique[j] * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< * responses = response[split_by == s] * xs = x[split_by == s] */ - __Pyx_TraceLine(529,0,__PYX_ERR(0, 529, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 529, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 551, __pyx_L1_error) __pyx_t_18 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17855,28 +19427,28 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0; } __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 529, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) } __pyx_t_18 = 0; __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "wfpt.pyx":530 + /* "wfpt.pyx":552 * # select trials for current condition, identified by the split_by-array * feedbacks = feedback[split_by == s] * responses = response[split_by == s] # <<<<<<<<<<<<<< * xs = x[split_by == s] * s_size = xs.shape[0] */ - __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 530, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 552, __pyx_L1_error) __pyx_t_22 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17893,28 +19465,28 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0; } __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 530, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 552, __pyx_L1_error) } __pyx_t_22 = 0; __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "wfpt.pyx":531 + /* "wfpt.pyx":553 * feedbacks = feedback[split_by == s] * responses = response[split_by == s] * xs = x[split_by == s] # <<<<<<<<<<<<<< * s_size = xs.shape[0] * qs[0] = q */ - __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_TraceLine(553,0,__PYX_ERR(0, 553, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 531, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 553, __pyx_L1_error) __pyx_t_23 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17931,53 +19503,53 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0; } __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 553, __pyx_L1_error) } __pyx_t_23 = 0; __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "wfpt.pyx":532 + /* "wfpt.pyx":554 * responses = response[split_by == s] * xs = x[split_by == s] * s_size = xs.shape[0] # <<<<<<<<<<<<<< * qs[0] = q * qs[1] = q */ - __Pyx_TraceLine(532,0,__PYX_ERR(0, 532, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error) + __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L1_error) __pyx_v_s_size = (__pyx_t_1[0]); - /* "wfpt.pyx":533 + /* "wfpt.pyx":555 * xs = x[split_by == s] * s_size = xs.shape[0] * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q * */ - __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error)) + __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error)) __pyx_t_17 = 0; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":534 + /* "wfpt.pyx":556 * s_size = xs.shape[0] * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< * * responses_qs = responses */ - __Pyx_TraceLine(534,0,__PYX_ERR(0, 534, __pyx_L1_error)) + __Pyx_TraceLine(556,0,__PYX_ERR(0, 556, __pyx_L1_error)) __pyx_t_17 = 1; *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - /* "wfpt.pyx":536 + /* "wfpt.pyx":558 * qs[1] = q * * responses_qs = responses # <<<<<<<<<<<<<< * responses_qs[responses_qs == -1] = 0 * */ - __Pyx_TraceLine(536,0,__PYX_ERR(0, 536, __pyx_L1_error)) + __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error)) { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); @@ -17993,86 +19565,86 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0; } __pyx_pybuffernd_responses_qs.diminfo[0].strides = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses_qs.diminfo[0].shape = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 536, __pyx_L1_error) + if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) } __Pyx_INCREF((PyObject *)__pyx_v_responses); __Pyx_XDECREF_SET(__pyx_v_responses_qs, ((PyArrayObject *)__pyx_v_responses)); - /* "wfpt.pyx":537 + /* "wfpt.pyx":559 * * responses_qs = responses * responses_qs[responses_qs == -1] = 0 # <<<<<<<<<<<<<< * * # loop through all trials in current condition */ - __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error)) - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_responses_qs), __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_responses_qs), __pyx_t_4, __pyx_int_0) < 0))) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_TraceLine(559,0,__PYX_ERR(0, 559, __pyx_L1_error)) + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_responses_qs), __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_responses_qs), __pyx_t_4, __pyx_int_0) < 0))) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":540 + /* "wfpt.pyx":562 * * # loop through all trials in current condition * for i in range(0, s_size): # <<<<<<<<<<<<<< * tp_scale = data[cumm_s_size + i, 0] * if tp_scale < 0: */ - __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error)) + __Pyx_TraceLine(562,0,__PYX_ERR(0, 562, __pyx_L1_error)) __pyx_t_14 = __pyx_v_s_size; __pyx_t_24 = __pyx_t_14; for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { __pyx_v_i = __pyx_t_25; - /* "wfpt.pyx":541 + /* "wfpt.pyx":563 * # loop through all trials in current condition * for i in range(0, s_size): * tp_scale = data[cumm_s_size + i, 0] # <<<<<<<<<<<<<< * if tp_scale < 0: * return -np.inf */ - __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error)) + __Pyx_TraceLine(563,0,__PYX_ERR(0, 563, __pyx_L1_error)) __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); __pyx_t_26 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_tp_scale, __pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":542 + /* "wfpt.pyx":564 * for i in range(0, s_size): * tp_scale = data[cumm_s_size + i, 0] * if tp_scale < 0: # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error)) - __pyx_t_4 = PyObject_RichCompare(__pyx_v_tp_scale, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error)) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_tp_scale, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_11) { - /* "wfpt.pyx":543 + /* "wfpt.pyx":565 * tp_scale = data[cumm_s_size + i, 0] * if tp_scale < 0: * return -np.inf # <<<<<<<<<<<<<< * * data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale */ - __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error)) + __Pyx_TraceLine(565,0,__PYX_ERR(0, 565, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "wfpt.pyx":542 + /* "wfpt.pyx":564 * for i in range(0, s_size): * tp_scale = data[cumm_s_size + i, 0] * if tp_scale < 0: # <<<<<<<<<<<<<< @@ -18081,48 +19653,48 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec */ } - /* "wfpt.pyx":545 + /* "wfpt.pyx":567 * return -np.inf * * data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale # <<<<<<<<<<<<<< * * # Check for boundary violations -- if true, return -np.inf */ - __Pyx_TraceLine(545,0,__PYX_ERR(0, 545, __pyx_L1_error)) + __Pyx_TraceLine(567,0,__PYX_ERR(0, 567, __pyx_L1_error)) __pyx_t_26 = 1; __pyx_t_17 = 0; - __pyx_t_4 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_v_tp_scale); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_v_tp_scale); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_27 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_27 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_27 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_27 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); __pyx_t_26 = 0; *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[1].strides) = __pyx_t_27; - /* "wfpt.pyx":548 + /* "wfpt.pyx":570 * * # Check for boundary violations -- if true, return -np.inf * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< * return -np.inf * */ - __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error)) + __Pyx_TraceLine(570,0,__PYX_ERR(0, 570, __pyx_L1_error)) __pyx_t_26 = (__pyx_v_cumm_s_size + __pyx_v_i); __pyx_t_17 = 0; - __pyx_t_6 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[1].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[1].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_10) { } else { @@ -18131,44 +19703,44 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec } __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); __pyx_t_26 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __pyx_t_10; __pyx_L16_bool_binop_done:; if (__pyx_t_11) { - /* "wfpt.pyx":549 + /* "wfpt.pyx":571 * # Check for boundary violations -- if true, return -np.inf * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: * return -np.inf # <<<<<<<<<<<<<< * * rl_alpha = rl_arr[cumm_s_size + i, 0] */ - __Pyx_TraceLine(549,0,__PYX_ERR(0, 549, __pyx_L1_error)) + __Pyx_TraceLine(571,0,__PYX_ERR(0, 571, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_5 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "wfpt.pyx":548 + /* "wfpt.pyx":570 * * # Check for boundary violations -- if true, return -np.inf * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< @@ -18177,115 +19749,116 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec */ } - /* "wfpt.pyx":551 + /* "wfpt.pyx":573 * return -np.inf * * rl_alpha = rl_arr[cumm_s_size + i, 0] # <<<<<<<<<<<<<< * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) * */ - __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error)) + __Pyx_TraceLine(573,0,__PYX_ERR(0, 573, __pyx_L1_error)) __pyx_t_26 = (__pyx_v_cumm_s_size + __pyx_v_i); __pyx_t_17 = 0; __pyx_v_rl_alpha = (*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rl_arr.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_rl_arr.diminfo[1].strides)); - /* "wfpt.pyx":552 + /* "wfpt.pyx":574 * * rl_alpha = rl_arr[cumm_s_size + i, 0] * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< * * qs[responses_qs[i]] = qs[responses_qs[i]] + \ */ - __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error)) + __Pyx_TraceLine(574,0,__PYX_ERR(0, 574, __pyx_L1_error)) __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); - /* "wfpt.pyx":554 + /* "wfpt.pyx":576 * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) * * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size */ - __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error)) + __Pyx_TraceLine(576,0,__PYX_ERR(0, 576, __pyx_L1_error)) __pyx_t_17 = __pyx_v_i; __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - /* "wfpt.pyx":555 + /* "wfpt.pyx":577 * * qs[responses_qs[i]] = qs[responses_qs[i]] + \ * alfa * (feedbacks[i] - qs[responses_qs[i]]) # <<<<<<<<<<<<<< * cumm_s_size += s_size * */ - __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error)) + __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error)) __pyx_t_28 = __pyx_v_i; __pyx_t_29 = __pyx_v_i; __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - /* "wfpt.pyx":554 + /* "wfpt.pyx":576 * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) * * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size */ - __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error)) + __Pyx_TraceLine(576,0,__PYX_ERR(0, 576, __pyx_L1_error)) __pyx_t_31 = __pyx_v_i; __pyx_t_32 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides))))); } - /* "wfpt.pyx":556 + /* "wfpt.pyx":578 * qs[responses_qs[i]] = qs[responses_qs[i]] + \ * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size # <<<<<<<<<<<<<< * * # Call to network: */ - __Pyx_TraceLine(556,0,__PYX_ERR(0, 556, __pyx_L1_error)) + __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error)) __pyx_v_cumm_s_size = (__pyx_v_cumm_s_size + __pyx_v_s_size); } - /* "wfpt.pyx":559 + /* "wfpt.pyx":581 * * # Call to network: * if p_outlier == 0: # <<<<<<<<<<<<<< * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * else: */ - __Pyx_TraceLine(559,0,__PYX_ERR(0, 559, __pyx_L1_error)) + __Pyx_TraceLine(581,0,__PYX_ERR(0, 581, __pyx_L1_error)) __pyx_t_11 = (__pyx_v_p_outlier == 0.0); if (__pyx_t_11) { - /* "wfpt.pyx":560 + /* "wfpt.pyx":582 * # Call to network: * if p_outlier == 0: * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) # <<<<<<<<<<<<<< * else: * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) */ - __Pyx_TraceLine(560,0,__PYX_ERR(0, 560, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_umath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_umath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_maximum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_maximum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __pyx_t_34 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_33))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_33))) { __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_33); if (likely(__pyx_t_34)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); @@ -18295,19 +19868,21 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_34, ((PyObject *)__pyx_v_data_copy)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; } - __pyx_t_33 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_33 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __pyx_t_34 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_34)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); @@ -18317,19 +19892,21 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_34, __pyx_t_2, __pyx_t_33}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -18339,20 +19916,21 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_sum_logp = __pyx_t_35; - /* "wfpt.pyx":559 + /* "wfpt.pyx":581 * * # Call to network: * if p_outlier == 0: # <<<<<<<<<<<<<< @@ -18362,46 +19940,47 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec goto __pyx_L18; } - /* "wfpt.pyx":562 + /* "wfpt.pyx":584 * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * else: * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< * * return sum_logp */ - __Pyx_TraceLine(562,0,__PYX_ERR(0, 562, __pyx_L1_error)) + __Pyx_TraceLine(584,0,__PYX_ERR(0, 584, __pyx_L1_error)) /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_33); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_core); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_core); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_37); __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_umath); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_umath); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_maximum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_maximum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_37); __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_38); __pyx_t_39 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_38))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_38))) { __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_38); if (likely(__pyx_t_39)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); @@ -18411,19 +19990,21 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_39, ((PyObject *)__pyx_v_data_copy)}; __pyx_t_36 = __Pyx_PyObject_FastCall(__pyx_t_38, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; - if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; } - __pyx_t_38 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_38 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_38); __pyx_t_39 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_37))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_37))) { __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_37); if (likely(__pyx_t_39)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); @@ -18433,19 +20014,21 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_39, __pyx_t_36, __pyx_t_38}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_37, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; } __pyx_t_37 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_34))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_34))) { __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_34); if (likely(__pyx_t_37)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34); @@ -18455,30 +20038,32 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_37, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_34, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; } - __pyx_t_34 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_34 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_34); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_34); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __pyx_t_34 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_34 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_34); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_34); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; __pyx_t_34 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_33))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_33))) { __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_33); if (likely(__pyx_t_34)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); @@ -18488,18 +20073,20 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; } __pyx_t_33 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_33)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -18509,37 +20096,38 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_7 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_33, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_sum_logp = __pyx_t_35; } __pyx_L18:; - /* "wfpt.pyx":564 + /* "wfpt.pyx":586 * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) * * return sum_logp # <<<<<<<<<<<<<< * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, */ - __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error)) + __Pyx_TraceLine(586,0,__PYX_ERR(0, 586, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "wfpt.pyx":486 + /* "wfpt.pyx":508 * * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< @@ -18614,7 +20202,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "wfpt.pyx":566 +/* "wfpt.pyx":588 * return sum_logp * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< @@ -18623,16 +20211,16 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_21wiener_like_contaminant(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_23wiener_like_contaminant(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_20wiener_like_contaminant, "wiener_like_contaminant(ndarray x, ndarray cont_x, double v, double sv, double a, double z, double sz, double t, double st, double t_min, double t_max, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8)\nWiener likelihood function where RTs could come from a\n separate, uniform contaminant distribution.\n\n Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007)\n "); -static PyMethodDef __pyx_mdef_4wfpt_21wiener_like_contaminant = {"wiener_like_contaminant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_21wiener_like_contaminant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_20wiener_like_contaminant}; -static PyObject *__pyx_pw_4wfpt_21wiener_like_contaminant(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_22wiener_like_contaminant, "wiener_like_contaminant(ndarray x, ndarray cont_x, double v, double sv, double a, double z, double sz, double t, double st, double t_min, double t_max, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8)\nWiener likelihood function where RTs could come from a\n separate, uniform contaminant distribution.\n\n Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007)\n "); +static PyMethodDef __pyx_mdef_4wfpt_23wiener_like_contaminant = {"wiener_like_contaminant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_23wiener_like_contaminant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_22wiener_like_contaminant}; +static PyObject *__pyx_pw_4wfpt_23wiener_like_contaminant(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18656,18 +20244,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_v_use_adaptive; double __pyx_v_simps_err; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_contaminant (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 588, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_cont_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_t_min,&__pyx_n_s_t_max,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,0}; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -18709,118 +20306,154 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cont_x)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cont_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 1); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 1); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 2); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 2); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 3); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 3); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 4); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 4); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 5); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 5); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 6); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 6); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 7); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 7); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 8); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 8); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_min)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_min)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 9); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 9); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: - if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_max)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_max)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[10]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 10); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 10); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: - if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[11]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 11); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 11); __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[12] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[13] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[14] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[15] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_contaminant") < 0)) __PYX_ERR(0, 566, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_contaminant") < 0)) __PYX_ERR(0, 588, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -18850,59 +20483,72 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_x = ((PyArrayObject *)values[0]); __pyx_v_cont_x = ((PyArrayObject *)values[1]); - __pyx_v_v = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_t_min = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_t_min == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_t_max = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_t_max == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) - __pyx_v_err = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + __pyx_v_v = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + __pyx_v_t_min = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_t_min == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + __pyx_v_t_max = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_t_max == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) if (values[12]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + __pyx_v_n_st = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) } else { __pyx_v_n_st = ((int)((int)10)); } if (values[13]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) } else { __pyx_v_n_sz = ((int)((int)10)); } if (values[14]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) } else { __pyx_v_use_adaptive = ((int)((int)1)); } if (values[15]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L3_error) + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L3_error) } else { __pyx_v_simps_err = ((double)((double)1e-8)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, __pyx_nargs); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, __pyx_nargs); __PYX_ERR(0, 588, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_contaminant", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 566, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cont_x), __pyx_ptype_5numpy_ndarray, 1, "cont_x", 0))) __PYX_ERR(0, 566, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_20wiener_like_contaminant(__pyx_self, __pyx_v_x, __pyx_v_cont_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_t_min, __pyx_v_t_max, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 588, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cont_x), __pyx_ptype_5numpy_ndarray, 1, "cont_x", 0))) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_22wiener_like_contaminant(__pyx_self, __pyx_v_x, __pyx_v_cont_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_t_min, __pyx_v_t_max, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_cont_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_t_min, double __pyx_v_t_max, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err) { +static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_cont_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_t_min, double __pyx_v_t_max, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err) { CYTHON_UNUSED Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_v_i; double __pyx_v_p; @@ -18931,9 +20577,9 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__15) + __Pyx_TraceFrameInit(__pyx_codeobj__16) __Pyx_RefNannySetupContext("wiener_like_contaminant", 0); - __Pyx_TraceCall("wiener_like_contaminant", __pyx_f[0], 566, 0, __PYX_ERR(0, 566, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_contaminant", __pyx_f[0], 588, 0, __PYX_ERR(0, 588, __pyx_L1_error)); __pyx_pybuffer_x.pybuffer.buf = NULL; __pyx_pybuffer_x.refcount = 0; __pyx_pybuffernd_x.data = NULL; @@ -18944,52 +20590,53 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject __pyx_pybuffernd_cont_x.rcbuffer = &__pyx_pybuffer_cont_x; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cont_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_cont_x, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cont_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_cont_x, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) } __pyx_pybuffernd_cont_x.diminfo[0].strides = __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cont_x.diminfo[0].shape = __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.shape[0]; - /* "wfpt.pyx":575 + /* "wfpt.pyx":597 * Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007) * """ * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef double p */ - __Pyx_TraceLine(575,0,__PYX_ERR(0, 575, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_TraceLine(597,0,__PYX_ERR(0, 597, __pyx_L1_error)) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L1_error) __pyx_v_size = (__pyx_t_1[0]); - /* "wfpt.pyx":578 + /* "wfpt.pyx":600 * cdef Py_ssize_t i * cdef double p * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef int n_cont = np.sum(cont_x) * cdef int pos_cont = 0 */ - __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error)) + __Pyx_TraceLine(600,0,__PYX_ERR(0, 600, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; - /* "wfpt.pyx":579 + /* "wfpt.pyx":601 * cdef double p * cdef double sum_logp = 0 * cdef int n_cont = np.sum(cont_x) # <<<<<<<<<<<<<< * cdef int pos_cont = 0 * */ - __Pyx_TraceLine(579,0,__PYX_ERR(0, 579, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_TraceLine(601,0,__PYX_ERR(0, 601, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -18999,36 +20646,37 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject __pyx_t_5 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_cont_x)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_n_cont = __pyx_t_5; - /* "wfpt.pyx":580 + /* "wfpt.pyx":602 * cdef double sum_logp = 0 * cdef int n_cont = np.sum(cont_x) * cdef int pos_cont = 0 # <<<<<<<<<<<<<< * * for i in prange(size, nogil=True): */ - __Pyx_TraceLine(580,0,__PYX_ERR(0, 580, __pyx_L1_error)) + __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error)) __pyx_v_pos_cont = 0; - /* "wfpt.pyx":582 + /* "wfpt.pyx":604 * cdef int pos_cont = 0 * * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< * if cont_x[i] == 0: * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, */ - __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error)) + __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error)) { #ifdef WITH_THREAD PyThreadState *_save; @@ -19075,84 +20723,84 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject /* Initialize private variables to invalid values */ __pyx_v_p = ((double)__PYX_NAN()); - /* "wfpt.pyx":583 + /* "wfpt.pyx":605 * * for i in prange(size, nogil=True): * if cont_x[i] == 0: # <<<<<<<<<<<<<< * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, * n_st, n_sz, use_adaptive, simps_err) */ - __Pyx_TraceLine(583,1,__PYX_ERR(0, 583, __pyx_L8_error)) + __Pyx_TraceLine(605,1,__PYX_ERR(0, 605, __pyx_L8_error)) __pyx_t_9 = __pyx_v_i; __pyx_t_10 = ((*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_cont_x.diminfo[0].strides)) == 0); if (__pyx_t_10) { - /* "wfpt.pyx":584 + /* "wfpt.pyx":606 * for i in prange(size, nogil=True): * if cont_x[i] == 0: * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err) * if p == 0: */ - __Pyx_TraceLine(584,1,__PYX_ERR(0, 584, __pyx_L8_error)) + __Pyx_TraceLine(606,1,__PYX_ERR(0, 606, __pyx_L8_error)) __pyx_t_9 = __pyx_v_i; - /* "wfpt.pyx":585 + /* "wfpt.pyx":607 * if cont_x[i] == 0: * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< * if p == 0: * with gil: */ - __Pyx_TraceLine(585,1,__PYX_ERR(0, 585, __pyx_L8_error)) + __Pyx_TraceLine(607,1,__PYX_ERR(0, 607, __pyx_L8_error)) __pyx_t_12.__pyx_n = 4; __pyx_t_12.n_st = __pyx_v_n_st; __pyx_t_12.n_sz = __pyx_v_n_sz; __pyx_t_12.use_adaptive = __pyx_v_use_adaptive; __pyx_t_12.simps_err = __pyx_v_simps_err; - __pyx_t_11 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_12); if (unlikely(__pyx_t_11 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 584, __pyx_L8_error) + __pyx_t_11 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_12); if (unlikely(__pyx_t_11 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 606, __pyx_L8_error) __pyx_v_p = __pyx_t_11; - /* "wfpt.pyx":586 + /* "wfpt.pyx":608 * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, * n_st, n_sz, use_adaptive, simps_err) * if p == 0: # <<<<<<<<<<<<<< * with gil: * return -np.inf */ - __Pyx_TraceLine(586,1,__PYX_ERR(0, 586, __pyx_L8_error)) + __Pyx_TraceLine(608,1,__PYX_ERR(0, 608, __pyx_L8_error)) __pyx_t_10 = (__pyx_v_p == 0.0); if (__pyx_t_10) { - /* "wfpt.pyx":587 + /* "wfpt.pyx":609 * n_st, n_sz, use_adaptive, simps_err) * if p == 0: * with gil: # <<<<<<<<<<<<<< * return -np.inf * sum_logp += log(p) */ - __Pyx_TraceLine(587,1,__PYX_ERR(0, 587, __pyx_L8_error)) + __Pyx_TraceLine(609,1,__PYX_ERR(0, 609, __pyx_L8_error)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - /* "wfpt.pyx":588 + /* "wfpt.pyx":610 * if p == 0: * with gil: * return -np.inf # <<<<<<<<<<<<<< * sum_logp += log(p) * # If one probability = 0, the log sum will be -Inf */ - __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L15_error)) + __Pyx_TraceLine(610,0,__PYX_ERR(0, 610, __pyx_L15_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L15_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L15_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L15_error) + __pyx_t_2 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; @@ -19160,14 +20808,14 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject goto __pyx_L14_return; } - /* "wfpt.pyx":587 + /* "wfpt.pyx":609 * n_st, n_sz, use_adaptive, simps_err) * if p == 0: * with gil: # <<<<<<<<<<<<<< * return -np.inf * sum_logp += log(p) */ - __Pyx_TraceLine(587,0,__PYX_ERR(0, 587, __pyx_L15_error)) + __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L15_error)) /*finally:*/ { __pyx_L14_return: { #ifdef WITH_THREAD @@ -19184,7 +20832,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject } } - /* "wfpt.pyx":586 + /* "wfpt.pyx":608 * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, * n_st, n_sz, use_adaptive, simps_err) * if p == 0: # <<<<<<<<<<<<<< @@ -19193,17 +20841,17 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject */ } - /* "wfpt.pyx":589 + /* "wfpt.pyx":611 * with gil: * return -np.inf * sum_logp += log(p) # <<<<<<<<<<<<<< * # If one probability = 0, the log sum will be -Inf * */ - __Pyx_TraceLine(589,1,__PYX_ERR(0, 589, __pyx_L8_error)) + __Pyx_TraceLine(611,1,__PYX_ERR(0, 611, __pyx_L8_error)) __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - /* "wfpt.pyx":583 + /* "wfpt.pyx":605 * * for i in prange(size, nogil=True): * if cont_x[i] == 0: # <<<<<<<<<<<<<< @@ -19301,14 +20949,14 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject #endif } - /* "wfpt.pyx":582 + /* "wfpt.pyx":604 * cdef int pos_cont = 0 * * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< * if cont_x[i] == 0: * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, */ - __Pyx_TraceLine(582,1,__PYX_ERR(0, 582, __pyx_L4_error)) + __Pyx_TraceLine(604,1,__PYX_ERR(0, 604, __pyx_L4_error)) /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD @@ -19328,32 +20976,32 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject } } - /* "wfpt.pyx":593 + /* "wfpt.pyx":615 * * # add the log likelihood of the contaminations * sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) # <<<<<<<<<<<<<< * * return sum_logp */ - __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error)) + __Pyx_TraceLine(615,0,__PYX_ERR(0, 615, __pyx_L1_error)) __pyx_v_sum_logp = (__pyx_v_sum_logp + (__pyx_v_n_cont * log(((0.5 * 1.) / (__pyx_v_t_max - __pyx_v_t_min))))); - /* "wfpt.pyx":595 + /* "wfpt.pyx":617 * sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) * * return sum_logp # <<<<<<<<<<<<<< * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, */ - __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error)) + __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":566 + /* "wfpt.pyx":588 * return sum_logp * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< @@ -19386,7 +21034,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject return __pyx_r; } -/* "wfpt.pyx":597 +/* "wfpt.pyx":619 * return sum_logp * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< @@ -19395,16 +21043,16 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_contaminant(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_23gen_cdf_using_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_25gen_cdf_using_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_22gen_cdf_using_pdf, "gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, int N=500, double time=5., int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)\n\n generate cdf vector using the pdf\n "); -static PyMethodDef __pyx_mdef_4wfpt_23gen_cdf_using_pdf = {"gen_cdf_using_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_23gen_cdf_using_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_22gen_cdf_using_pdf}; -static PyObject *__pyx_pw_4wfpt_23gen_cdf_using_pdf(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_24gen_cdf_using_pdf, "gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, int N=500, double time=5., int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)\n\n generate cdf vector using the pdf\n "); +static PyMethodDef __pyx_mdef_4wfpt_25gen_cdf_using_pdf = {"gen_cdf_using_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_25gen_cdf_using_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_24gen_cdf_using_pdf}; +static PyObject *__pyx_pw_4wfpt_25gen_cdf_using_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19428,18 +21076,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_p_outlier; double __pyx_v_w_outlier; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gen_cdf_using_pdf (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 619, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_N,&__pyx_n_s_time,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -19481,118 +21138,142 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 1); __PYX_ERR(0, 597, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 1); __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 2); __PYX_ERR(0, 597, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 2); __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 3); __PYX_ERR(0, 597, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 3); __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 4); __PYX_ERR(0, 597, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 4); __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 5); __PYX_ERR(0, 597, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 5); __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 6); __PYX_ERR(0, 597, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 6); __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 7); __PYX_ERR(0, 597, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 7); __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_N); - if (value) { values[8] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time); - if (value) { values[9] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[10] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[11] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[12] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[13] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[14] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[15] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gen_cdf_using_pdf") < 0)) __PYX_ERR(0, 597, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gen_cdf_using_pdf") < 0)) __PYX_ERR(0, 619, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -19624,71 +21305,84 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } } - __pyx_v_v = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) - __pyx_v_err = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error) + __pyx_v_v = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) + __pyx_v_sv = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) + __pyx_v_a = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) + __pyx_v_z = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) + __pyx_v_sz = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) + __pyx_v_t = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) + __pyx_v_st = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) + __pyx_v_err = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) if (values[8]) { - __pyx_v_N = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + __pyx_v_N = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) } else { __pyx_v_N = ((int)((int)0x1F4)); } if (values[9]) { - __pyx_v_time = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + __pyx_v_time = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) } else { __pyx_v_time = ((double)((double)5.)); } if (values[10]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) } else { __pyx_v_n_st = ((int)((int)2)); } if (values[11]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) } else { __pyx_v_n_sz = ((int)((int)2)); } if (values[12]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) } else { __pyx_v_use_adaptive = ((int)((int)1)); } if (values[13]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L3_error) + __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) } else { __pyx_v_simps_err = ((double)((double)1e-3)); } if (values[14]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[15]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, __pyx_nargs); __PYX_ERR(0, 597, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, __pyx_nargs); __PYX_ERR(0, 619, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.gen_cdf_using_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4wfpt_22gen_cdf_using_pdf(__pyx_self, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_N, __pyx_v_time, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); + __pyx_r = __pyx_pf_4wfpt_24gen_cdf_using_pdf(__pyx_self, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_N, __pyx_v_time, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_N, double __pyx_v_time, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { +static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_N, double __pyx_v_time, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { PyArrayObject *__pyx_v_x = 0; PyArrayObject *__pyx_v_cdf_array = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_cdf_array; @@ -19729,9 +21423,9 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__16) + __Pyx_TraceFrameInit(__pyx_codeobj__17) __Pyx_RefNannySetupContext("gen_cdf_using_pdf", 0); - __Pyx_TraceCall("gen_cdf_using_pdf", __pyx_f[0], 597, 0, __PYX_ERR(0, 597, __pyx_L1_error)); + __Pyx_TraceCall("gen_cdf_using_pdf", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error)); __pyx_pybuffer_x.pybuffer.buf = NULL; __pyx_pybuffer_x.refcount = 0; __pyx_pybuffernd_x.data = NULL; @@ -19741,14 +21435,14 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_cdf_array.data = NULL; __pyx_pybuffernd_cdf_array.rcbuffer = &__pyx_pybuffer_cdf_array; - /* "wfpt.pyx":603 + /* "wfpt.pyx":625 * generate cdf vector using the pdf * """ * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError( */ - __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error)) + __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_sv < 0.0); if (!__pyx_t_2) { } else { @@ -19792,14 +21486,14 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py goto __pyx_L4_bool_binop_done; } - /* "wfpt.pyx":604 + /* "wfpt.pyx":626 * """ * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * raise ValueError( * "at least one of the parameters is out of the support") */ - __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error)) + __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_z - (__pyx_v_sz / 2.)) < 0.0); if (!__pyx_t_2) { } else { @@ -19824,36 +21518,36 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_2); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; - /* "wfpt.pyx":603 + /* "wfpt.pyx":625 * generate cdf vector using the pdf * """ * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError( */ - __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error)) + __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error)) if (unlikely(__pyx_t_1)) { - /* "wfpt.pyx":605 + /* "wfpt.pyx":627 * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError( # <<<<<<<<<<<<<< * "at least one of the parameters is out of the support") * */ - __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_TraceLine(627,0,__PYX_ERR(0, 627, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 605, __pyx_L1_error) + __PYX_ERR(0, 627, __pyx_L1_error) - /* "wfpt.pyx":603 + /* "wfpt.pyx":625 * generate cdf vector using the pdf * """ * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< @@ -19862,28 +21556,29 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py */ } - /* "wfpt.pyx":608 + /* "wfpt.pyx":630 * "at least one of the parameters is out of the support") * * cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) * cdef int idx */ - __Pyx_TraceLine(608,0,__PYX_ERR(0, 608, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_TraceLine(630,0,__PYX_ERR(0, 630, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyFloat_FromDouble((-__pyx_v_time)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble((-__pyx_v_time)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_From_long(((2 * __pyx_v_N) + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(((2 * __pyx_v_N) + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -19893,6 +21588,7 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_10 = 1; } } + #endif { PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_5, __pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); @@ -19900,17 +21596,17 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 608, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_x = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 608, __pyx_L1_error) + __PYX_ERR(0, 630, __pyx_L1_error) } else {__pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; } } @@ -19918,48 +21614,48 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_v_x = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":609 + /* "wfpt.pyx":631 * * cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) * cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) # <<<<<<<<<<<<<< * cdef int idx * */ - __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_12 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error) - __pyx_t_4 = PyInt_FromSsize_t((__pyx_t_12[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_12 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t((__pyx_t_12[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 609, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 609, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_cdf_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 609, __pyx_L1_error) + __PYX_ERR(0, 631, __pyx_L1_error) } else {__pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; } } @@ -19967,56 +21663,57 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_v_cdf_array = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "wfpt.pyx":613 + /* "wfpt.pyx":635 * * # compute pdf on the real line * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) * */ - __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pdf_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pdf_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_sv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_sv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_z); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_9 = PyFloat_FromDouble(__pyx_v_z); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = PyFloat_FromDouble(__pyx_v_sz); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_14 = PyFloat_FromDouble(__pyx_v_sz); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_15 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyFloat_FromDouble(__pyx_v_st); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_16 = PyFloat_FromDouble(__pyx_v_st); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = PyFloat_FromDouble(__pyx_v_err); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_17 = PyFloat_FromDouble(__pyx_v_err); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - /* "wfpt.pyx":614 + /* "wfpt.pyx":636 * # compute pdf on the real line * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) # <<<<<<<<<<<<<< * * # integrate */ - __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error)) - __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_n_st); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error)) + __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_n_st); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_n_sz); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_n_sz); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_20 = __Pyx_PyBool_FromLong(__pyx_v_use_adaptive); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyBool_FromLong(__pyx_v_use_adaptive); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_21 = PyFloat_FromDouble(__pyx_v_simps_err); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_21 = PyFloat_FromDouble(__pyx_v_simps_err); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); - __pyx_t_22 = PyFloat_FromDouble(__pyx_v_p_outlier); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_22 = PyFloat_FromDouble(__pyx_v_p_outlier); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); - __pyx_t_23 = PyFloat_FromDouble(__pyx_v_w_outlier); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_23 = PyFloat_FromDouble(__pyx_v_w_outlier); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_24 = NULL; __pyx_t_10 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_24)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -20026,6 +21723,7 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_10 = 1; } } + #endif { PyObject *__pyx_callargs[17] = {__pyx_t_24, ((PyObject *)__pyx_v_x), __pyx_t_8, __pyx_t_6, __pyx_t_7, __pyx_t_9, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_int_0, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 16+__pyx_t_10); @@ -20044,20 +21742,20 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "wfpt.pyx":613 + /* "wfpt.pyx":635 * * # compute pdf on the real line * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) * */ - __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error)) - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error)) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 635, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20074,28 +21772,29 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0; } __pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 613, __pyx_L1_error) + if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 635, __pyx_L1_error) } __pyx_t_13 = 0; __Pyx_DECREF_SET(__pyx_v_cdf_array, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* "wfpt.pyx":617 + /* "wfpt.pyx":639 * * # integrate * cdf_array[1:] = integrate.cumtrapz(cdf_array) # <<<<<<<<<<<<<< * * # normalize */ - __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_integrate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_integrate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cumtrapz); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 617, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cumtrapz); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_10 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_23))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_23); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23); @@ -20105,33 +21804,34 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_10 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_cdf_array)}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_23, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; } - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_cdf_array), __pyx_slice__10, __pyx_t_5) < 0))) __PYX_ERR(0, 617, __pyx_L1_error) + if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_cdf_array), __pyx_slice__11, __pyx_t_5) < 0))) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "wfpt.pyx":620 + /* "wfpt.pyx":642 * * # normalize * cdf_array /= cdf_array[x.shape[0] - 1] # <<<<<<<<<<<<<< * * return x, cdf_array */ - __Pyx_TraceLine(620,0,__PYX_ERR(0, 620, __pyx_L1_error)) - __pyx_t_12 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error)) + __pyx_t_12 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L1_error) __pyx_t_28 = ((__pyx_t_12[0]) - 1); - __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_cdf_array.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_cdf_array.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_23 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_cdf_array), __pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_cdf_array), __pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_23) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_23, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 620, __pyx_L1_error) + if (!(likely(((__pyx_t_23) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_23, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 642, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_23); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20148,34 +21848,34 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0; } __pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 620, __pyx_L1_error) + if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) } __pyx_t_13 = 0; __Pyx_DECREF_SET(__pyx_v_cdf_array, ((PyArrayObject *)__pyx_t_23)); __pyx_t_23 = 0; - /* "wfpt.pyx":622 + /* "wfpt.pyx":644 * cdf_array /= cdf_array[x.shape[0] - 1] * * return x, cdf_array # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error)) + __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_INCREF((PyObject *)__pyx_v_x); __Pyx_GIVEREF((PyObject *)__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)__pyx_v_x)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)__pyx_v_x))) __PYX_ERR(0, 644, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_cdf_array); __Pyx_GIVEREF((PyObject *)__pyx_v_cdf_array); - PyTuple_SET_ITEM(__pyx_t_23, 1, ((PyObject *)__pyx_v_cdf_array)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, ((PyObject *)__pyx_v_cdf_array))) __PYX_ERR(0, 644, __pyx_L1_error); __pyx_r = __pyx_t_23; __pyx_t_23 = 0; goto __pyx_L0; - /* "wfpt.pyx":597 + /* "wfpt.pyx":619 * return sum_logp * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< @@ -20224,7 +21924,7 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "wfpt.pyx":625 +/* "wfpt.pyx":647 * * * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< @@ -20233,16 +21933,16 @@ static PyObject *__pyx_pf_4wfpt_22gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_25split_cdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_27split_cdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_24split_cdf, "split_cdf(ndarray x, ndarray data)"); -static PyMethodDef __pyx_mdef_4wfpt_25split_cdf = {"split_cdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_25split_cdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_24split_cdf}; -static PyObject *__pyx_pw_4wfpt_25split_cdf(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_26split_cdf, "split_cdf(ndarray x, ndarray data)"); +static PyMethodDef __pyx_mdef_4wfpt_27split_cdf = {"split_cdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_27split_cdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_26split_cdf}; +static PyObject *__pyx_pw_4wfpt_27split_cdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20252,18 +21952,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyArrayObject *__pyx_v_x = 0; PyArrayObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("split_cdf (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 647, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_data,0}; - PyObject* values[2] = {0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -20277,20 +21986,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 647, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 647, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("split_cdf", 1, 2, 2, 1); __PYX_ERR(0, 625, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("split_cdf", 1, 2, 2, 1); __PYX_ERR(0, 647, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "split_cdf") < 0)) __PYX_ERR(0, 625, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "split_cdf") < 0)) __PYX_ERR(0, 647, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -20303,26 +22018,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("split_cdf", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 625, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("split_cdf", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 647, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.split_cdf", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 625, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 625, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_24split_cdf(__pyx_self, __pyx_v_x, __pyx_v_data); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_26split_cdf(__pyx_self, __pyx_v_x, __pyx_v_data); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_data) { +static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_data) { int __pyx_v_N; PyArrayObject *__pyx_v_x_lb = 0; PyArrayObject *__pyx_v_lb = 0; @@ -20364,9 +22092,9 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__18) + __Pyx_TraceFrameInit(__pyx_codeobj__19) __Pyx_RefNannySetupContext("split_cdf", 0); - __Pyx_TraceCall("split_cdf", __pyx_f[0], 625, 0, __PYX_ERR(0, 625, __pyx_L1_error)); + __Pyx_TraceCall("split_cdf", __pyx_f[0], 647, 0, __PYX_ERR(0, 647, __pyx_L1_error)); __pyx_pybuffer_x_lb.pybuffer.buf = NULL; __pyx_pybuffer_x_lb.refcount = 0; __pyx_pybuffernd_x_lb.data = NULL; @@ -20393,55 +22121,55 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 625, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 647, __pyx_L1_error) } __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 625, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 647, __pyx_L1_error) } __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; - /* "wfpt.pyx":628 + /* "wfpt.pyx":650 * * # get length of data * cdef int N = (len(data) - 1) / 2 # <<<<<<<<<<<<<< * * # lower bound is reversed */ - __Pyx_TraceLine(628,0,__PYX_ERR(0, 628, __pyx_L1_error)) - __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_TraceLine(650,0,__PYX_ERR(0, 650, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 650, __pyx_L1_error) __pyx_v_N = ((__pyx_t_1 - 1) / 2); - /* "wfpt.pyx":631 + /* "wfpt.pyx":653 * * # lower bound is reversed * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] * # lower bound is cumulative in the wrong direction */ - __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_TraceLine(653,0,__PYX_ERR(0, 653, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 653, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_lb.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_x_lb = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 631, __pyx_L1_error) + __PYX_ERR(0, 653, __pyx_L1_error) } else {__pyx_pybuffernd_x_lb.diminfo[0].strides = __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_lb.diminfo[0].shape = __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.shape[0]; } } @@ -20449,32 +22177,32 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_x_lb = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":632 + /* "wfpt.pyx":654 * # lower bound is reversed * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] # <<<<<<<<<<<<<< * # lower bound is cumulative in the wrong direction * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) */ - __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_TraceLine(654,0,__PYX_ERR(0, 654, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 632, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 654, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lb.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_lb = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_lb.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 654, __pyx_L1_error) } else {__pyx_pybuffernd_lb.diminfo[0].strides = __pyx_pybuffernd_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lb.diminfo[0].shape = __pyx_pybuffernd_lb.rcbuffer->pybuffer.shape[0]; } } @@ -20482,37 +22210,38 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_lb = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "wfpt.pyx":634 + /* "wfpt.pyx":656 * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] * # lower bound is cumulative in the wrong direction * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) # <<<<<<<<<<<<<< * * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] */ - __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_TraceLine(656,0,__PYX_ERR(0, 656, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - PyList_SET_ITEM(__pyx_t_9, 0, __pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_int_0)) __PYX_ERR(0, 656, __pyx_L1_error); __pyx_t_11 = NULL; __pyx_t_12 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); @@ -20522,23 +22251,25 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_12 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_diff); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_diff); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_12 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); @@ -20548,28 +22279,30 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_12 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_lb)}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_11 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_11 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_7); - PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); + if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_11)) __PYX_ERR(0, 656, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_12 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); @@ -20579,18 +22312,20 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_12 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_12 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -20600,16 +22335,17 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_12 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 634, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 656, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20626,35 +22362,35 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0; } __pyx_pybuffernd_lb.diminfo[0].strides = __pyx_pybuffernd_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lb.diminfo[0].shape = __pyx_pybuffernd_lb.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) } __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_lb, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "wfpt.pyx":636 + /* "wfpt.pyx":658 * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) * * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] * # ub does not start at 0 */ - __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_TraceLine(658,0,__PYX_ERR(0, 658, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 636, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 658, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_ub.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_x_ub = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 636, __pyx_L1_error) + __PYX_ERR(0, 658, __pyx_L1_error) } else {__pyx_pybuffernd_x_ub.diminfo[0].strides = __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_ub.diminfo[0].shape = __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.shape[0]; } } @@ -20662,29 +22398,29 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_x_ub = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "wfpt.pyx":637 + /* "wfpt.pyx":659 * * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] # <<<<<<<<<<<<<< * # ub does not start at 0 * ub -= ub[0] */ - __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 637, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 659, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ub.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_ub = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ub.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 637, __pyx_L1_error) + __PYX_ERR(0, 659, __pyx_L1_error) } else {__pyx_pybuffernd_ub.diminfo[0].strides = __pyx_pybuffernd_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ub.diminfo[0].shape = __pyx_pybuffernd_ub.rcbuffer->pybuffer.shape[0]; } } @@ -20692,21 +22428,21 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_ub = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "wfpt.pyx":639 + /* "wfpt.pyx":661 * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] * # ub does not start at 0 * ub -= ub[0] # <<<<<<<<<<<<<< * * return (x_lb, lb, x_ub, ub) */ - __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error)) + __Pyx_TraceLine(661,0,__PYX_ERR(0, 661, __pyx_L1_error)) __pyx_t_18 = 0; - __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_ub.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ub.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_ub.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ub.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_ub), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_ub), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 639, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 661, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20723,40 +22459,40 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0; } __pyx_pybuffernd_ub.diminfo[0].strides = __pyx_pybuffernd_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ub.diminfo[0].shape = __pyx_pybuffernd_ub.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 639, __pyx_L1_error) + if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) } __pyx_t_17 = 0; __Pyx_DECREF_SET(__pyx_v_ub, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "wfpt.pyx":641 + /* "wfpt.pyx":663 * ub -= ub[0] * * return (x_lb, lb, x_ub, ub) # <<<<<<<<<<<<<< * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, */ - __Pyx_TraceLine(641,0,__PYX_ERR(0, 641, __pyx_L1_error)) + __Pyx_TraceLine(663,0,__PYX_ERR(0, 663, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)__pyx_v_x_lb); __Pyx_GIVEREF((PyObject *)__pyx_v_x_lb); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_x_lb)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_x_lb))) __PYX_ERR(0, 663, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_lb); __Pyx_GIVEREF((PyObject *)__pyx_v_lb); - PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_lb)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_lb))) __PYX_ERR(0, 663, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_x_ub); __Pyx_GIVEREF((PyObject *)__pyx_v_x_ub); - PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_x_ub)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_x_ub))) __PYX_ERR(0, 663, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_ub); __Pyx_GIVEREF((PyObject *)__pyx_v_ub); - PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_ub)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_ub))) __PYX_ERR(0, 663, __pyx_L1_error); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "wfpt.pyx":625 + /* "wfpt.pyx":647 * * * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< @@ -20806,7 +22542,7 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, return __pyx_r; } -/* "wfpt.pyx":643 +/* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< @@ -20815,16 +22551,16 @@ static PyObject *__pyx_pf_4wfpt_24split_cdf(CYTHON_UNUSED PyObject *__pyx_self, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_27wiener_like_multi_nn_mlp(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_26wiener_like_multi_nn_mlp, "wiener_like_multi_nn_mlp(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); -static PyMethodDef __pyx_mdef_4wfpt_27wiener_like_multi_nn_mlp = {"wiener_like_multi_nn_mlp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_27wiener_like_multi_nn_mlp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_26wiener_like_multi_nn_mlp}; -static PyObject *__pyx_pw_4wfpt_27wiener_like_multi_nn_mlp(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_28wiener_like_multi_nn_mlp, "wiener_like_multi_nn_mlp(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); +static PyMethodDef __pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp = {"wiener_like_multi_nn_mlp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_28wiener_like_multi_nn_mlp}; +static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20836,27 +22572,36 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_w_outlier; PyObject *__pyx_v_network = 0; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 665, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; - PyObject* values[4] = {0,0,0,0}; - /* "wfpt.pyx":646 + /* "wfpt.pyx":668 * double p_outlier = 0, * double w_outlier = 0, * network = None): # <<<<<<<<<<<<<< * #**kwargs): * */ - values[3] = ((PyObject *)((PyObject *)Py_None)); + values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -20874,34 +22619,37 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error) + if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[2] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error) + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); - if (value) { values[3] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error) + if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_nn_mlp") < 0)) __PYX_ERR(0, 643, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_nn_mlp") < 0)) __PYX_ERR(0, 665, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -20918,12 +22666,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_data = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[2]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } @@ -20931,16 +22679,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_nn_mlp", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 643, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_nn_mlp", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 665, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 643, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(__pyx_self, __pyx_v_data, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 665, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(__pyx_self, __pyx_v_data, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); - /* "wfpt.pyx":643 + /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< @@ -20953,11 +22708,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { +static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { float __pyx_v_ll_min; float __pyx_v_log_p; __Pyx_LocalBuf_ND __pyx_pybuffernd_data; @@ -20982,69 +22743,70 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__20) + __Pyx_TraceFrameInit(__pyx_codeobj__21) __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp", 0); - __Pyx_TraceCall("wiener_like_multi_nn_mlp", __pyx_f[0], 643, 0, __PYX_ERR(0, 643, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_multi_nn_mlp", __pyx_f[0], 665, 0, __PYX_ERR(0, 665, __pyx_L1_error)); __pyx_pybuffer_data.pybuffer.buf = NULL; __pyx_pybuffer_data.refcount = 0; __pyx_pybuffernd_data.data = NULL; __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 665, __pyx_L1_error) } __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; - /* "wfpt.pyx":654 + /* "wfpt.pyx":676 * # (in that order) * * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< * cdef float log_p * */ - __Pyx_TraceLine(654,0,__PYX_ERR(0, 654, __pyx_L1_error)) + __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error)) __pyx_v_ll_min = -16.11809; - /* "wfpt.pyx":658 + /* "wfpt.pyx":680 * * # Call to network: * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * else: */ - __Pyx_TraceLine(658,0,__PYX_ERR(0, 658, __pyx_L1_error)) + __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_p_outlier == 0.0); if (__pyx_t_1) { - /* "wfpt.pyx":659 + /* "wfpt.pyx":681 * # Call to network: * if p_outlier == 0: # previous ddm_model * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< * else: * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) */ - __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_TraceLine(681,0,__PYX_ERR(0, 681, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_umath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_umath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_maximum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_maximum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); @@ -21054,19 +22816,21 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_data)}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -21076,19 +22840,21 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -21098,20 +22864,21 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_log_p = __pyx_t_10; - /* "wfpt.pyx":658 + /* "wfpt.pyx":680 * * # Call to network: * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< @@ -21121,46 +22888,47 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "wfpt.pyx":661 + /* "wfpt.pyx":683 * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * else: * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< * return log_p * */ - __Pyx_TraceLine(661,0,__PYX_ERR(0, 661, __pyx_L1_error)) + __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error)) /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_umath); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_umath); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_maximum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_maximum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); @@ -21170,19 +22938,21 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, ((PyObject *)__pyx_v_data)}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 661, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } - __pyx_t_13 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_13 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); @@ -21192,19 +22962,21 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_11, __pyx_t_13}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); @@ -21214,30 +22986,32 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_8 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_8 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); @@ -21247,18 +23021,20 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); @@ -21268,37 +23044,38 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_log_p = __pyx_t_10; } __pyx_L3:; - /* "wfpt.pyx":662 + /* "wfpt.pyx":684 * else: * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) * return log_p # <<<<<<<<<<<<<< * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, */ - __Pyx_TraceLine(662,0,__PYX_ERR(0, 662, __pyx_L1_error)) + __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_log_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_log_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":643 + /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< @@ -21337,7 +23114,7 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "wfpt.pyx":664 +/* "wfpt.pyx":686 * return log_p * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< @@ -21346,16 +23123,16 @@ static PyObject *__pyx_pf_4wfpt_26wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_28wiener_like_multi_nn_mlp_pdf, "wiener_like_multi_nn_mlp_pdf(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); -static PyMethodDef __pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp_pdf = {"wiener_like_multi_nn_mlp_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_28wiener_like_multi_nn_mlp_pdf}; -static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_4wfpt_30wiener_like_multi_nn_mlp_pdf, "wiener_like_multi_nn_mlp_pdf(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); +static PyMethodDef __pyx_mdef_4wfpt_31wiener_like_multi_nn_mlp_pdf = {"wiener_like_multi_nn_mlp_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_30wiener_like_multi_nn_mlp_pdf}; +static PyObject *__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21367,27 +23144,36 @@ PyObject *__pyx_args, PyObject *__pyx_kwds double __pyx_v_w_outlier; PyObject *__pyx_v_network = 0; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp_pdf (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); + if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 686, __pyx_L3_error) + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; - PyObject* values[4] = {0,0,0,0}; - /* "wfpt.pyx":667 + /* "wfpt.pyx":689 * double p_outlier = 0, * double w_outlier = 0, * network = None): # <<<<<<<<<<<<<< * #**kwargs): * */ - values[3] = ((PyObject *)((PyObject *)Py_None)); + values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -21405,34 +23191,37 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) + if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[2] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); - if (value) { values[3] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) + if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_nn_mlp_pdf") < 0)) __PYX_ERR(0, 664, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_nn_mlp_pdf") < 0)) __PYX_ERR(0, 686, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -21449,12 +23238,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_data = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) + __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L3_error) } else { __pyx_v_p_outlier = ((double)((double)0.0)); } if (values[2]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) + __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) } else { __pyx_v_w_outlier = ((double)((double)0.0)); } @@ -21462,16 +23251,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_nn_mlp_pdf", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 664, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("wiener_like_multi_nn_mlp_pdf", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 686, __pyx_L3_error) + goto __pyx_L3_error; __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 664, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(__pyx_self, __pyx_v_data, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_r = __pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(__pyx_self, __pyx_v_data, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); - /* "wfpt.pyx":664 + /* "wfpt.pyx":686 * return log_p * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< @@ -21484,11 +23280,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { +static PyObject *__pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { float __pyx_v_ll_min; float __pyx_v_log_p; __Pyx_LocalBuf_ND __pyx_pybuffernd_data; @@ -21513,69 +23315,70 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__21) + __Pyx_TraceFrameInit(__pyx_codeobj__22) __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp_pdf", 0); - __Pyx_TraceCall("wiener_like_multi_nn_mlp_pdf", __pyx_f[0], 664, 0, __PYX_ERR(0, 664, __pyx_L1_error)); + __Pyx_TraceCall("wiener_like_multi_nn_mlp_pdf", __pyx_f[0], 686, 0, __PYX_ERR(0, 686, __pyx_L1_error)); __pyx_pybuffer_data.pybuffer.buf = NULL; __pyx_pybuffer_data.refcount = 0; __pyx_pybuffernd_data.data = NULL; __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 686, __pyx_L1_error) } __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; - /* "wfpt.pyx":675 + /* "wfpt.pyx":697 * # (in that order) * * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< * cdef float log_p * */ - __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L1_error)) + __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error)) __pyx_v_ll_min = -16.11809; - /* "wfpt.pyx":679 + /* "wfpt.pyx":701 * * # Call to network: * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * else: */ - __Pyx_TraceLine(679,0,__PYX_ERR(0, 679, __pyx_L1_error)) + __Pyx_TraceLine(701,0,__PYX_ERR(0, 701, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_p_outlier == 0.0); if (__pyx_t_1) { - /* "wfpt.pyx":680 + /* "wfpt.pyx":702 * # Call to network: * if p_outlier == 0: # previous ddm_model * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< * else: * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) */ - __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_TraceLine(702,0,__PYX_ERR(0, 702, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_umath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_umath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_maximum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_maximum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); @@ -21585,19 +23388,21 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_data)}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -21607,19 +23412,21 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -21629,20 +23436,21 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_log_p = __pyx_t_10; - /* "wfpt.pyx":679 + /* "wfpt.pyx":701 * * # Call to network: * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< @@ -21652,45 +23460,46 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO goto __pyx_L3; } - /* "wfpt.pyx":682 + /* "wfpt.pyx":704 * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * else: * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< * return log_p */ - __Pyx_TraceLine(682,0,__PYX_ERR(0, 682, __pyx_L1_error)) + __Pyx_TraceLine(704,0,__PYX_ERR(0, 704, __pyx_L1_error)) /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_umath); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_umath); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_maximum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_maximum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); @@ -21700,19 +23509,21 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, ((PyObject *)__pyx_v_data)}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 682, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } - __pyx_t_13 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_13 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); @@ -21722,19 +23533,21 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_11, __pyx_t_13}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); @@ -21744,30 +23557,32 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_8 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_8 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); @@ -21777,18 +23592,20 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); @@ -21798,35 +23615,36 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_t_9 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_log_p = __pyx_t_10; } __pyx_L3:; - /* "wfpt.pyx":683 + /* "wfpt.pyx":705 * else: * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) * return log_p # <<<<<<<<<<<<<< */ - __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error)) + __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_log_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_log_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "wfpt.pyx":664 + /* "wfpt.pyx":686 * return log_p * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< @@ -21884,9 +23702,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 1}, - {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0}, - {&__pyx_n_s__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 1, 1}, + {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1}, + {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0}, + {&__pyx_n_s__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_u_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 1, 0, 1}, {&__pyx_n_s_alfa, __pyx_k_alfa, sizeof(__pyx_k_alfa), 0, 0, 1, 1}, @@ -21922,8 +23740,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, {&__pyx_n_s_full_pdf, __pyx_k_full_pdf, sizeof(__pyx_k_full_pdf), 0, 0, 1, 1}, {&__pyx_n_s_gen_cdf_using_pdf, __pyx_k_gen_cdf_using_pdf, sizeof(__pyx_k_gen_cdf_using_pdf), 0, 0, 1, 1}, - {&__pyx_kp_s_hddm_wfpt_pdf_pxi, __pyx_k_hddm_wfpt_pdf_pxi, sizeof(__pyx_k_hddm_wfpt_pdf_pxi), 0, 0, 1, 0}, - {&__pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_k_hddm_wfpt_wfpt_pyx, sizeof(__pyx_k_hddm_wfpt_wfpt_pyx), 0, 0, 1, 0}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_i_p, __pyx_k_i_p, sizeof(__pyx_k_i_p), 0, 0, 1, 1}, {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, @@ -21988,6 +23804,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_split_by, __pyx_k_split_by, sizeof(__pyx_k_split_by), 0, 0, 1, 1}, {&__pyx_n_s_split_cdf, __pyx_k_split_cdf, sizeof(__pyx_k_split_cdf), 0, 0, 1, 1}, {&__pyx_n_s_squeeze, __pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 0, 1, 1}, + {&__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p, __pyx_k_src_hssm_likelihoods_hddm_wfpt_p, sizeof(__pyx_k_src_hssm_likelihoods_hddm_wfpt_p), 0, 0, 1, 0}, + {&__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_k_src_hssm_likelihoods_hddm_wfpt_w, sizeof(__pyx_k_src_hssm_likelihoods_hddm_wfpt_w), 0, 0, 1, 0}, {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, {&__pyx_n_u_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 1, 0, 1}, {&__pyx_n_s_stack, __pyx_k_stack, sizeof(__pyx_k_stack), 0, 0, 1, 1}, @@ -22041,7 +23859,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 66, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 605, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 627, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 983, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -22053,7 +23871,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -22064,7 +23882,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -22075,49 +23893,49 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "wfpt.pyx":101 + /* "wfpt.pyx":133 * * if not p_outlier_in_range(p_outlier): * logp[:] = -np.inf # <<<<<<<<<<<<<< * return logp * */ - __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__7); - __Pyx_GIVEREF(__pyx_slice__7); + __pyx_slice__8 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__8); + __Pyx_GIVEREF(__pyx_slice__8); - /* "wfpt.pyx":308 + /* "wfpt.pyx":330 * * * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) # <<<<<<<<<<<<<< * data[:, n_params:] = np.stack([x, response], axis = 1) * */ - __pyx_slice__10 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__10); - __Pyx_GIVEREF(__pyx_slice__10); + __pyx_slice__11 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__11); + __Pyx_GIVEREF(__pyx_slice__11); - /* "wfpt.pyx":605 + /* "wfpt.pyx":627 * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError( # <<<<<<<<<<<<<< * "at least one of the parameters is out of the support") * */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_at_least_one_of_the_parameters_i); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_at_least_one_of_the_parameters_i); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); - /* "wfpt.pyx":631 + /* "wfpt.pyx":653 * * # lower bound is reversed * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] * # lower bound is cumulative in the wrong direction */ - __pyx_slice__19 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__19); - __Pyx_GIVEREF(__pyx_slice__19); + __pyx_slice__20 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__20); + __Pyx_GIVEREF(__pyx_slice__20); /* "wfpt.pyx":19 * #from hddm.model_config import model_config @@ -22126,24 +23944,24 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * from copy import copy * import numpy as np */ - __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_scipy, __pyx_n_s_integrate); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_scipy, __pyx_n_s_integrate); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); - /* "hddm_wfpt/pdf.pxi":104 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< * z, double sz, double t, double st, double err, int * n_st=2, int n_sz=2, bint use_adaptive=1, double */ - __pyx_tuple__25 = PyTuple_Pack(13, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(13, 0, 0, 13, 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_hddm_wfpt_pdf_pxi, __pyx_n_s_full_pdf, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(2, 104, __pyx_L1_error) - __pyx_tuple__26 = PyTuple_Pack(4, __pyx_int_2, __pyx_int_2, __pyx_int_1, __pyx_float_1eneg_3); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 104, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(13, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(13, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p, __pyx_n_s_full_pdf, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(2, 104, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(4, __pyx_int_2, __pyx_int_2, __pyx_int_1, __pyx_float_1eneg_3); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "wfpt.pyx":32 * include 'integrate.pxi' @@ -22152,10 +23970,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): */ - __pyx_tuple__27 = PyTuple_Pack(19, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_logp, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_y); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_pdf_array, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(19, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_logp, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_y); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_pdf_array, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 32, __pyx_L1_error) /* "wfpt.pyx":54 * @@ -22164,151 +23982,160 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0.1): */ - __pyx_tuple__28 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_tuple__29 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 20, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 54, __pyx_L1_error) /* "wfpt.pyx":78 * return sum_logp * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + __pyx_tuple__30 = PyTuple_Pack(24, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_multi, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_params, __pyx_n_s_params_iter, __pyx_n_s_param); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 78, __pyx_L1_error) + + /* "wfpt.pyx":110 + * return sum_logp + * * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] v, * np.ndarray[double, ndim=1] sv, */ - __pyx_tuple__29 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_logp, __pyx_n_s_p, __pyx_n_s_wp_outlier); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 20, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_logp_array, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_logp, __pyx_n_s_p, __pyx_n_s_wp_outlier); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 20, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_logp_array, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 110, __pyx_L1_error) - /* "wfpt.pyx":128 + /* "wfpt.pyx":150 * return logp * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, */ - __pyx_tuple__30 = PyTuple_Pack(36, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_alpha, __pyx_n_s_pos_alpha, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_unique); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 36, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_rlddm, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(36, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_alpha, __pyx_n_s_pos_alpha, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_unique); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 36, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rlddm, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 150, __pyx_L1_error) - /* "wfpt.pyx":206 + /* "wfpt.pyx":228 * * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] x, * np.ndarray[long, ndim=1] response, */ - __pyx_tuple__31 = PyTuple_Pack(37, __pyx_n_s_model, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_params_ssm, __pyx_n_s_params_rl, __pyx_n_s_params_bnds, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_v, __pyx_n_s_rl_alpha, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_p, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_log_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_responses_qs, __pyx_n_s_unique, __pyx_n_s_n_params, __pyx_n_s_data, __pyx_n_s_ll_min, __pyx_n_s_cumm_s_size, __pyx_n_s_lower_bnd, __pyx_n_s_upper_bnd); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(12, 0, 0, 37, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_rlssm_nn, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_tuple__33 = PyTuple_Pack(37, __pyx_n_s_model, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_params_ssm, __pyx_n_s_params_rl, __pyx_n_s_params_bnds, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_v, __pyx_n_s_rl_alpha, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_p, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_log_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_responses_qs, __pyx_n_s_unique, __pyx_n_s_n_params, __pyx_n_s_data, __pyx_n_s_ll_min, __pyx_n_s_cumm_s_size, __pyx_n_s_lower_bnd, __pyx_n_s_upper_bnd); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(12, 0, 0, 37, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rlssm_nn, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 228, __pyx_L1_error) - /* "wfpt.pyx":320 + /* "wfpt.pyx":342 * * * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] feedback, * np.ndarray[long, ndim=1] split_by, */ - __pyx_tuple__32 = PyTuple_Pack(30, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_alpha, __pyx_n_s_pos_alpha, __pyx_n_s_v, __pyx_n_s_z, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_drift, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_unique); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_rl, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(30, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_alpha, __pyx_n_s_pos_alpha, __pyx_n_s_v, __pyx_n_s_z, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_drift, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_unique); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rl, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 342, __pyx_L1_error) - /* "wfpt.pyx":407 + /* "wfpt.pyx":429 * * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): */ - __pyx_tuple__33 = PyTuple_Pack(24, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_multi, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_params, __pyx_n_s_params_iter, __pyx_n_s_param); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 24, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_multi, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 429, __pyx_L1_error) - /* "wfpt.pyx":440 + /* "wfpt.pyx":462 * * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, */ - __pyx_tuple__34 = PyTuple_Pack(34, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_alpha, __pyx_n_s_err, __pyx_n_s_multi, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_ij, __pyx_n_s_s_size, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_s, __pyx_n_s_qs, __pyx_n_s_params, __pyx_n_s_params_iter, __pyx_n_s_i, __pyx_n_s_param, __pyx_n_s_alfa); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 34, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_multi_rlddm, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(34, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_alpha, __pyx_n_s_err, __pyx_n_s_multi, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_ij, __pyx_n_s_s_size, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_s, __pyx_n_s_qs, __pyx_n_s_params, __pyx_n_s_params_iter, __pyx_n_s_i, __pyx_n_s_param, __pyx_n_s_alfa); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 34, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi_rlddm, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 462, __pyx_L1_error) - /* "wfpt.pyx":486 + /* "wfpt.pyx":508 * * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< * np.ndarray[float, ndim=2] rl_arr, * np.ndarray[double, ndim=1] x, */ - __pyx_tuple__35 = PyTuple_Pack(34, __pyx_n_s_data, __pyx_n_s_rl_arr, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_params_bnds, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_rl_alpha, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_p, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_log_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_responses_qs, __pyx_n_s_unique, __pyx_n_s_data_copy, __pyx_n_s_ll_min, __pyx_n_s_cumm_s_size, __pyx_n_s_lower_bnd, __pyx_n_s_upper_bnd, __pyx_n_s_tp_scale); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 34, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_rlssm_nn_reg, 486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(34, __pyx_n_s_data, __pyx_n_s_rl_arr, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_params_bnds, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_rl_alpha, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_p, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_log_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_responses_qs, __pyx_n_s_unique, __pyx_n_s_data_copy, __pyx_n_s_ll_min, __pyx_n_s_cumm_s_size, __pyx_n_s_lower_bnd, __pyx_n_s_upper_bnd, __pyx_n_s_tp_scale); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 34, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rlssm_nn_reg, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 508, __pyx_L1_error) - /* "wfpt.pyx":566 + /* "wfpt.pyx":588 * return sum_logp * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< * double sv, double a, double z, double sz, double t, double st, double t_min, * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, */ - __pyx_tuple__36 = PyTuple_Pack(22, __pyx_n_s_x, __pyx_n_s_cont_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_t_min, __pyx_n_s_t_max, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_n_cont, __pyx_n_s_pos_cont); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_contaminant, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(22, __pyx_n_s_x, __pyx_n_s_cont_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_t_min, __pyx_n_s_t_max, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_n_cont, __pyx_n_s_pos_cont); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 22, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_contaminant, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 588, __pyx_L1_error) - /* "wfpt.pyx":597 + /* "wfpt.pyx":619 * return sum_logp * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): */ - __pyx_tuple__37 = PyTuple_Pack(19, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_N, __pyx_n_s_time, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_x, __pyx_n_s_cdf_array, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_gen_cdf_using_pdf, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(19, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_N, __pyx_n_s_time, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_x, __pyx_n_s_cdf_array, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_gen_cdf_using_pdf, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 619, __pyx_L1_error) - /* "wfpt.pyx":625 + /* "wfpt.pyx":647 * * * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< * * # get length of data */ - __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_s_x, __pyx_n_s_data, __pyx_n_s_N, __pyx_n_s_x_lb, __pyx_n_s_lb, __pyx_n_s_x_ub, __pyx_n_s_ub); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_hddm_wfpt_wfpt_pyx, __pyx_n_s_split_cdf, 625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_s_x, __pyx_n_s_data, __pyx_n_s_N, __pyx_n_s_x_lb, __pyx_n_s_lb, __pyx_n_s_x_ub, __pyx_n_s_ub); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_split_cdf, 647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 647, __pyx_L1_error) - /* "wfpt.pyx":643 + /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, */ - __pyx_tuple__39 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_ll_min, __pyx_n_s_log_p); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_multi_nn_mlp, 643, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_ll_min, __pyx_n_s_log_p); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi_nn_mlp, 665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 665, __pyx_L1_error) - /* "wfpt.pyx":664 + /* "wfpt.pyx":686 * return log_p * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, */ - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 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_hddm_wfpt_wfpt_pyx, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, 664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -22340,7 +24167,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { * numpy._import_array */ #ifdef NPY_FEATURE_VERSION -#if !NO_IMPORT_ARRAY +#ifndef NO_IMPORT_ARRAY if (unlikely(_import_array() == -1)) { PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import " "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; " @@ -22407,33 +24234,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -22749,7 +24576,7 @@ if (!__Pyx_RefNanny) { #endif __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_wfpt(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -22759,7 +24586,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -22769,7 +24596,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -22779,7 +24606,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(257,0,__PYX_ERR(1, 257, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -22789,7 +24616,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(263,0,__PYX_ERR(1, 263, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -22799,7 +24626,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(271,0,__PYX_ERR(1, 271, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -22809,7 +24636,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(278,0,__PYX_ERR(1, 278, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -22819,7 +24646,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -22829,7 +24656,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(773,0,__PYX_ERR(1, 773, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -22839,7 +24666,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -22849,7 +24676,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -22859,7 +24686,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -22869,7 +24696,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -22879,7 +24706,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(788,0,__PYX_ERR(1, 788, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -22889,7 +24716,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(967,0,__PYX_ERR(1, 967, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -22899,7 +24726,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(971,0,__PYX_ERR(1, 971, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -22909,7 +24736,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -22919,7 +24746,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -22929,7 +24756,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -22939,7 +24766,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(998,0,__PYX_ERR(1, 998, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -22949,7 +24776,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -22959,7 +24786,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -22969,7 +24796,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error)) - /* "../../../../../private/var/folders/gx/s43vynx550qbypcxm83fv56dzq4hgg/T/pip-build-env-628kb_jm/overlay/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -22987,7 +24814,7 @@ if (!__Pyx_RefNanny) { * import numpy as np */ __Pyx_TraceLine(19,0,__PYX_ERR(0, 19, __pyx_L1_error)) - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_scipy_integrate, __pyx_tuple__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_scipy_integrate, __pyx_tuple__23); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_integrate, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23004,7 +24831,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_copy); __Pyx_GIVEREF(__pyx_n_s_copy); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_copy); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_copy)) __PYX_ERR(0, 20, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_copy, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23027,7 +24854,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hddm_wfpt/integrate.pxi":6 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":6 * #cython: boundscheck=False * * import numpy as np # <<<<<<<<<<<<<< @@ -23040,7 +24867,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(3, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hddm_wfpt/pdf.pxi":28 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 * T max[T](T a, T b) * * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< @@ -23050,7 +24877,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(28,0,__PYX_ERR(2, 28, __pyx_L1_error)) - /* "hddm_wfpt/pdf.pxi":67 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 * return p * * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< @@ -23060,7 +24887,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(67,0,__PYX_ERR(2, 67, __pyx_L1_error)) - /* "hddm_wfpt/pdf.pxi":74 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) * * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< @@ -23070,7 +24897,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(74,0,__PYX_ERR(2, 74, __pyx_L1_error)) - /* "hddm_wfpt/pdf.pxi":87 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) * * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< @@ -23080,7 +24907,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(87,0,__PYX_ERR(2, 87, __pyx_L1_error)) - /* "hddm_wfpt/pdf.pxi":104 + /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< @@ -23091,11 +24918,11 @@ if (!__Pyx_RefNanny) { __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_1full_pdf, 0, __pyx_n_s_full_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__26); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__27); if (PyDict_SetItem(__pyx_d, __pyx_n_s_full_pdf, __pyx_t_3) < 0) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "hddm_wfpt/integrate.pxi":12 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 * include 'pdf.pxi' * * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< @@ -23105,7 +24932,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(12,0,__PYX_ERR(3, 12, __pyx_L1_error)) - /* "hddm_wfpt/integrate.pxi":47 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 * return ((ht+hz) * S / 3) * * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< @@ -23115,7 +24942,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(47,0,__PYX_ERR(3, 47, __pyx_L1_error)) - /* "hddm_wfpt/integrate.pxi":72 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 * return (ht * S / 3) * * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< @@ -23125,7 +24952,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(72,0,__PYX_ERR(3, 72, __pyx_L1_error)) - /* "hddm_wfpt/integrate.pxi":114 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 * Sright, f_mid, f_end, fe, bottom-1) * * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< @@ -23135,7 +24962,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(114,0,__PYX_ERR(3, 114, __pyx_L1_error)) - /* "hddm_wfpt/integrate.pxi":143 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 * return res * * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< @@ -23145,7 +24972,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(143,0,__PYX_ERR(3, 143, __pyx_L1_error)) - /* "hddm_wfpt/integrate.pxi":181 + /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 * * * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< @@ -23200,21 +25027,21 @@ if (!__Pyx_RefNanny) { __pyx_t_10 = PyTuple_New(8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8)) __PYX_ERR(0, 32, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_9)) __PYX_ERR(0, 32, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; @@ -23281,17 +25108,17 @@ if (!__Pyx_RefNanny) { __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10)) __PYX_ERR(0, 54, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7)) __PYX_ERR(0, 54, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_8 = 0; @@ -23305,694 +25132,762 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like, __pyx_t_5) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "wfpt.pyx":87 + /* "wfpt.pyx":79 + * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< + * double p_outlier=0, double w_outlier=0): + * cdef Py_ssize_t size = x.shape[0] + */ + __Pyx_TraceLine(79,0,__PYX_ERR(0, 79, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "wfpt.pyx":80 + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< + * cdef Py_ssize_t size = x.shape[0] + * cdef Py_ssize_t i + */ + __Pyx_TraceLine(80,0,__PYX_ERR(0, 80, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "wfpt.pyx":78 + * return sum_logp + * + * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< + * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, + * double p_outlier=0, double w_outlier=0): + */ + __Pyx_TraceLine(78,0,__PYX_ERR(0, 78, __pyx_L1_error)) + __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, Py_None)) __PYX_ERR(0, 78, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_6)) __PYX_ERR(0, 78, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_7wiener_like_multi, 0, __pyx_n_s_wiener_like_multi, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi, __pyx_t_10) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "wfpt.pyx":119 * np.ndarray[double, ndim=1] st, * double err, * int n_st=10, # <<<<<<<<<<<<<< * int n_sz=10, * bint use_adaptive=1, */ - __Pyx_TraceLine(87,0,__PYX_ERR(0, 87, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); - /* "wfpt.pyx":88 + /* "wfpt.pyx":120 * double err, * int n_st=10, * int n_sz=10, # <<<<<<<<<<<<<< * bint use_adaptive=1, * double simps_err=1e-8, */ - __Pyx_TraceLine(88,0,__PYX_ERR(0, 88, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_TraceLine(120,0,__PYX_ERR(0, 120, __pyx_L1_error)) + __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); - /* "wfpt.pyx":89 + /* "wfpt.pyx":121 * int n_st=10, * int n_sz=10, * bint use_adaptive=1, # <<<<<<<<<<<<<< * double simps_err=1e-8, * double p_outlier=0, */ - __Pyx_TraceLine(89,0,__PYX_ERR(0, 89, __pyx_L1_error)) - __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error)) + __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); - /* "wfpt.pyx":90 + /* "wfpt.pyx":122 * int n_sz=10, * bint use_adaptive=1, * double simps_err=1e-8, # <<<<<<<<<<<<<< * double p_outlier=0, * double w_outlier=0.1): */ - __Pyx_TraceLine(90,0,__PYX_ERR(0, 90, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_TraceLine(122,0,__PYX_ERR(0, 122, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "wfpt.pyx":91 + /* "wfpt.pyx":123 * bint use_adaptive=1, * double simps_err=1e-8, * double p_outlier=0, # <<<<<<<<<<<<<< * double w_outlier=0.1): * */ - __Pyx_TraceLine(91,0,__PYX_ERR(0, 91, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error)) + __pyx_t_6 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); - /* "wfpt.pyx":92 + /* "wfpt.pyx":124 * double simps_err=1e-8, * double p_outlier=0, * double w_outlier=0.1): # <<<<<<<<<<<<<< * * cdef Py_ssize_t size = x.shape[0] */ - __Pyx_TraceLine(92,0,__PYX_ERR(0, 92, __pyx_L1_error)) - __pyx_t_10 = PyFloat_FromDouble(((double)0.1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error)) + __pyx_t_4 = PyFloat_FromDouble(((double)0.1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "wfpt.pyx":78 - * return sum_logp + /* "wfpt.pyx":110 + * return sum_logp * * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] v, * np.ndarray[double, ndim=1] sv, */ - __Pyx_TraceLine(78,0,__PYX_ERR(0, 78, __pyx_L1_error)) - __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_8); + __Pyx_TraceLine(110,0,__PYX_ERR(0, 110, __pyx_L1_error)) + __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_10); - __pyx_t_5 = 0; - __pyx_t_4 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10)) __PYX_ERR(0, 110, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9)) __PYX_ERR(0, 110, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_8)) __PYX_ERR(0, 110, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_7wiener_logp_array, 0, __pyx_n_s_wiener_logp_array, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_logp_array, __pyx_t_10) < 0) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_9wiener_logp_array, 0, __pyx_n_s_wiener_logp_array, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_logp_array, __pyx_t_4) < 0) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":134 + /* "wfpt.pyx":156 * double q, double alpha, double pos_alpha, double v, * double sv, double a, double z, double sz, double t, * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0): * cdef Py_ssize_t size = x.shape[0] */ - __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error)) - __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "wfpt.pyx":135 + /* "wfpt.pyx":157 * double sv, double a, double z, double sz, double t, * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< * cdef Py_ssize_t size = x.shape[0] * cdef Py_ssize_t i, j */ - __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error)) - __pyx_t_6 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); - /* "wfpt.pyx":128 + /* "wfpt.pyx":150 * return logp * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, */ - __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error)) - __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_6); + __Pyx_TraceLine(150,0,__PYX_ERR(0, 150, __pyx_L1_error)) + __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4); - __pyx_t_10 = 0; - __pyx_t_9 = 0; - __pyx_t_8 = 0; - __pyx_t_7 = 0; - __pyx_t_6 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_9wiener_like_rlddm, 0, __pyx_n_s_wiener_like_rlddm, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlddm, __pyx_t_4) < 0) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_11wiener_like_rlddm, 0, __pyx_n_s_wiener_like_rlddm, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlddm, __pyx_t_9) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "wfpt.pyx":215 + /* "wfpt.pyx":237 * np.ndarray[double, ndim=1] params_rl, * np.ndarray[double, ndim=2] params_bnds, * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< * * cdef double v = params_ssm[0] */ - __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error)) - __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); - /* "wfpt.pyx":206 + /* "wfpt.pyx":228 * * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] x, * np.ndarray[long, ndim=1] response, */ - __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error)) - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - __Pyx_INCREF(((PyObject *)Py_None)); - __Pyx_GIVEREF(((PyObject *)Py_None)); - PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)Py_None)); - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_11wiener_like_rlssm_nn, 0, __pyx_n_s_wiener_like_rlssm_nn, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlssm_nn, __pyx_t_5) < 0) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error)) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(0, 228, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_None)) __PYX_ERR(0, 228, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_13wiener_like_rlssm_nn, 0, __pyx_n_s_wiener_like_rlssm_nn, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlssm_nn, __pyx_t_10) < 0) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "wfpt.pyx":324 + /* "wfpt.pyx":346 * np.ndarray[long, ndim=1] split_by, * double q, double alpha, double pos_alpha, double v, double z, * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0): * cdef Py_ssize_t size = response.shape[0] */ - __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error)) - __pyx_t_5 = PyFloat_FromDouble(((double)1e-4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_TraceLine(346,0,__PYX_ERR(0, 346, __pyx_L1_error)) + __pyx_t_10 = PyFloat_FromDouble(((double)1e-4)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); - /* "wfpt.pyx":325 + /* "wfpt.pyx":347 * double q, double alpha, double pos_alpha, double v, double z, * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< * cdef Py_ssize_t size = response.shape[0] * cdef Py_ssize_t i, j */ - __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error)) + __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "wfpt.pyx":320 + /* "wfpt.pyx":342 * * * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] feedback, * np.ndarray[long, ndim=1] split_by, */ - __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error)) - __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error)) + __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10)) __PYX_ERR(0, 342, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8)) __PYX_ERR(0, 342, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_10); - __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_4 = 0; - __pyx_t_7 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9)) __PYX_ERR(0, 342, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error); + __pyx_t_10 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_13wiener_like_rl, 0, __pyx_n_s_wiener_like_rl, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_15wiener_like_rl, 0, __pyx_n_s_wiener_like_rl, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rl, __pyx_t_10) < 0) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rl, __pyx_t_4) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":408 + /* "wfpt.pyx":430 * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0): * cdef Py_ssize_t size = x.shape[0] */ - __Pyx_TraceLine(408,0,__PYX_ERR(0, 408, __pyx_L1_error)) - __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); - /* "wfpt.pyx":409 + /* "wfpt.pyx":431 * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< * cdef Py_ssize_t size = x.shape[0] * cdef Py_ssize_t i */ - __Pyx_TraceLine(409,0,__PYX_ERR(0, 409, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); - /* "wfpt.pyx":407 + /* "wfpt.pyx":429 * * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): */ - __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error)) - __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(((PyObject *)Py_None)); - __Pyx_GIVEREF(((PyObject *)Py_None)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_None)); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); + __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error)) + __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, Py_None)) __PYX_ERR(0, 429, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_4); - __pyx_t_10 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error); + __pyx_t_4 = 0; __pyx_t_2 = 0; - __pyx_t_9 = 0; - __pyx_t_8 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; __pyx_t_7 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_15wiener_like_multi, 0, __pyx_n_s_wiener_like_multi, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi, __pyx_t_4) < 0) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_17wiener_like_multi, 0, __pyx_n_s_wiener_like_multi, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi, __pyx_t_9) < 0) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "wfpt.pyx":445 + /* "wfpt.pyx":467 * np.ndarray[long, ndim=1] split_by, * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0): * cdef Py_ssize_t size = x.shape[0] */ - __Pyx_TraceLine(445,0,__PYX_ERR(0, 445, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error)) + __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); - /* "wfpt.pyx":446 + /* "wfpt.pyx":468 * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< * cdef Py_ssize_t size = x.shape[0] * cdef Py_ssize_t ij */ - __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error)) + __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "wfpt.pyx":440 + /* "wfpt.pyx":462 * * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, */ - __Pyx_TraceLine(440,0,__PYX_ERR(0, 440, __pyx_L1_error)) - __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(((PyObject *)Py_None)); - __Pyx_GIVEREF(((PyObject *)Py_None)); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_None)); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8); + __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error)) + __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None)) __PYX_ERR(0, 462, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9)) __PYX_ERR(0, 462, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_8)) __PYX_ERR(0, 462, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7)) __PYX_ERR(0, 462, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_6)) __PYX_ERR(0, 462, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_2); - __pyx_t_4 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error); __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_17wiener_like_multi_rlddm, 0, __pyx_n_s_wiener_like_multi_rlddm, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_19wiener_like_multi_rlddm, 0, __pyx_n_s_wiener_like_multi_rlddm, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_rlddm, __pyx_t_2) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_rlddm, __pyx_t_2) < 0) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "wfpt.pyx":494 + /* "wfpt.pyx":516 * double q, * np.ndarray[double, ndim=2] params_bnds, * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< * cdef double rl_alpha * cdef Py_ssize_t size = x.shape[0] */ - __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error)) - __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_TraceLine(516,0,__PYX_ERR(0, 516, __pyx_L1_error)) + __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "wfpt.pyx":486 + /* "wfpt.pyx":508 * * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< * np.ndarray[float, ndim=2] rl_arr, * np.ndarray[double, ndim=1] x, */ - __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error)) - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error)) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); - __Pyx_INCREF(((PyObject *)Py_None)); - __Pyx_GIVEREF(((PyObject *)Py_None)); - PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)Py_None)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None)) __PYX_ERR(0, 508, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_19wiener_like_rlssm_nn_reg, 0, __pyx_n_s_wiener_like_rlssm_nn_reg, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlssm_nn_reg, __pyx_t_10) < 0) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_21wiener_like_rlssm_nn_reg, 0, __pyx_n_s_wiener_like_rlssm_nn_reg, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlssm_nn_reg, __pyx_t_4) < 0) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "wfpt.pyx":568 + /* "wfpt.pyx":590 * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, * double sv, double a, double z, double sz, double t, double st, double t_min, * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, # <<<<<<<<<<<<<< * double simps_err=1e-8): * """Wiener likelihood function where RTs could come from a */ - __Pyx_TraceLine(568,0,__PYX_ERR(0, 568, __pyx_L1_error)) - __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_TraceLine(590,0,__PYX_ERR(0, 590, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "wfpt.pyx":569 + /* "wfpt.pyx":591 * double sv, double a, double z, double sz, double t, double st, double t_min, * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, * double simps_err=1e-8): # <<<<<<<<<<<<<< * """Wiener likelihood function where RTs could come from a * separate, uniform contaminant distribution. */ - __Pyx_TraceLine(569,0,__PYX_ERR(0, 569, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_TraceLine(591,0,__PYX_ERR(0, 591, __pyx_L1_error)) + __pyx_t_6 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); - /* "wfpt.pyx":566 + /* "wfpt.pyx":588 * return sum_logp * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< * double sv, double a, double z, double sz, double t, double st, double t_min, * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, */ - __Pyx_TraceLine(566,0,__PYX_ERR(0, 566, __pyx_L1_error)) - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error)) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_8); - __pyx_t_10 = 0; - __pyx_t_9 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(0, 588, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_5 = 0; __pyx_t_2 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_21wiener_like_contaminant, 0, __pyx_n_s_wiener_like_contaminant, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_23wiener_like_contaminant, 0, __pyx_n_s_wiener_like_contaminant, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_contaminant, __pyx_t_8) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_contaminant, __pyx_t_6) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "wfpt.pyx":598 + /* "wfpt.pyx":620 * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0): * """ */ - __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error)) - __pyx_t_8 = __Pyx_PyInt_From_int(((int)0x1F4)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyFloat_FromDouble(((double)5.)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_TraceLine(620,0,__PYX_ERR(0, 620, __pyx_L1_error)) + __pyx_t_6 = __Pyx_PyInt_From_int(((int)0x1F4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyFloat_FromDouble(((double)5.)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); - /* "wfpt.pyx":599 + /* "wfpt.pyx":621 * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< * """ * generate cdf vector using the pdf */ - __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error)) - __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); - /* "wfpt.pyx":597 + /* "wfpt.pyx":619 * return sum_logp * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): */ - __Pyx_TraceLine(597,0,__PYX_ERR(0, 597, __pyx_L1_error)) - __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error)) + __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_5)) __PYX_ERR(0, 619, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_8)) __PYX_ERR(0, 619, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_9)) __PYX_ERR(0, 619, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_5); - __pyx_t_8 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_10)) __PYX_ERR(0, 619, __pyx_L1_error); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; - __pyx_t_6 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_23gen_cdf_using_pdf, 0, __pyx_n_s_gen_cdf_using_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_3); + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_25gen_cdf_using_pdf, 0, __pyx_n_s_gen_cdf_using_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_gen_cdf_using_pdf, __pyx_t_5) < 0) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gen_cdf_using_pdf, __pyx_t_10) < 0) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "wfpt.pyx":625 + /* "wfpt.pyx":647 * * * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< * * # get length of data */ - __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error)) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_25split_cdf, 0, __pyx_n_s_split_cdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_cdf, __pyx_t_5) < 0) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_TraceLine(647,0,__PYX_ERR(0, 647, __pyx_L1_error)) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_27split_cdf, 0, __pyx_n_s_split_cdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_cdf, __pyx_t_10) < 0) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "wfpt.pyx":644 + /* "wfpt.pyx":666 * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, * double p_outlier = 0, # <<<<<<<<<<<<<< * double w_outlier = 0, * network = None): */ - __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error)) - __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_TraceLine(666,0,__PYX_ERR(0, 666, __pyx_L1_error)) + __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); - /* "wfpt.pyx":645 + /* "wfpt.pyx":667 * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, * double p_outlier = 0, * double w_outlier = 0, # <<<<<<<<<<<<<< * network = None): * #**kwargs): */ - __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error)) - __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_TraceLine(667,0,__PYX_ERR(0, 667, __pyx_L1_error)) + __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "wfpt.pyx":643 + /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, */ - __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error)) - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error)) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10)) __PYX_ERR(0, 665, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_INCREF(((PyObject *)Py_None)); - __Pyx_GIVEREF(((PyObject *)Py_None)); - PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)Py_None)); - __pyx_t_5 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None)) __PYX_ERR(0, 665, __pyx_L1_error); + __pyx_t_10 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_27wiener_like_multi_nn_mlp, 0, __pyx_n_s_wiener_like_multi_nn_mlp, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp, 0, __pyx_n_s_wiener_like_multi_nn_mlp, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_nn_mlp, __pyx_t_3) < 0) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_nn_mlp, __pyx_t_3) < 0) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "wfpt.pyx":665 + /* "wfpt.pyx":687 * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, * double p_outlier = 0, # <<<<<<<<<<<<<< * double w_outlier = 0, * network = None): */ - __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error)) - __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_TraceLine(687,0,__PYX_ERR(0, 687, __pyx_L1_error)) + __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "wfpt.pyx":666 + /* "wfpt.pyx":688 * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, * double p_outlier = 0, * double w_outlier = 0, # <<<<<<<<<<<<<< * network = None): * #**kwargs): */ - __Pyx_TraceLine(666,0,__PYX_ERR(0, 666, __pyx_L1_error)) - __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_TraceLine(688,0,__PYX_ERR(0, 688, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); - /* "wfpt.pyx":664 + /* "wfpt.pyx":686 * return log_p * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, */ - __Pyx_TraceLine(664,0,__PYX_ERR(0, 664, __pyx_L1_error)) - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_TraceLine(686,0,__PYX_ERR(0, 686, __pyx_L1_error)) + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_INCREF(((PyObject *)Py_None)); - __Pyx_GIVEREF(((PyObject *)Py_None)); - PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)Py_None)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9)) __PYX_ERR(0, 686, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None)) __PYX_ERR(0, 686, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp_pdf, 0, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, __pyx_t_4) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_31wiener_like_multi_nn_mlp_pdf, 0, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, __pyx_t_9) < 0) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "wfpt.pyx":1 * # cython: embedsignature=True # <<<<<<<<<<<<<< @@ -24000,10 +25895,10 @@ if (!__Pyx_RefNanny) { * # cython: wraparound=False */ __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -24956,22 +26851,52 @@ static int __Pyx_ParseOptionalKeywords( PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { - if (pos >= PyTuple_GET_SIZE(kwds)) break; + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); // transfer ownership of value to values + Py_DECREF(key); +#endif + key = NULL; + value = NULL; continue; } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { @@ -24979,6 +26904,9 @@ static int __Pyx_ParseOptionalKeywords( if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; // ownership transferred to values +#endif break; } name++; @@ -25008,6 +26936,9 @@ static int __Pyx_ParseOptionalKeywords( if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; // ownership transferred to values +#endif break; } name++; @@ -25034,6 +26965,8 @@ static int __Pyx_ParseOptionalKeywords( goto invalid_keyword; } } + Py_XDECREF(key); + Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); @@ -25053,6 +26986,8 @@ static int __Pyx_ParseOptionalKeywords( function_name, key); #endif bad: + Py_XDECREF(key); + Py_XDECREF(value); return -1; } @@ -25419,7 +27354,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ctx->is_complex = 0; return 0; } -static PyObject * +static int __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) { const char *ts = *tsp; @@ -25428,9 +27363,9 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) if (ctx->new_count != 1) { PyErr_SetString(PyExc_ValueError, "Cannot handle repeated arrays in format string"); - return NULL; + return -1; } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1; ndim = ctx->head->field->type->ndim; while (*ts && *ts != ')') { switch (*ts) { @@ -25438,29 +27373,35 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) default: break; } number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) - return PyErr_Format(PyExc_ValueError, + if (number == -1) return -1; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) { + PyErr_Format(PyExc_ValueError, "Expected a dimension of size %zu, got %d", ctx->head->field->type->arraysize[i], number); - if (*ts != ',' && *ts != ')') - return PyErr_Format(PyExc_ValueError, + return -1; + } + if (*ts != ',' && *ts != ')') { + PyErr_Format(PyExc_ValueError, "Expected a comma in format string, got '%c'", *ts); + return -1; + } if (*ts == ',') ts++; i++; } - if (i != ndim) - return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + if (i != ndim) { + PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", ctx->head->field->type->ndim, i); + return -1; + } if (!*ts) { PyErr_SetString(PyExc_ValueError, "Unexpected end of format string, expected ')'"); - return NULL; + return -1; } ctx->is_valid_array = 1; ctx->new_count = 1; *tsp = ++ts; - return Py_None; + return 0; } static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { int got_Z = 0; @@ -25586,7 +27527,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha ++ts; break; case '(': - if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL; break; default: { @@ -25880,15 +27821,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall */ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; - PyObject *result; + PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: Py_DECREF(argstuple); return result; } @@ -25938,7 +27880,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif #if CYTHON_VECTORCALL + #if Py_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif if (f) { return f(func, args, (size_t)nargs, kwargs); } @@ -25954,6 +27900,30 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); } +/* DictGetItem */ + #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; @@ -26103,30 +28073,6 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { } #endif -/* DictGetItem */ - #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - if (unlikely(PyTuple_Check(key))) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) { - PyErr_SetObject(PyExc_KeyError, args); - Py_DECREF(args); - } - } else { - PyErr_SetObject(PyExc_KeyError, key); - } - } - return NULL; - } - Py_INCREF(value); - return value; -} -#endif - /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); @@ -26466,10 +28412,10 @@ static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_0 -#define __PYX_HAVE_RT_ImportType_3_0_0 -static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 check_size) + #ifndef __PYX_HAVE_RT_ImportType_3_0_2 +#define __PYX_HAVE_RT_ImportType_3_0_2 +static PyTypeObject *__Pyx_ImportType_3_0_2(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_2 check_size) { PyObject *result = 0; char warning[200]; @@ -26523,7 +28469,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_0 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_2 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -26531,7 +28477,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_0 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_2 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -26569,13 +28515,8 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module #if PY_MAJOR_VERSION >= 3 if (level == -1) { if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, 1); - #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); - #endif if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; @@ -26594,14 +28535,9 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, level); - #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif - #endif } } bad: @@ -26691,7 +28627,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__23; + PyObject *module, *from_list, *star = __pyx_n_s__24; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) @@ -26754,7 +28690,7 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__24); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__25); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } @@ -27024,7 +28960,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ /* CythonFunctionShared */ static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); @@ -27039,6 +28975,10 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); @@ -27051,6 +28991,7 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) Py_INCREF(Py_None); return Py_None; } +#endif } Py_INCREF(op->func_doc); return op->func_doc; @@ -27071,7 +29012,9 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { -#if PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); @@ -27190,10 +29133,10 @@ __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else - op->defaults_tuple = PySequence_ITEM(res, 0); + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { - op->defaults_kwdict = PySequence_ITEM(res, 1); + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif @@ -27302,7 +29245,15 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; @@ -27318,6 +29269,18 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, @@ -27337,20 +29300,27 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else +#if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif -#if PY_VERSION_HEX < 0x030500A0 +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, @@ -27373,30 +29343,40 @@ static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif if (unlikely(op == NULL)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; +#endif Py_XINCREF(closure); op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; +#endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; @@ -27442,13 +29422,18 @@ static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else @@ -27457,6 +29442,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } +#endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); @@ -27487,14 +29473,20 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); @@ -27518,10 +29510,22 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif Py_ssize_t size; - switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); @@ -27530,24 +29534,43 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif if (likely(size == 0)) return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); +#endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else - arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) @@ -27555,9 +29578,18 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); +#endif return NULL; } break; @@ -27565,12 +29597,28 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); +#endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; @@ -27590,7 +29638,12 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; @@ -27803,7 +29856,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#ifdef _Py_TPFLAGS_HAVE_VECTORCALL +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, @@ -28035,20 +30088,91 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { #include "compile.h" #include "frameobject.h" #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + PyErr_Clear(); + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #endif +} static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } - _PyTraceback_Add(funcname, filename, py_line); + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -28811,8 +30935,32 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(from_bytes); + Py_XDECREF(py_bytes); + Py_XDECREF(order_str); + Py_XDECREF(arg_tuple); + Py_XDECREF(kwds); + return result; +#endif } } @@ -28849,8 +30997,32 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(from_bytes); + Py_XDECREF(py_bytes); + Py_XDECREF(order_str); + Py_XDECREF(arg_tuple); + Py_XDECREF(kwds); + return result; +#endif } } @@ -28863,7 +31035,8 @@ __Pyx_PyType_GetName(PyTypeObject* tp) __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__40)); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__41); } return name; } From c201c7e6b1209f6e4b78f602f24fe2decd4a7091 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Wed, 6 Sep 2023 11:22:18 -0400 Subject: [PATCH 05/14] fix ci errors --- build.py | 23 +++++++++++++++++++++++ src/hssm/likelihoods/blackbox.py | 9 ++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 4b9ca1d7..ecaa445e 100644 --- a/build.py +++ b/build.py @@ -45,3 +45,26 @@ ], ), ] + +setup( + name="hddm-wfpt", + version="0.1.1", + author="Thomas V. Wiecki, Imri Sofer, Michael J. Frank, Mads Lund Pedersen," + + " Alexander Fengler, Lakshmi Govindarajan, Krishn Bera", + author_email="alexander_fengler@brown.com", + url="http://github.com/lncc/hddm-wfpt", + packages=["hddm_wfpt"], # 'hddm.cnn', 'hddm.cnn_models', 'hddm.keras_models', + description="Collects a bunch of cython implementations of basic DDM likelihoods", + install_requires=["NumPy >=1.23.4", "SciPy >= 1.9.1", "cython >= 0.29.32"], + include_dirs=[np.get_include()], + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Operating System :: OS Independent", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", + ], + ext_modules=ext_modules, +) diff --git a/src/hssm/likelihoods/blackbox.py b/src/hssm/likelihoods/blackbox.py index c8c1a7ee..1712c1d7 100644 --- a/src/hssm/likelihoods/blackbox.py +++ b/src/hssm/likelihoods/blackbox.py @@ -2,10 +2,9 @@ from __future__ import annotations +import hddm_wfpt import numpy as np -from .hddm_wfpt import wfpt - def hddm_to_hssm(func): """Make HDDM likelihood function compatible with HSSM.""" @@ -31,7 +30,7 @@ def logp_ddm_bbox(data: np.ndarray, v, a, z, t) -> np.ndarray: size = len(data) zeros = np.zeros(size, dtype=np.float64) - return wfpt.wiener_logp_array( + return hddm_wfpt.wfpt.wiener_logp_array( x=data, v=v, sv=zeros, @@ -50,7 +49,7 @@ def logp_ddm_sdv_bbox(data: np.ndarray, v, a, z, t, sv) -> np.ndarray: size = len(data) zeros = np.zeros(size, dtype=np.float64) - return wfpt.wiener_logp_array( + return hddm_wfpt.wfpt.wiener_logp_array( x=data, v=v, sv=sv, @@ -66,7 +65,7 @@ def logp_ddm_sdv_bbox(data: np.ndarray, v, a, z, t, sv) -> np.ndarray: @hddm_to_hssm def logp_full_ddm(data: np.ndarray, v, a, z, t, sv, sz, st): """Compute blackbox log-likelihoods for full_ddm models.""" - return wfpt.wiener_logp_array( + return hddm_wfpt.wfpt.wiener_logp_array( x=data, v=v, sv=sv, From 195791fb94ef46e8fa41e1af0fac1a17ca384828 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Wed, 6 Sep 2023 12:49:50 -0400 Subject: [PATCH 06/14] fix build.py --- .gitignore | 2 + build.py | 47 +- pyproject.toml | 20 +- src/hssm/likelihoods/blackbox.py | 9 +- .../likelihoods/hddm_wfpt/cdfdif_wrapper.c | 750 +++--- src/hssm/likelihoods/hddm_wfpt/wfpt.cpp | 2001 +++++++++-------- 6 files changed, 1422 insertions(+), 1407 deletions(-) diff --git a/.gitignore b/.gitignore index 4815c96b..c545c0e7 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,5 @@ site/ # folders in the repository /notebooks + +*.so diff --git a/build.py b/build.py index ecaa445e..4dca5390 100644 --- a/build.py +++ b/build.py @@ -1,23 +1,30 @@ # noqa: D100 +import os import platform +import shutil +from distutils.core import Distribution, Extension import numpy as np # noqa -from setuptools import Extension, setup # noqa +from Cython.Build import build_ext, cythonize -try: - from Cython.Build import cythonize +cython_dir = "src/hssm/likelihoods/hddm_wfpt" +try: if platform.system() == "Darwin": ext1 = Extension( "wfpt", ["src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"], language="c++", extra_compile_args=["-stdlib=libc++"], + include_dirs=[np.get_include()], extra_link_args=["-stdlib=libc++", "-mmacosx-version-min=10.9"], ) else: ext1 = Extension( - "wfpt", ["src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"], language="c++" + "wfpt", + ["src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"], + language="c++", + include_dirs=[np.get_include()], ) ext_modules = cythonize( @@ -29,8 +36,10 @@ "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx", "src/hssm/likelihoods/hddm_wfpt/cdfdif.c", ], + include_dirs=[np.get_include()], ), ], + include_path=[cython_dir], compiler_directives={"language_level": "3", "linetrace": True}, ) @@ -46,25 +55,11 @@ ), ] -setup( - name="hddm-wfpt", - version="0.1.1", - author="Thomas V. Wiecki, Imri Sofer, Michael J. Frank, Mads Lund Pedersen," - + " Alexander Fengler, Lakshmi Govindarajan, Krishn Bera", - author_email="alexander_fengler@brown.com", - url="http://github.com/lncc/hddm-wfpt", - packages=["hddm_wfpt"], # 'hddm.cnn', 'hddm.cnn_models', 'hddm.keras_models', - description="Collects a bunch of cython implementations of basic DDM likelihoods", - install_requires=["NumPy >=1.23.4", "SciPy >= 1.9.1", "cython >= 0.29.32"], - include_dirs=[np.get_include()], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Operating System :: OS Independent", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python", - "Topic :: Scientific/Engineering", - ], - ext_modules=ext_modules, -) +dist = Distribution({"ext_modules": ext_modules}) +cmd = build_ext(dist) +cmd.ensure_finalized() +cmd.run() + +for output in cmd.get_outputs(): + relative_extension = os.path.relpath(output, cmd.build_lib) + shutil.copyfile(output, relative_extension) diff --git a/pyproject.toml b/pyproject.toml index e9034fd7..ad3a9a7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,8 @@ keywords = ["HSSM", "sequential sampling models", "bayesian", "bayes", "mcmc"] [tool.poetry.dependencies] python = ">=3.9,<3.12" +pymc = ">=5.6.0,<5.8.0" scipy = "1.10.1" -pymc = "^5.6.0" arviz = "^0.14.0" numpy = "^1.23.4" onnx = "^1.12.0" @@ -161,7 +161,14 @@ ignore = [ "TID252", ] -exclude = [".github", "docs", "notebook", "tests"] +exclude = [ + ".github", + "docs", + "notebook", + "tests", + "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c", + "src/hssm/likelihoods/hddm_wfpt/wfpt.cpp", +] [tool.ruff.pydocstyle] convention = "numpy" @@ -170,14 +177,9 @@ convention = "numpy" ignore_missing_imports = true [tool.poetry.build] +generate-setup-file = false script = "build.py" [build-system] -requires = [ - "poetry-core>=1.4.0", - "setuptools", - "wheel", - "Cython>=0.29.32", - "numpy >= 1.23.4", -] +requires = ["poetry-core", "Cython", "numpy"] build-backend = "poetry.core.masonry.api" diff --git a/src/hssm/likelihoods/blackbox.py b/src/hssm/likelihoods/blackbox.py index 1712c1d7..c8c1a7ee 100644 --- a/src/hssm/likelihoods/blackbox.py +++ b/src/hssm/likelihoods/blackbox.py @@ -2,9 +2,10 @@ from __future__ import annotations -import hddm_wfpt import numpy as np +from .hddm_wfpt import wfpt + def hddm_to_hssm(func): """Make HDDM likelihood function compatible with HSSM.""" @@ -30,7 +31,7 @@ def logp_ddm_bbox(data: np.ndarray, v, a, z, t) -> np.ndarray: size = len(data) zeros = np.zeros(size, dtype=np.float64) - return hddm_wfpt.wfpt.wiener_logp_array( + return wfpt.wiener_logp_array( x=data, v=v, sv=zeros, @@ -49,7 +50,7 @@ def logp_ddm_sdv_bbox(data: np.ndarray, v, a, z, t, sv) -> np.ndarray: size = len(data) zeros = np.zeros(size, dtype=np.float64) - return hddm_wfpt.wfpt.wiener_logp_array( + return wfpt.wiener_logp_array( x=data, v=v, sv=sv, @@ -65,7 +66,7 @@ def logp_ddm_sdv_bbox(data: np.ndarray, v, a, z, t, sv) -> np.ndarray: @hddm_to_hssm def logp_full_ddm(data: np.ndarray, v, a, z, t, sv, sz, st): """Compute blackbox log-likelihoods for full_ddm models.""" - return hddm_wfpt.wfpt.wiener_logp_array( + return wfpt.wiener_logp_array( x=data, v=v, sv=sv, diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c index 700ad7b3..f3f4fb4b 100644 --- a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c +++ b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c @@ -4,10 +4,16 @@ { "distutils": { "depends": [ + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayscalars.h", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ufuncobject.h", "src/hssm/likelihoods/hddm_wfpt/cdfdif.h" ], "include_dirs": [ - "src/hssm/likelihoods/hddm_wfpt" + "src/hssm/likelihoods/hddm_wfpt", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include" ], "name": "cdfdif_wrapper", "sources": [ @@ -1169,7 +1175,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */ - + #include "numpy/arrayobject.h" #include "numpy/ndarrayobject.h" #include "numpy/ndarraytypes.h" @@ -1515,17 +1521,17 @@ typedef struct { /* #### Code section: numeric_typedefs ### */ -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730 * # in Cython to enable them only on the right systems. - * + * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731 + * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< * ctypedef npy_int32 int32_t @@ -1533,7 +1539,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1542,7 +1548,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1551,17 +1557,17 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737 * #ctypedef npy_int128 int128_t - * + * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738 + * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< * ctypedef npy_uint32 uint32_t @@ -1569,7 +1575,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1578,7 +1584,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1587,17 +1593,17 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744 * #ctypedef npy_uint128 uint128_t - * + * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< * ctypedef npy_float64 float64_t * #ctypedef npy_float80 float80_t */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745 + * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< * #ctypedef npy_float80 float80_t @@ -1605,83 +1611,83 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< * ctypedef npy_longlong longlong_t - * + * */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_ulong uint_t */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 * ctypedef npy_longlong longlong_t - * + * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t - * + * */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 + * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 * ctypedef npy_ulonglong ulonglong_t - * + * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< * ctypedef npy_uintp uintp_t - * + * */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 + * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_double float_t */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763 * ctypedef npy_uintp uintp_t - * + * * ctypedef npy_double float_t # <<<<<<<<<<<<<< * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 + * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< * ctypedef npy_longdouble longdouble_t - * + * */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cfloat cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; @@ -1714,38 +1720,38 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 * ctypedef npy_longdouble longdouble_t - * + * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 + * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< * ctypedef npy_clongdouble clongdouble_t - * + * */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cdouble complex_t */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 * ctypedef npy_clongdouble clongdouble_t - * + * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew1(a): */ typedef npy_cdouble __pyx_t_5numpy_complex_t; @@ -3294,8 +3300,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 /* #### Code section: module_code ### */ -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 + * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< * """Returns a borrowed reference to the object owning the data/memory. @@ -3313,19 +3319,19 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject #endif __Pyx_TraceCall("base", __pyx_f[1], 245, 1, __PYX_ERR(1, 245, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248 * """Returns a borrowed reference to the object owning the data/memory. * """ * return PyArray_BASE(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(248,1,__PYX_ERR(1, 248, __pyx_L1_error)) __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 + * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< * """Returns a borrowed reference to the object owning the data/memory. @@ -3347,8 +3353,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 + * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< * """Returns an owned reference to the dtype of the array. @@ -3366,11 +3372,11 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __Pyx_RefNannySetupContext("descr", 0); __Pyx_TraceCall("descr", __pyx_f[1], 251, 0, __PYX_ERR(1, 251, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254 * """Returns an owned reference to the dtype of the array. * """ * return PyArray_DESCR(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error)) @@ -3380,8 +3386,8 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 + * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< * """Returns an owned reference to the dtype of the array. @@ -3399,8 +3405,8 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 + * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< * """Returns the number of dimensions in the array. @@ -3418,19 +3424,19 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx #endif __Pyx_TraceCall("ndim", __pyx_f[1], 257, 1, __PYX_ERR(1, 257, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260 * """Returns the number of dimensions in the array. * """ * return PyArray_NDIM(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(260,1,__PYX_ERR(1, 260, __pyx_L1_error)) __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 + * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< * """Returns the number of dimensions in the array. @@ -3452,8 +3458,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 + * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the dimensions/shape of the array. @@ -3471,19 +3477,19 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec #endif __Pyx_TraceCall("shape", __pyx_f[1], 263, 1, __PYX_ERR(1, 263, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268 * Can return NULL for 0-dimensional arrays. * """ * return PyArray_DIMS(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(268,1,__PYX_ERR(1, 268, __pyx_L1_error)) __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 + * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the dimensions/shape of the array. @@ -3505,8 +3511,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 + * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the strides of the array. @@ -3524,19 +3530,19 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO #endif __Pyx_TraceCall("strides", __pyx_f[1], 271, 1, __PYX_ERR(1, 271, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275 * The number of elements matches the number of dimensions of the array (ndim). * """ * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(275,1,__PYX_ERR(1, 275, __pyx_L1_error)) __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 + * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the strides of the array. @@ -3558,8 +3564,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 + * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< * """Returns the total size (in number of elements) of the array. @@ -3577,19 +3583,19 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * #endif __Pyx_TraceCall("size", __pyx_f[1], 278, 1, __PYX_ERR(1, 278, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281 * """Returns the total size (in number of elements) of the array. * """ * return PyArray_SIZE(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(281,1,__PYX_ERR(1, 281, __pyx_L1_error)) __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 + * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< * """Returns the total size (in number of elements) of the array. @@ -3611,8 +3617,8 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 + * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< * """The pointer to the data buffer as a char*. @@ -3630,19 +3636,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p #endif __Pyx_TraceCall("data", __pyx_f[1], 284, 1, __PYX_ERR(1, 284, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290 * of `PyArray_DATA()` instead, which returns a 'void*'. * """ * return PyArray_BYTES(self) # <<<<<<<<<<<<<< - * + * * ctypedef unsigned char npy_bool */ __Pyx_TraceLine(290,1,__PYX_ERR(1, 290, __pyx_L1_error)) __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 + * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< * """The pointer to the data buffer as a char*. @@ -3664,12 +3670,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { @@ -3683,11 +3689,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[1], 773, 0, __PYX_ERR(1, 773, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774 + * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error)) @@ -3698,12 +3704,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ /* function exit code */ @@ -3718,12 +3724,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { @@ -3737,11 +3743,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[1], 776, 0, __PYX_ERR(1, 776, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 + * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error)) @@ -3752,12 +3758,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ /* function exit code */ @@ -3772,12 +3778,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { @@ -3791,11 +3797,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[1], 779, 0, __PYX_ERR(1, 779, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 + * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error)) @@ -3806,12 +3812,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ /* function exit code */ @@ -3826,12 +3832,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ 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) { @@ -3845,11 +3851,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[1], 782, 0, __PYX_ERR(1, 782, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error)) @@ -3860,12 +3866,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ /* function exit code */ @@ -3880,12 +3886,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ 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) { @@ -3899,11 +3905,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[1], 785, 0, __PYX_ERR(1, 785, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_TraceLine(786,0,__PYX_ERR(1, 786, __pyx_L1_error)) @@ -3914,12 +3920,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ /* function exit code */ @@ -3934,9 +3940,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -3953,8 +3959,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[1], 788, 0, __PYX_ERR(1, 788, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -3964,7 +3970,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -3977,8 +3983,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -3986,12 +3992,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(792,0,__PYX_ERR(1, 792, __pyx_L1_error)) /*else*/ { @@ -4001,9 +4007,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -4020,9 +4026,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -4038,29 +4044,29 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannySetupContext("set_array_base", 0); __Pyx_TraceCall("set_array_base", __pyx_f[1], 967, 0, __PYX_ERR(1, 967, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968 + * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< * PyArray_SetBaseObject(arr, base) - * + * */ __Pyx_TraceLine(968,0,__PYX_ERR(1, 968, __pyx_L1_error)) Py_INCREF(__pyx_v_base); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< - * + * * cdef inline object get_array_base(ndarray arr): */ __Pyx_TraceLine(969,0,__PYX_ERR(1, 969, __pyx_L1_error)) __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -4075,9 +4081,9 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -4095,8 +4101,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannySetupContext("get_array_base", 0); __Pyx_TraceCall("get_array_base", __pyx_f[1], 971, 0, __PYX_ERR(1, 971, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972 + * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< * if base is NULL: @@ -4105,7 +4111,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_TraceLine(972,0,__PYX_ERR(1, 972, __pyx_L1_error)) __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4116,19 +4122,19 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< * return base - * + * */ __Pyx_TraceLine(974,0,__PYX_ERR(1, 974, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4137,11 +4143,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< - * + * * # Versions of the import_* functions which are more suitable for */ __Pyx_TraceLine(975,0,__PYX_ERR(1, 975, __pyx_L1_error)) @@ -4150,9 +4156,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -4169,7 +4175,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4195,7 +4201,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_RefNannySetupContext("import_array", 0); __Pyx_TraceCall("import_array", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4212,7 +4218,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -4222,7 +4228,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L3_error)) __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4236,12 +4242,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< * raise ImportError("numpy.core.multiarray failed to import") - * + * */ __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L5_except_error)) __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); @@ -4252,11 +4258,11 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_umath() except -1: */ __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L5_except_error)) @@ -4268,7 +4274,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { } goto __pyx_L5_except_error; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4284,7 +4290,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4308,9 +4314,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -4334,8 +4340,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_RefNannySetupContext("import_umath", 0); __Pyx_TraceCall("import_umath", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4351,7 +4357,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4361,8 +4367,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L3_error)) __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4375,12 +4381,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< * raise ImportError("numpy.core.umath failed to import") - * + * */ __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L5_except_error)) __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); @@ -4391,11 +4397,11 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_ufunc() except -1: */ __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L5_except_error)) @@ -4407,8 +4413,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { } goto __pyx_L5_except_error; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4423,9 +4429,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -4447,9 +4453,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -4473,8 +4479,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_RefNannySetupContext("import_ufunc", 0); __Pyx_TraceCall("import_ufunc", __pyx_f[1], 991, 0, __PYX_ERR(1, 991, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4490,7 +4496,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4500,8 +4506,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L3_error)) __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4514,12 +4520,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< * raise ImportError("numpy.core.umath failed to import") - * + * */ __Pyx_TraceLine(994,0,__PYX_ERR(1, 994, __pyx_L5_except_error)) __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); @@ -4530,12 +4536,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L5_except_error)) __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) @@ -4546,8 +4552,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { } goto __pyx_L5_except_error; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4562,9 +4568,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -4586,9 +4592,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -4604,20 +4610,20 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannySetupContext("is_timedelta64_object", 0); __Pyx_TraceCall("is_timedelta64_object", __pyx_f[1], 998, 0, __PYX_ERR(1, 998, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error)) __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -4633,9 +4639,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -4651,20 +4657,20 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannySetupContext("is_datetime64_object", 0); __Pyx_TraceCall("is_datetime64_object", __pyx_f[1], 1013, 0, __PYX_ERR(1, 1013, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error)) __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -4680,9 +4686,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -4699,20 +4705,20 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * #endif __Pyx_TraceCall("get_datetime64_value", __pyx_f[1], 1028, 1, __PYX_ERR(1, 1028, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(1035,1,__PYX_ERR(1, 1035, __pyx_L1_error)) __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -4733,9 +4739,9 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -4752,20 +4758,20 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject #endif __Pyx_TraceCall("get_timedelta64_value", __pyx_f[1], 1038, 1, __PYX_ERR(1, 1038, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1042 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(1042,1,__PYX_ERR(1, 1042, __pyx_L1_error)) __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -4786,9 +4792,9 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -4805,7 +4811,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec #endif __Pyx_TraceCall("get_datetime64_unit", __pyx_f[1], 1045, 1, __PYX_ERR(1, 1045, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1049 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -4814,9 +4820,9 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -4839,10 +4845,10 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec /* "cdfdif_wrapper.pyx":11 * double fabs(double) - * + * * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * + * */ static CYTHON_INLINE double __pyx_f_14cdfdif_wrapper_add_outlier_cdf(double __pyx_v_y, double __pyx_v_x, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { @@ -4857,10 +4863,10 @@ static CYTHON_INLINE double __pyx_f_14cdfdif_wrapper_add_outlier_cdf(double __py __Pyx_TraceCall("add_outlier_cdf", __pyx_f[0], 11, 0, __PYX_ERR(0, 11, __pyx_L1_error)); /* "cdfdif_wrapper.pyx":12 - * + * * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier # <<<<<<<<<<<<<< - * + * * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) */ __Pyx_TraceLine(12,0,__PYX_ERR(0, 12, __pyx_L1_error)) @@ -4874,10 +4880,10 @@ static CYTHON_INLINE double __pyx_f_14cdfdif_wrapper_add_outlier_cdf(double __py /* "cdfdif_wrapper.pyx":11 * double fabs(double) - * + * * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * + * */ /* function exit code */ @@ -4892,9 +4898,9 @@ static CYTHON_INLINE double __pyx_f_14cdfdif_wrapper_add_outlier_cdf(double __py /* "cdfdif_wrapper.pyx":14 * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * + * * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< - * + * * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, */ @@ -4922,14 +4928,14 @@ static CYTHON_INLINE int __pyx_f_14cdfdif_wrapper_p_outlier_in_range(double __py /* "cdfdif_wrapper.pyx":16 * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - * + * * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - * + * */ /* Python wrapper */ -static PyObject *__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array(PyObject *__pyx_self, +static PyObject *__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -4937,7 +4943,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_14cdfdif_wrapper_1dmat_cdf_array = {"dmat_cdf_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array(PyObject *__pyx_self, +static PyObject *__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -5217,11 +5223,11 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; /* "cdfdif_wrapper.pyx":20 - * + * * #check arguments * if p_outlier > 0: # <<<<<<<<<<<<<< * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * + * */ __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_p_outlier > 0.0); @@ -5231,7 +5237,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject * #check arguments * if p_outlier > 0: * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') # <<<<<<<<<<<<<< - * + * * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ */ __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error)) @@ -5320,17 +5326,17 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject #endif /* "cdfdif_wrapper.pyx":20 - * + * * #check arguments * if p_outlier > 0: # <<<<<<<<<<<<<< * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * + * */ } /* "cdfdif_wrapper.pyx":23 * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * + * * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError("at least one of the parameters is out of the support") @@ -5380,11 +5386,11 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject } /* "cdfdif_wrapper.pyx":24 - * + * * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * raise ValueError("at least one of the parameters is out of the support") - * + * */ __Pyx_TraceLine(24,0,__PYX_ERR(0, 24, __pyx_L1_error)) __pyx_t_9 = ((__pyx_v_z - (__pyx_v_sz / 2.)) < 0.0); @@ -5418,7 +5424,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject /* "cdfdif_wrapper.pyx":23 * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * + * * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError("at least one of the parameters is out of the support") @@ -5430,8 +5436,8 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError("at least one of the parameters is out of the support") # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(25,0,__PYX_ERR(0, 25, __pyx_L1_error)) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) @@ -5442,7 +5448,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject /* "cdfdif_wrapper.pyx":23 * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * + * * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError("at least one of the parameters is out of the support") @@ -5450,8 +5456,8 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject } /* "cdfdif_wrapper.pyx":28 - * - * + * + * * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim=1] y = np.empty(size, dtype=np.double) * cdef int boundary @@ -5461,7 +5467,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __pyx_v_size = (__pyx_t_11[0]); /* "cdfdif_wrapper.pyx":29 - * + * * cdef Py_ssize_t size = x.shape[0] * cdef np.ndarray[double, ndim=1] y = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< * cdef int boundary @@ -5512,14 +5518,14 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject * cdef double p_boundary * cdef double params[7] * cdef double epsi = 1e-10 # <<<<<<<<<<<<<< - * + * * #transform parameters */ __Pyx_TraceLine(33,0,__PYX_ERR(0, 33, __pyx_L1_error)) __pyx_v_epsi = 1e-10; /* "cdfdif_wrapper.pyx":36 - * + * * #transform parameters * params[0] = a/10. # <<<<<<<<<<<<<< * params[1] = t @@ -5573,7 +5579,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject * params[4] = sz*(a/10.) + epsi * params[5] = st + epsi # <<<<<<<<<<<<<< * params[6] = v/10. - * + * */ __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error)) (__pyx_v_params[5]) = (__pyx_v_st + __pyx_v_epsi); @@ -5582,15 +5588,15 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject * params[4] = sz*(a/10.) + epsi * params[5] = st + epsi * params[6] = v/10. # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error)) (__pyx_v_params[6]) = (__pyx_v_v / 10.); /* "cdfdif_wrapper.pyx":45 - * - * + * + * * for i in range(size): # <<<<<<<<<<<<<< * boundary = (int) (x[i] > 0) * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) @@ -5602,7 +5608,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject __pyx_v_i = __pyx_t_15; /* "cdfdif_wrapper.pyx":46 - * + * * for i in range(size): * boundary = (int) (x[i] > 0) # <<<<<<<<<<<<<< * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) @@ -5626,7 +5632,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject * boundary = (int) (x[i] > 0) * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) # <<<<<<<<<<<<<< * y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] - * + * */ __Pyx_TraceLine(47,0,__PYX_ERR(0, 47, __pyx_L1_error)) __pyx_t_16 = __pyx_v_i; @@ -5655,7 +5661,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject * boundary = (int) (x[i] > 0) * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) * y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] # <<<<<<<<<<<<<< - * + * * #add p_outlier probability */ __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error)) @@ -5736,10 +5742,10 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_8; /* "cdfdif_wrapper.pyx":51 - * + * * #add p_outlier probability * y[i] = add_outlier_cdf(y[i], x[i], p_outlier, w_outlier) # <<<<<<<<<<<<<< - * + * * return y */ __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error)) @@ -5779,7 +5785,7 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject /* "cdfdif_wrapper.pyx":53 * y[i] = add_outlier_cdf(y[i], x[i], p_outlier, w_outlier) - * + * * return y # <<<<<<<<<<<<<< */ __Pyx_TraceLine(53,0,__PYX_ERR(0, 53, __pyx_L1_error)) @@ -5790,10 +5796,10 @@ static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject /* "cdfdif_wrapper.pyx":16 * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - * + * * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - * + * */ /* function exit code */ @@ -5907,22 +5913,22 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_umath() except -1: */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_ufunc() except -1: */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 989, __pyx_L1_error) @@ -5933,7 +5939,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * #check arguments * if p_outlier > 0: * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') # <<<<<<<<<<<<<< - * + * * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_1_2_w_outlier_must_be_smaller_th); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 21, __pyx_L1_error) @@ -5944,8 +5950,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError("at least one of the parameters is out of the support") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_at_least_one_of_the_parameters_i); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); @@ -5953,10 +5959,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "cdfdif_wrapper.pyx":16 * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - * + * * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - * + * */ __pyx_tuple__7 = PyTuple_Pack(17, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_y, __pyx_n_s_boundary, __pyx_n_s_p_boundary, __pyx_n_s_params, __pyx_n_s_epsi, __pyx_n_s_i); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); @@ -6059,7 +6065,7 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API @@ -6393,8 +6399,8 @@ if (!__Pyx_RefNanny) { #endif __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void)", __pyx_f[0], 2, 0, __PYX_ERR(0, 2, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 + * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< * """Returns a borrowed reference to the object owning the data/memory. @@ -6403,8 +6409,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 + * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< * """Returns an owned reference to the dtype of the array. @@ -6413,8 +6419,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 + * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< * """Returns the number of dimensions in the array. @@ -6423,8 +6429,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(257,0,__PYX_ERR(1, 257, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 + * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the dimensions/shape of the array. @@ -6433,8 +6439,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(263,0,__PYX_ERR(1, 263, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 + * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the strides of the array. @@ -6443,8 +6449,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(271,0,__PYX_ERR(1, 271, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 + * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< * """Returns the total size (in number of elements) of the array. @@ -6453,8 +6459,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(278,0,__PYX_ERR(1, 278, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 + * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< * """The pointer to the data buffer as a char*. @@ -6463,59 +6469,59 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ __Pyx_TraceLine(773,0,__PYX_ERR(1, 773, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -6523,9 +6529,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(788,0,__PYX_ERR(1, 788, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -6533,9 +6539,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(967,0,__PYX_ERR(1, 967, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -6543,7 +6549,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(971,0,__PYX_ERR(1, 971, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -6553,9 +6559,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -6563,9 +6569,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -6573,9 +6579,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -6583,9 +6589,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(998,0,__PYX_ERR(1, 998, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -6593,9 +6599,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -6603,9 +6609,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -6613,9 +6619,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -6624,10 +6630,10 @@ if (!__Pyx_RefNanny) { /* "cdfdif_wrapper.pyx":3 - * + * * cimport numpy as np * import numpy as np # <<<<<<<<<<<<<< - * + * * cdef extern from "cdfdif.h": */ __Pyx_TraceLine(3,0,__PYX_ERR(0, 3, __pyx_L1_error)) @@ -6638,19 +6644,19 @@ if (!__Pyx_RefNanny) { /* "cdfdif_wrapper.pyx":11 * double fabs(double) - * + * * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * + * */ __Pyx_TraceLine(11,0,__PYX_ERR(0, 11, __pyx_L1_error)) /* "cdfdif_wrapper.pyx":14 * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * + * * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< - * + * * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, */ __Pyx_TraceLine(14,0,__PYX_ERR(0, 14, __pyx_L1_error)) @@ -6658,10 +6664,10 @@ if (!__Pyx_RefNanny) { /* "cdfdif_wrapper.pyx":16 * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - * + * * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - * + * */ __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error)) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14cdfdif_wrapper_1dmat_cdf_array, 0, __pyx_n_s_dmat_cdf_array, NULL, __pyx_n_s_cdfdif_wrapper, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) @@ -6670,10 +6676,10 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cdfdif_wrapper.pyx":2 - * + * * cimport numpy as np # <<<<<<<<<<<<<< * import numpy as np - * + * */ __Pyx_TraceLine(2,0,__PYX_ERR(0, 2, __pyx_L1_error)) __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) diff --git a/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp b/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp index e988ab46..26aa1ba7 100644 --- a/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp +++ b/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp @@ -3,7 +3,13 @@ /* BEGIN: Cython Metadata { "distutils": { - "depends": [], + "depends": [ + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayscalars.h", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h", + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ufuncobject.h" + ], "extra_compile_args": [ "-stdlib=libc++" ], @@ -11,6 +17,9 @@ "-stdlib=libc++", "-mmacosx-version-min=10.9" ], + "include_dirs": [ + "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include" + ], "language": "c++", "name": "wfpt", "sources": [ @@ -1183,7 +1192,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */ - + #include "numpy/arrayobject.h" #include "numpy/ndarrayobject.h" #include "numpy/ndarraytypes.h" @@ -1531,17 +1540,17 @@ typedef struct { /* #### Code section: numeric_typedefs ### */ -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730 * # in Cython to enable them only on the right systems. - * + * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731 + * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< * ctypedef npy_int32 int32_t @@ -1549,7 +1558,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1558,7 +1567,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1567,17 +1576,17 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737 * #ctypedef npy_int128 int128_t - * + * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738 + * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< * ctypedef npy_uint32 uint32_t @@ -1585,7 +1594,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1594,7 +1603,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1603,17 +1612,17 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744 * #ctypedef npy_uint128 uint128_t - * + * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< * ctypedef npy_float64 float64_t * #ctypedef npy_float80 float80_t */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745 + * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< * #ctypedef npy_float80 float80_t @@ -1621,83 +1630,83 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< * ctypedef npy_longlong longlong_t - * + * */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_ulong uint_t */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 * ctypedef npy_longlong longlong_t - * + * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t - * + * */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 + * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 * ctypedef npy_ulonglong ulonglong_t - * + * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< * ctypedef npy_uintp uintp_t - * + * */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 + * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_double float_t */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763 * ctypedef npy_uintp uintp_t - * + * * ctypedef npy_double float_t # <<<<<<<<<<<<<< * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 + * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< * ctypedef npy_longdouble longdouble_t - * + * */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cfloat cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; @@ -1730,38 +1739,38 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 * ctypedef npy_longdouble longdouble_t - * + * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 + * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< * ctypedef npy_clongdouble clongdouble_t - * + * */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cdouble complex_t */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 * ctypedef npy_clongdouble clongdouble_t - * + * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew1(a): */ typedef npy_cdouble __pyx_t_5numpy_complex_t; @@ -1769,7 +1778,7 @@ struct __pyx_opt_args_4wfpt_full_pdf; /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * + * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< * z, double sz, double t, double st, double err, int * n_st=2, int n_sz=2, bint use_adaptive=1, double @@ -4074,8 +4083,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 /* #### Code section: module_code ### */ -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 + * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< * """Returns a borrowed reference to the object owning the data/memory. @@ -4093,19 +4102,19 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject #endif __Pyx_TraceCall("base", __pyx_f[1], 245, 1, __PYX_ERR(1, 245, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248 * """Returns a borrowed reference to the object owning the data/memory. * """ * return PyArray_BASE(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(248,1,__PYX_ERR(1, 248, __pyx_L1_error)) __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 + * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< * """Returns a borrowed reference to the object owning the data/memory. @@ -4127,8 +4136,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 + * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< * """Returns an owned reference to the dtype of the array. @@ -4146,11 +4155,11 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __Pyx_RefNannySetupContext("descr", 0); __Pyx_TraceCall("descr", __pyx_f[1], 251, 0, __PYX_ERR(1, 251, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254 * """Returns an owned reference to the dtype of the array. * """ * return PyArray_DESCR(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error)) @@ -4160,8 +4169,8 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 + * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< * """Returns an owned reference to the dtype of the array. @@ -4179,8 +4188,8 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 + * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< * """Returns the number of dimensions in the array. @@ -4198,19 +4207,19 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx #endif __Pyx_TraceCall("ndim", __pyx_f[1], 257, 1, __PYX_ERR(1, 257, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260 * """Returns the number of dimensions in the array. * """ * return PyArray_NDIM(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(260,1,__PYX_ERR(1, 260, __pyx_L1_error)) __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 + * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< * """Returns the number of dimensions in the array. @@ -4232,8 +4241,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 + * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the dimensions/shape of the array. @@ -4251,19 +4260,19 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec #endif __Pyx_TraceCall("shape", __pyx_f[1], 263, 1, __PYX_ERR(1, 263, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268 * Can return NULL for 0-dimensional arrays. * """ * return PyArray_DIMS(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(268,1,__PYX_ERR(1, 268, __pyx_L1_error)) __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 + * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the dimensions/shape of the array. @@ -4285,8 +4294,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 + * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the strides of the array. @@ -4304,19 +4313,19 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO #endif __Pyx_TraceCall("strides", __pyx_f[1], 271, 1, __PYX_ERR(1, 271, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275 * The number of elements matches the number of dimensions of the array (ndim). * """ * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(275,1,__PYX_ERR(1, 275, __pyx_L1_error)) __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 + * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the strides of the array. @@ -4338,8 +4347,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 + * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< * """Returns the total size (in number of elements) of the array. @@ -4357,19 +4366,19 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * #endif __Pyx_TraceCall("size", __pyx_f[1], 278, 1, __PYX_ERR(1, 278, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281 * """Returns the total size (in number of elements) of the array. * """ * return PyArray_SIZE(self) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_TraceLine(281,1,__PYX_ERR(1, 281, __pyx_L1_error)) __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 + * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< * """Returns the total size (in number of elements) of the array. @@ -4391,8 +4400,8 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 + * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< * """The pointer to the data buffer as a char*. @@ -4410,19 +4419,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p #endif __Pyx_TraceCall("data", __pyx_f[1], 284, 1, __PYX_ERR(1, 284, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290 * of `PyArray_DATA()` instead, which returns a 'void*'. * """ * return PyArray_BYTES(self) # <<<<<<<<<<<<<< - * + * * ctypedef unsigned char npy_bool */ __Pyx_TraceLine(290,1,__PYX_ERR(1, 290, __pyx_L1_error)) __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 + * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< * """The pointer to the data buffer as a char*. @@ -4444,12 +4453,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { @@ -4463,11 +4472,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[1], 773, 0, __PYX_ERR(1, 773, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774 + * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error)) @@ -4478,12 +4487,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ /* function exit code */ @@ -4498,12 +4507,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { @@ -4517,11 +4526,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[1], 776, 0, __PYX_ERR(1, 776, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 + * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error)) @@ -4532,12 +4541,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ /* function exit code */ @@ -4552,12 +4561,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { @@ -4571,11 +4580,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[1], 779, 0, __PYX_ERR(1, 779, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 + * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error)) @@ -4586,12 +4595,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ /* function exit code */ @@ -4606,12 +4615,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ 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) { @@ -4625,11 +4634,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[1], 782, 0, __PYX_ERR(1, 782, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error)) @@ -4640,12 +4649,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ /* function exit code */ @@ -4660,12 +4669,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ 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) { @@ -4679,11 +4688,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[1], 785, 0, __PYX_ERR(1, 785, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_TraceLine(786,0,__PYX_ERR(1, 786, __pyx_L1_error)) @@ -4694,12 +4703,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ /* function exit code */ @@ -4714,9 +4723,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -4733,8 +4742,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[1], 788, 0, __PYX_ERR(1, 788, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -4744,7 +4753,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -4757,8 +4766,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -4766,12 +4775,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(792,0,__PYX_ERR(1, 792, __pyx_L1_error)) /*else*/ { @@ -4781,9 +4790,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -4800,9 +4809,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -4818,29 +4827,29 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannySetupContext("set_array_base", 0); __Pyx_TraceCall("set_array_base", __pyx_f[1], 967, 0, __PYX_ERR(1, 967, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968 + * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< * PyArray_SetBaseObject(arr, base) - * + * */ __Pyx_TraceLine(968,0,__PYX_ERR(1, 968, __pyx_L1_error)) Py_INCREF(__pyx_v_base); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< - * + * * cdef inline object get_array_base(ndarray arr): */ __Pyx_TraceLine(969,0,__PYX_ERR(1, 969, __pyx_L1_error)) __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -4855,9 +4864,9 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -4875,8 +4884,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannySetupContext("get_array_base", 0); __Pyx_TraceCall("get_array_base", __pyx_f[1], 971, 0, __PYX_ERR(1, 971, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972 + * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< * if base is NULL: @@ -4885,7 +4894,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_TraceLine(972,0,__PYX_ERR(1, 972, __pyx_L1_error)) __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4896,19 +4905,19 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< * return base - * + * */ __Pyx_TraceLine(974,0,__PYX_ERR(1, 974, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4917,11 +4926,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< - * + * * # Versions of the import_* functions which are more suitable for */ __Pyx_TraceLine(975,0,__PYX_ERR(1, 975, __pyx_L1_error)) @@ -4930,9 +4939,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -4949,7 +4958,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4975,7 +4984,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_RefNannySetupContext("import_array", 0); __Pyx_TraceCall("import_array", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4992,7 +5001,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -5002,7 +5011,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L3_error)) __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -5016,12 +5025,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< * raise ImportError("numpy.core.multiarray failed to import") - * + * */ __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L5_except_error)) __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); @@ -5032,11 +5041,11 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_umath() except -1: */ __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L5_except_error)) @@ -5048,7 +5057,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { } goto __pyx_L5_except_error; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -5064,7 +5073,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -5088,9 +5097,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -5114,8 +5123,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_RefNannySetupContext("import_umath", 0); __Pyx_TraceCall("import_umath", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -5131,7 +5140,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -5141,8 +5150,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L3_error)) __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -5155,12 +5164,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< * raise ImportError("numpy.core.umath failed to import") - * + * */ __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L5_except_error)) __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); @@ -5171,11 +5180,11 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_ufunc() except -1: */ __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L5_except_error)) @@ -5187,8 +5196,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { } goto __pyx_L5_except_error; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -5203,9 +5212,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -5227,9 +5236,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -5253,8 +5262,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_RefNannySetupContext("import_ufunc", 0); __Pyx_TraceCall("import_ufunc", __pyx_f[1], 991, 0, __PYX_ERR(1, 991, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -5270,7 +5279,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -5280,8 +5289,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L3_error)) __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -5294,12 +5303,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< * raise ImportError("numpy.core.umath failed to import") - * + * */ __Pyx_TraceLine(994,0,__PYX_ERR(1, 994, __pyx_L5_except_error)) __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); @@ -5310,12 +5319,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L5_except_error)) __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) @@ -5326,8 +5335,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { } goto __pyx_L5_except_error; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -5342,9 +5351,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -5366,9 +5375,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -5384,20 +5393,20 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannySetupContext("is_timedelta64_object", 0); __Pyx_TraceCall("is_timedelta64_object", __pyx_f[1], 998, 0, __PYX_ERR(1, 998, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error)) __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -5413,9 +5422,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -5431,20 +5440,20 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannySetupContext("is_datetime64_object", 0); __Pyx_TraceCall("is_datetime64_object", __pyx_f[1], 1013, 0, __PYX_ERR(1, 1013, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error)) __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -5460,9 +5469,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -5479,20 +5488,20 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * #endif __Pyx_TraceCall("get_datetime64_value", __pyx_f[1], 1028, 1, __PYX_ERR(1, 1028, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(1035,1,__PYX_ERR(1, 1035, __pyx_L1_error)) __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -5513,9 +5522,9 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -5532,20 +5541,20 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject #endif __Pyx_TraceCall("get_timedelta64_value", __pyx_f[1], 1038, 1, __PYX_ERR(1, 1038, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1042 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(1042,1,__PYX_ERR(1, 1042, __pyx_L1_error)) __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -5566,9 +5575,9 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * +/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -5585,7 +5594,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec #endif __Pyx_TraceCall("get_datetime64_unit", __pyx_f[1], 1045, 1, __PYX_ERR(1, 1045, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1049 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -5594,9 +5603,9 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -5619,7 +5628,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 * T max[T](T a, T b) - * + * * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method * and implementation of Navarro & Fuss, 2009. @@ -5646,7 +5655,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __Pyx_TraceCall("ftt_01w", __pyx_f[2], 28, 1, __PYX_ERR(2, 28, __pyx_L1_error)); /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":36 - * + * * # calculate number of terms needed for large t * if M_PI*tt*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound @@ -5677,7 +5686,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_v_kl = std::max(__pyx_v_kl, (1. / (M_PI * sqrt(__pyx_v_tt)))); /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":36 - * + * * # calculate number of terms needed for large t * if M_PI*tt*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound @@ -5690,7 +5699,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met * else: # if error threshold set too high * kl=1./(M_PI*sqrt(tt)) # set to boundary condition # <<<<<<<<<<<<<< - * + * * # calculate number of terms needed for small t */ __Pyx_TraceLine(40,1,__PYX_ERR(2, 40, __pyx_L1_error)) @@ -5700,7 +5709,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_L3:; /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":43 - * + * * # calculate number of terms needed for small t * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound @@ -5731,7 +5740,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_v_ks = std::max(__pyx_v_ks, (sqrt(__pyx_v_tt) + 1.0)); /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":43 - * + * * # calculate number of terms needed for small t * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound @@ -5744,7 +5753,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met * else: # if error threshold was set too high * ks=2 # minimal kappa for that case # <<<<<<<<<<<<<< - * + * * # compute f(tt|0,1,w) */ __Pyx_TraceLine(47,1,__PYX_ERR(2, 47, __pyx_L1_error)) @@ -5754,7 +5763,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_L4:; /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":50 - * + * * # compute f(tt|0,1,w) * p=0 #initialize density # <<<<<<<<<<<<<< * if ks(ceil(kl)) # round to smallest integer meeting error # <<<<<<<<<<<<<< * for k from 1 <= k <= K: @@ -5873,7 +5882,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double * for k from 1 <= k <= K: * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum # <<<<<<<<<<<<<< * p*=M_PI # add con_stant term - * + * */ __Pyx_TraceLine(62,1,__PYX_ERR(2, 62, __pyx_L1_error)) __pyx_v_p = (__pyx_v_p + ((__pyx_v_k * exp(((((-pow(__pyx_v_k, 2.0)) * pow(M_PI, 2.0)) * __pyx_v_tt) / 2.0))) * sin(((__pyx_v_k * M_PI) * __pyx_v_w)))); @@ -5883,7 +5892,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double * for k from 1 <= k <= K: * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum * p*=M_PI # add con_stant term # <<<<<<<<<<<<<< - * + * * return p */ __Pyx_TraceLine(63,1,__PYX_ERR(2, 63, __pyx_L1_error)) @@ -5893,9 +5902,9 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":65 * p*=M_PI # add con_stant term - * + * * return p # <<<<<<<<<<<<<< - * + * * cdef inline double prob_ub(double v, double a, double z) nogil: */ __Pyx_TraceLine(65,1,__PYX_ERR(2, 65, __pyx_L1_error)) @@ -5904,7 +5913,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 * T max[T](T a, T b) - * + * * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method * and implementation of Navarro & Fuss, 2009. @@ -5927,7 +5936,7 @@ static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 * return p - * + * * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< * """Probability of hitting upper boundary.""" * if v == 0: @@ -5980,7 +5989,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx * return z * else: * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) # <<<<<<<<<<<<<< - * + * * cdef double pdf(double x, double v, double a, double w, double err) nogil: */ __Pyx_TraceLine(72,1,__PYX_ERR(2, 72, __pyx_L1_error)) @@ -5991,7 +6000,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 * return p - * + * * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< * """Probability of hitting upper boundary.""" * if v == 0: @@ -6014,7 +6023,7 @@ static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) - * + * * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method * and implementation of Navarro & Fuss, 2009. @@ -6042,7 +6051,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx * """ * if x <= 0: # <<<<<<<<<<<<<< * return 0 - * + * */ __Pyx_TraceLine(78,1,__PYX_ERR(2, 78, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_x <= 0.0); @@ -6052,7 +6061,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx * """ * if x <= 0: * return 0 # <<<<<<<<<<<<<< - * + * * cdef double tt = x/a**2 # use normalized time */ __Pyx_TraceLine(79,1,__PYX_ERR(2, 79, __pyx_L1_error)) @@ -6064,25 +6073,25 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx * """ * if x <= 0: # <<<<<<<<<<<<<< * return 0 - * + * */ } /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":81 * return 0 - * + * * cdef double tt = x/a**2 # use normalized time # <<<<<<<<<<<<<< * cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) - * + * */ __Pyx_TraceLine(81,1,__PYX_ERR(2, 81, __pyx_L1_error)) __pyx_v_tt = (__pyx_v_x / pow(__pyx_v_a, 2.0)); /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":82 - * + * * cdef double tt = x/a**2 # use normalized time * cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) # <<<<<<<<<<<<<< - * + * * # convert to f(t|v,a,w) */ __Pyx_TraceLine(82,1,__PYX_ERR(2, 82, __pyx_L1_error)) @@ -6090,10 +6099,10 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx __pyx_v_p = __pyx_t_2; /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":85 - * + * * # convert to f(t|v,a,w) * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) # <<<<<<<<<<<<<< - * + * * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: */ __Pyx_TraceLine(85,1,__PYX_ERR(2, 85, __pyx_L1_error)) @@ -6102,7 +6111,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) - * + * * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method * and implementation of Navarro & Fuss, 2009. @@ -6126,7 +6135,7 @@ static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) - * + * * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method * and implementation of Navarro & Fuss, 2009. @@ -6154,7 +6163,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ * """ * if x <= 0: # <<<<<<<<<<<<<< * return 0 - * + * */ __Pyx_TraceLine(92,1,__PYX_ERR(2, 92, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_x <= 0.0); @@ -6164,7 +6173,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ * """ * if x <= 0: * return 0 # <<<<<<<<<<<<<< - * + * * if sv==0: */ __Pyx_TraceLine(93,1,__PYX_ERR(2, 93, __pyx_L1_error)) @@ -6176,26 +6185,26 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ * """ * if x <= 0: # <<<<<<<<<<<<<< * return 0 - * + * */ } /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":95 * return 0 - * + * * if sv==0: # <<<<<<<<<<<<<< * return pdf(x, v, a, z, err) - * + * */ __Pyx_TraceLine(95,1,__PYX_ERR(2, 95, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_sv == 0.0); if (__pyx_t_1) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":96 - * + * * if sv==0: * return pdf(x, v, a, z, err) # <<<<<<<<<<<<<< - * + * * cdef double tt = x/(pow(a,2)) # use normalized time */ __Pyx_TraceLine(96,1,__PYX_ERR(2, 96, __pyx_L1_error)) @@ -6205,28 +6214,28 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":95 * return 0 - * + * * if sv==0: # <<<<<<<<<<<<<< * return pdf(x, v, a, z, err) - * + * */ } /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":98 * return pdf(x, v, a, z, err) - * + * * cdef double tt = x/(pow(a,2)) # use normalized time # <<<<<<<<<<<<<< * cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) - * + * */ __Pyx_TraceLine(98,1,__PYX_ERR(2, 98, __pyx_L1_error)) __pyx_v_tt = (__pyx_v_x / pow(__pyx_v_a, 2.0)); /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":99 - * + * * cdef double tt = x/(pow(a,2)) # use normalized time * cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) # <<<<<<<<<<<<<< - * + * * # convert to f(t|v,a,w) */ __Pyx_TraceLine(99,1,__PYX_ERR(2, 99, __pyx_L1_error)) @@ -6234,10 +6243,10 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ __pyx_v_p = __pyx_t_2; /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":102 - * + * * # convert to f(t|v,a,w) * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) # <<<<<<<<<<<<<< - * + * * cpdef double full_pdf(double x, double v, double sv, double a, double */ __Pyx_TraceLine(102,1,__PYX_ERR(2, 102, __pyx_L1_error)) @@ -6246,7 +6255,7 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) - * + * * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method * and implementation of Navarro & Fuss, 2009. @@ -6270,13 +6279,13 @@ static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __ /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * + * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< * z, double sz, double t, double st, double err, int * n_st=2, int n_sz=2, bint use_adaptive=1, double */ -static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -6319,7 +6328,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double } /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 - * + * * # Check if parpameters are valid * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): @@ -6380,7 +6389,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): # <<<<<<<<<<<<<< * return 0 - * + * */ __Pyx_TraceLine(112,1,__PYX_ERR(2, 112, __pyx_L1_error)) __pyx_t_2 = ((fabs(__pyx_v_x) - (__pyx_v_t - (__pyx_v_st / 2.))) < 0.0); @@ -6406,7 +6415,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_L4_bool_binop_done:; /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 - * + * * # Check if parpameters are valid * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): @@ -6419,7 +6428,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): * return 0 # <<<<<<<<<<<<<< - * + * * # transform x,v,z if x is upper bound response */ __Pyx_TraceLine(113,1,__PYX_ERR(2, 113, __pyx_L1_error)) @@ -6427,7 +6436,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double goto __pyx_L0; /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 - * + * * # Check if parpameters are valid * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): @@ -6436,7 +6445,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double } /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":116 - * + * * # transform x,v,z if x is upper bound response * if x > 0: # <<<<<<<<<<<<<< * v = -v @@ -6451,7 +6460,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double * if x > 0: * v = -v # <<<<<<<<<<<<<< * z = 1.-z - * + * */ __Pyx_TraceLine(117,1,__PYX_ERR(2, 117, __pyx_L1_error)) __pyx_v_v = (-__pyx_v_v); @@ -6460,14 +6469,14 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double * if x > 0: * v = -v * z = 1.-z # <<<<<<<<<<<<<< - * + * * x = fabs(x) */ __Pyx_TraceLine(118,1,__PYX_ERR(2, 118, __pyx_L1_error)) __pyx_v_z = (1. - __pyx_v_z); /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":116 - * + * * # transform x,v,z if x is upper bound response * if x > 0: # <<<<<<<<<<<<<< * v = -v @@ -6477,9 +6486,9 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":120 * z = 1.-z - * + * * x = fabs(x) # <<<<<<<<<<<<<< - * + * * if st<1e-3: */ __Pyx_TraceLine(120,1,__PYX_ERR(2, 120, __pyx_L1_error)) @@ -6487,7 +6496,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":122 * x = fabs(x) - * + * * if st<1e-3: # <<<<<<<<<<<<<< * st = 0 * if sz <1e-3: @@ -6497,7 +6506,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double if (__pyx_t_1) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":123 - * + * * if st<1e-3: * st = 0 # <<<<<<<<<<<<<< * if sz <1e-3: @@ -6508,7 +6517,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":122 * x = fabs(x) - * + * * if st<1e-3: # <<<<<<<<<<<<<< * st = 0 * if sz <1e-3: @@ -6520,7 +6529,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double * st = 0 * if sz <1e-3: # <<<<<<<<<<<<<< * sz = 0 - * + * */ __Pyx_TraceLine(124,1,__PYX_ERR(2, 124, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_sz < 1e-3); @@ -6530,7 +6539,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double * st = 0 * if sz <1e-3: * sz = 0 # <<<<<<<<<<<<<< - * + * * if (sz==0): */ __Pyx_TraceLine(125,1,__PYX_ERR(2, 125, __pyx_L1_error)) @@ -6541,13 +6550,13 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double * st = 0 * if sz <1e-3: # <<<<<<<<<<<<<< * sz = 0 - * + * */ } /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":127 * sz = 0 - * + * * if (sz==0): # <<<<<<<<<<<<<< * if (st==0): #sv=0,sz=0,st=0 * return pdf_sv(x - t, v, sv, a, z, err) @@ -6557,7 +6566,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double if (__pyx_t_1) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":128 - * + * * if (sz==0): * if (st==0): #sv=0,sz=0,st=0 # <<<<<<<<<<<<<< * return pdf_sv(x - t, v, sv, a, z, err) @@ -6580,7 +6589,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double goto __pyx_L0; /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":128 - * + * * if (sz==0): * if (st==0): #sv=0,sz=0,st=0 # <<<<<<<<<<<<<< * return pdf_sv(x - t, v, sv, a, z, err) @@ -6625,7 +6634,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) * else: * return simpson_1D(x, v, sv, a, z, t, err, z, z, 0, t-st/2., t+st/2., n_st) # <<<<<<<<<<<<<< - * + * * else: #sz=$ */ __Pyx_TraceLine(134,1,__PYX_ERR(2, 134, __pyx_L1_error)) @@ -6638,7 +6647,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":127 * sz = 0 - * + * * if (sz==0): # <<<<<<<<<<<<<< * if (st==0): #sv=0,sz=0,st=0 * return pdf_sv(x - t, v, sv, a, z, err) @@ -6646,7 +6655,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double } /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":137 - * + * * else: #sz=$ * if (st==0): #sv=0,sz=$,st=0 # <<<<<<<<<<<<<< * if use_adaptive: @@ -6703,7 +6712,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double } /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":137 - * + * * else: #sz=$ * if (st==0): #sv=0,sz=$,st=0 # <<<<<<<<<<<<<< * if use_adaptive: @@ -6759,7 +6768,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * + * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< * z, double sz, double t, double st, double err, int * n_st=2, int n_sz=2, bint use_adaptive=1, double @@ -6782,7 +6791,7 @@ static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double } /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -6791,7 +6800,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_full_pdf, "full_pdf(double x, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3) -> double\nfull pdf"); static PyMethodDef __pyx_mdef_4wfpt_1full_pdf = {"full_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_1full_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_full_pdf}; -static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -7108,7 +7117,7 @@ static PyObject *__pyx_pf_4wfpt_full_pdf(CYTHON_UNUSED PyObject *__pyx_self, dou /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 * include 'pdf.pxi' - * + * * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" @@ -7139,7 +7148,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl __Pyx_TraceCall("simpson_1D", __pyx_f[3], 12, 1, __PYX_ERR(3, 12, __pyx_L1_error)); /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":18 - * + * * cdef double ht, hz * cdef int n = max(n_st, n_sz) # <<<<<<<<<<<<<< * if n_st==0: #integration over z @@ -7235,7 +7244,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl * ht = (ub_t-lb_t)/n * lb_z = z # <<<<<<<<<<<<<< * ub_z = z - * + * */ __Pyx_TraceLine(27,1,__PYX_ERR(3, 27, __pyx_L1_error)) __pyx_v_lb_z = __pyx_v_z; @@ -7244,7 +7253,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl * ht = (ub_t-lb_t)/n * lb_z = z * ub_z = z # <<<<<<<<<<<<<< - * + * * cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) */ __Pyx_TraceLine(28,1,__PYX_ERR(3, 28, __pyx_L1_error)) @@ -7254,7 +7263,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":30 * ub_z = z - * + * * cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) # <<<<<<<<<<<<<< * cdef double z_tag, t_tag, y * cdef int i @@ -7265,7 +7274,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":34 * cdef int i - * + * * for i from 1 <= i <= n: # <<<<<<<<<<<<<< * z_tag = lb_z + hz * i * t_tag = lb_t + ht * i @@ -7275,7 +7284,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl for (__pyx_v_i = 1; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":35 - * + * * for i from 1 <= i <= n: * z_tag = lb_z + hz * i # <<<<<<<<<<<<<< * t_tag = lb_t + ht * i @@ -7355,7 +7364,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl * S += (2 * y) * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y # <<<<<<<<<<<<<< * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st - * + * */ __Pyx_TraceLine(42,1,__PYX_ERR(3, 42, __pyx_L1_error)) __pyx_v_S = (__pyx_v_S - __pyx_v_y); @@ -7364,7 +7373,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl * S += (2 * y) * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st # <<<<<<<<<<<<<< - * + * * return ((ht+hz) * S / 3) */ __Pyx_TraceLine(43,1,__PYX_ERR(3, 43, __pyx_L1_error)) @@ -7372,9 +7381,9 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":45 * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st - * + * * return ((ht+hz) * S / 3) # <<<<<<<<<<<<<< - * + * * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: */ __Pyx_TraceLine(45,1,__PYX_ERR(3, 45, __pyx_L1_error)) @@ -7383,7 +7392,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 * include 'pdf.pxi' - * + * * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" @@ -7407,7 +7416,7 @@ static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 * return ((ht+hz) * S / 3) - * + * * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) @@ -7436,9 +7445,9 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":56 * cdef int i_t - * + * * ht = (ub_t-lb_t)/n_st # <<<<<<<<<<<<<< - * + * * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) */ __Pyx_TraceLine(56,1,__PYX_ERR(3, 56, __pyx_L1_error)) @@ -7446,9 +7455,9 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":58 * ht = (ub_t-lb_t)/n_st - * + * * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) # <<<<<<<<<<<<<< - * + * * for i_t from 1 <= i_t <= n_st: */ __Pyx_TraceLine(58,1,__PYX_ERR(3, 58, __pyx_L1_error)) @@ -7457,7 +7466,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":60 * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) - * + * * for i_t from 1 <= i_t <= n_st: # <<<<<<<<<<<<<< * t_tag = lb_t + ht * i_t * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) @@ -7467,7 +7476,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl for (__pyx_v_i_t = 1; __pyx_v_i_t <= __pyx_t_2; __pyx_v_i_t++) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":61 - * + * * for i_t from 1 <= i_t <= n_st: * t_tag = lb_t + ht * i_t # <<<<<<<<<<<<<< * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) @@ -7537,7 +7546,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl * S += (2 * y) * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y # <<<<<<<<<<<<<< * S = S/ (ub_t-lb_t) - * + * */ __Pyx_TraceLine(67,1,__PYX_ERR(3, 67, __pyx_L1_error)) __pyx_v_S = (__pyx_v_S - __pyx_v_y); @@ -7546,7 +7555,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl * S += (2 * y) * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y * S = S/ (ub_t-lb_t) # <<<<<<<<<<<<<< - * + * * return (ht * S / 3) */ __Pyx_TraceLine(68,1,__PYX_ERR(3, 68, __pyx_L1_error)) @@ -7554,9 +7563,9 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":70 * S = S/ (ub_t-lb_t) - * + * * return (ht * S / 3) # <<<<<<<<<<<<<< - * + * * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, */ __Pyx_TraceLine(70,1,__PYX_ERR(3, 70, __pyx_L1_error)) @@ -7565,7 +7574,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 * return ((ht+hz) * S / 3) - * + * * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) @@ -7589,7 +7598,7 @@ static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, doubl /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 * return (ht * S / 3) - * + * * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: @@ -7626,7 +7635,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":81 * #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) - * + * * if (ub_t-lb_t) == 0: #integration over sz # <<<<<<<<<<<<<< * h = ub_z - lb_z * z_c = (ub_z + lb_z)/2. @@ -7636,7 +7645,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v if (__pyx_t_1) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":82 - * + * * if (ub_t-lb_t) == 0: #integration over sz * h = ub_z - lb_z # <<<<<<<<<<<<<< * z_c = (ub_z + lb_z)/2. @@ -7690,7 +7699,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v * t_c = t * t_d = t # <<<<<<<<<<<<<< * t_e = t - * + * */ __Pyx_TraceLine(87,1,__PYX_ERR(3, 87, __pyx_L1_error)) __pyx_v_t_d = __pyx_v_t; @@ -7699,7 +7708,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v * t_c = t * t_d = t * t_e = t # <<<<<<<<<<<<<< - * + * * else: #integration over t */ __Pyx_TraceLine(88,1,__PYX_ERR(3, 88, __pyx_L1_error)) @@ -7707,7 +7716,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":81 * #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) - * + * * if (ub_t-lb_t) == 0: #integration over sz # <<<<<<<<<<<<<< * h = ub_z - lb_z * z_c = (ub_z + lb_z)/2. @@ -7716,7 +7725,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v } /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":91 - * + * * else: #integration over t * h = ub_t - lb_t # <<<<<<<<<<<<<< * t_c = (ub_t + lb_t)/2. @@ -7771,7 +7780,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v * z_c = z * z_d = z # <<<<<<<<<<<<<< * z_e = z - * + * */ __Pyx_TraceLine(96,1,__PYX_ERR(3, 96, __pyx_L1_error)) __pyx_v_z_d = __pyx_v_z; @@ -7780,7 +7789,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v * z_c = z * z_d = z * z_e = z # <<<<<<<<<<<<<< - * + * * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT */ __Pyx_TraceLine(97,1,__PYX_ERR(3, 97, __pyx_L1_error)) @@ -7790,20 +7799,20 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":99 * z_e = z - * + * * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT # <<<<<<<<<<<<<< * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT - * + * */ __Pyx_TraceLine(99,1,__PYX_ERR(3, 99, __pyx_L1_error)) __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_d), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_d, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 99, __pyx_L1_error) __pyx_v_fd = (__pyx_t_2 / __pyx_v_ZT); /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":100 - * + * * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT # <<<<<<<<<<<<<< - * + * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) */ __Pyx_TraceLine(100,1,__PYX_ERR(3, 100, __pyx_L1_error)) @@ -7812,7 +7821,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":102 * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT - * + * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) # <<<<<<<<<<<<<< * Sright = (h/12)*(f_mid + 4*fe + f_end) * S2 = Sleft + Sright @@ -7821,7 +7830,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_fd)) + __pyx_v_f_mid)); /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":103 - * + * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) * Sright = (h/12)*(f_mid + 4*fe + f_end) # <<<<<<<<<<<<<< * S2 = Sleft + Sright @@ -7912,7 +7921,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 * return (ht * S / 3) - * + * * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: @@ -7936,7 +7945,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 * Sright, f_mid, f_end, fe, bottom-1) - * + * * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, * double simps_err, int maxRecursionDepth) nogil: @@ -7968,7 +7977,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":120 * cdef double h - * + * * if (ub_t - lb_t) == 0: #integration over z # <<<<<<<<<<<<<< * lb_t = t * ub_t = t @@ -7978,7 +7987,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v if (__pyx_t_1) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":121 - * + * * if (ub_t - lb_t) == 0: #integration over z * lb_t = t # <<<<<<<<<<<<<< * ub_t = t @@ -8009,7 +8018,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":120 * cdef double h - * + * * if (ub_t - lb_t) == 0: #integration over z # <<<<<<<<<<<<<< * lb_t = t * ub_t = t @@ -8033,7 +8042,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v * h = (ub_t-lb_t) * lb_z = z # <<<<<<<<<<<<<< * ub_z = z - * + * */ __Pyx_TraceLine(126,1,__PYX_ERR(3, 126, __pyx_L1_error)) __pyx_v_lb_z = __pyx_v_z; @@ -8042,7 +8051,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v * h = (ub_t-lb_t) * lb_z = z * ub_z = z # <<<<<<<<<<<<<< - * + * * cdef double ZT = h */ __Pyx_TraceLine(127,1,__PYX_ERR(3, 127, __pyx_L1_error)) @@ -8052,7 +8061,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":129 * ub_z = z - * + * * cdef double ZT = h # <<<<<<<<<<<<<< * cdef double c_t = (lb_t + ub_t)/2. * cdef double c_z = (lb_z + ub_z)/2. @@ -8061,11 +8070,11 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v __pyx_v_ZT = __pyx_v_h; /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":130 - * + * * cdef double ZT = h * cdef double c_t = (lb_t + ub_t)/2. # <<<<<<<<<<<<<< * cdef double c_z = (lb_z + ub_z)/2. - * + * */ __Pyx_TraceLine(130,1,__PYX_ERR(3, 130, __pyx_L1_error)) __pyx_v_c_t = ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.); @@ -8074,14 +8083,14 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v * cdef double ZT = h * cdef double c_t = (lb_t + ub_t)/2. * cdef double c_z = (lb_z + ub_z)/2. # <<<<<<<<<<<<<< - * + * * cdef double f_beg, f_end, f_mid, S */ __Pyx_TraceLine(131,1,__PYX_ERR(3, 131, __pyx_L1_error)) __pyx_v_c_z = ((__pyx_v_lb_z + __pyx_v_ub_z) / 2.); /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":134 - * + * * cdef double f_beg, f_end, f_mid, S * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT # <<<<<<<<<<<<<< * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT @@ -8138,7 +8147,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v * lb_z, ub_z, lb_t, ub_t, ZT, simps_err, * S, f_beg, f_end, f_mid, maxRecursionDepth) * return res # <<<<<<<<<<<<<< - * + * * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, */ __Pyx_TraceLine(141,1,__PYX_ERR(3, 141, __pyx_L1_error)) @@ -8147,7 +8156,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 * Sright, f_mid, f_end, fe, bottom-1) - * + * * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, * double simps_err, int maxRecursionDepth) nogil: @@ -8171,7 +8180,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 * return res - * + * * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< * double a, double z, double t, double * pdf_err, double err_1d, double lb_z, @@ -8205,7 +8214,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":156 * #print "in AdaptiveSimpsAux_2D: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) - * + * * cdef double t_c = (ub_t + lb_t)/2. # <<<<<<<<<<<<<< * cdef double t_d = (lb_t + t_c)/2. * cdef double t_e = (t_c + ub_t)/2. @@ -8214,7 +8223,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __pyx_v_t_c = ((__pyx_v_ub_t + __pyx_v_lb_t) / 2.); /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":157 - * + * * cdef double t_c = (ub_t + lb_t)/2. * cdef double t_d = (lb_t + t_c)/2. # <<<<<<<<<<<<<< * cdef double t_e = (t_c + ub_t)/2. @@ -8228,7 +8237,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py * cdef double t_d = (lb_t + t_c)/2. * cdef double t_e = (t_c + ub_t)/2. # <<<<<<<<<<<<<< * cdef double h = ub_t - lb_t - * + * */ __Pyx_TraceLine(158,1,__PYX_ERR(3, 158, __pyx_L1_error)) __pyx_v_t_e = ((__pyx_v_t_c + __pyx_v_ub_t) / 2.); @@ -8237,7 +8246,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py * cdef double t_d = (lb_t + t_c)/2. * cdef double t_e = (t_c + ub_t)/2. * cdef double h = ub_t - lb_t # <<<<<<<<<<<<<< - * + * * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, */ __Pyx_TraceLine(159,1,__PYX_ERR(3, 159, __pyx_L1_error)) @@ -8245,7 +8254,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":161 * cdef double h = ub_t - lb_t - * + * * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< * 0, 0, err_1d, maxRecursionDepth_sz)/st * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, @@ -8254,7 +8263,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_d, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 161, __pyx_L1_error) /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":162 - * + * * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, @@ -8268,7 +8277,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py * 0, 0, err_1d, maxRecursionDepth_sz)/st * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< * 0, 0, err_1d, maxRecursionDepth_sz)/st - * + * */ __Pyx_TraceLine(163,1,__PYX_ERR(3, 163, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_e, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 163, __pyx_L1_error) @@ -8277,7 +8286,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py * 0, 0, err_1d, maxRecursionDepth_sz)/st * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< - * + * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) */ __Pyx_TraceLine(164,1,__PYX_ERR(3, 164, __pyx_L1_error)) @@ -8285,7 +8294,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":166 * 0, 0, err_1d, maxRecursionDepth_sz)/st - * + * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) # <<<<<<<<<<<<<< * Sright = (h/12)*(f_mid + 4*fe + f_end) * S2 = Sleft + Sright @@ -8294,11 +8303,11 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_fd)) + __pyx_v_f_mid)); /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":167 - * + * * Sleft = (h/12)*(f_beg + 4*fd + f_mid) * Sright = (h/12)*(f_mid + 4*fe + f_end) # <<<<<<<<<<<<<< * S2 = Sleft + Sright - * + * */ __Pyx_TraceLine(167,1,__PYX_ERR(3, 167, __pyx_L1_error)) __pyx_v_Sright = ((__pyx_v_h / 12.0) * ((__pyx_v_f_mid + (4.0 * __pyx_v_fe)) + __pyx_v_f_end)); @@ -8307,7 +8316,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py * Sleft = (h/12)*(f_beg + 4*fd + f_mid) * Sright = (h/12)*(f_mid + 4*fe + f_end) * S2 = Sleft + Sright # <<<<<<<<<<<<<< - * + * * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): */ __Pyx_TraceLine(168,1,__PYX_ERR(3, 168, __pyx_L1_error)) @@ -8315,10 +8324,10 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":170 * S2 = Sleft + Sright - * + * * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): # <<<<<<<<<<<<<< * return S2 + (S2 - S)/15; - * + * */ __Pyx_TraceLine(170,1,__PYX_ERR(3, 170, __pyx_L1_error)) __pyx_t_3 = (__pyx_v_bottom <= 0); @@ -8333,10 +8342,10 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py if (__pyx_t_2) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":171 - * + * * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): * return S2 + (S2 - S)/15; # <<<<<<<<<<<<<< - * + * * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, */ __Pyx_TraceLine(171,1,__PYX_ERR(3, 171, __pyx_L1_error)) @@ -8345,16 +8354,16 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":170 * S2 = Sleft + Sright - * + * * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): # <<<<<<<<<<<<<< * return S2 + (S2 - S)/15; - * + * */ } /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":173 * return S2 + (S2 - S)/15; - * + * * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< * lb_z, ub_z, lb_t, t_c, st, err_2d/2, * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ @@ -8385,7 +8394,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 * return res - * + * * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< * double a, double z, double t, double * pdf_err, double err_1d, double lb_z, @@ -8408,8 +8417,8 @@ static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __py } /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 - * - * + * + * * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: @@ -8442,9 +8451,9 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":185 * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: - * + * * cdef double h = (ub_t-lb_t) # <<<<<<<<<<<<<< - * + * * cdef double st = (ub_t - lb_t) */ __Pyx_TraceLine(185,1,__PYX_ERR(3, 185, __pyx_L1_error)) @@ -8452,7 +8461,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":187 * cdef double h = (ub_t-lb_t) - * + * * cdef double st = (ub_t - lb_t) # <<<<<<<<<<<<<< * cdef double c_t = (lb_t + ub_t)/2. * cdef double c_z = (lb_z + ub_z)/2. @@ -8461,11 +8470,11 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __pyx_v_st = (__pyx_v_ub_t - __pyx_v_lb_t); /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":188 - * + * * cdef double st = (ub_t - lb_t) * cdef double c_t = (lb_t + ub_t)/2. # <<<<<<<<<<<<<< * cdef double c_z = (lb_z + ub_z)/2. - * + * */ __Pyx_TraceLine(188,1,__PYX_ERR(3, 188, __pyx_L1_error)) __pyx_v_c_t = ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.); @@ -8474,18 +8483,18 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v * cdef double st = (ub_t - lb_t) * cdef double c_t = (lb_t + ub_t)/2. * cdef double c_z = (lb_z + ub_z)/2. # <<<<<<<<<<<<<< - * + * * cdef double f_beg, f_end, f_mid, S */ __Pyx_TraceLine(189,1,__PYX_ERR(3, 189, __pyx_L1_error)) __pyx_v_c_z = ((__pyx_v_lb_z + __pyx_v_ub_z) / 2.); /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":192 - * + * * cdef double f_beg, f_end, f_mid, S * cdef double err_1d = simps_err # <<<<<<<<<<<<<< * cdef double err_2d = simps_err - * + * */ __Pyx_TraceLine(192,1,__PYX_ERR(3, 192, __pyx_L1_error)) __pyx_v_err_1d = __pyx_v_simps_err; @@ -8494,7 +8503,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v * cdef double f_beg, f_end, f_mid, S * cdef double err_1d = simps_err * cdef double err_2d = simps_err # <<<<<<<<<<<<<< - * + * * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, */ __Pyx_TraceLine(193,1,__PYX_ERR(3, 193, __pyx_L1_error)) @@ -8502,19 +8511,19 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":195 * cdef double err_2d = simps_err - * + * * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< * 0, 0, err_1d, maxRecursionDepth_sz)/st - * + * */ __Pyx_TraceLine(195,1,__PYX_ERR(3, 195, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_lb_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 195, __pyx_L1_error) /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":196 - * + * * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< - * + * * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, */ __Pyx_TraceLine(196,1,__PYX_ERR(3, 196, __pyx_L1_error)) @@ -8522,7 +8531,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":198 * 0, 0, err_1d, maxRecursionDepth_sz)/st - * + * * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< * 0, 0, err_1d, maxRecursionDepth_sz)/st * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, @@ -8531,7 +8540,7 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_ub_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 198, __pyx_L1_error) /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":199 - * + * * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, @@ -8591,8 +8600,8 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v goto __pyx_L0; /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 - * - * + * + * * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: @@ -8616,14 +8625,14 @@ static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v /* "wfpt.pyx":32 * include 'integrate.pxi' - * + * * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_3pdf_array(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_3pdf_array(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -8632,7 +8641,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_2pdf_array, "pdf_array(ndarray x, double v, double sv, double a, double z, double sz, double t, double st, double err=1e-4, bool logp=0, int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); static PyMethodDef __pyx_mdef_4wfpt_3pdf_array = {"pdf_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_3pdf_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_2pdf_array}; -static PyObject *__pyx_pw_4wfpt_3pdf_array(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_3pdf_array(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9018,7 +9027,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P /* "wfpt.pyx":36 * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - * + * * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) @@ -9031,7 +9040,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P * cdef Py_ssize_t size = x.shape[0] * cdef Py_ssize_t i * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< - * + * * for i in prange(size, nogil=True): */ __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error)) @@ -9077,7 +9086,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P /* "wfpt.pyx":40 * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) - * + * * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, * n_st, n_sz, use_adaptive, simps_err) @@ -9126,11 +9135,11 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P __pyx_v_i = (Py_ssize_t)(0 + 1 * __pyx_t_9); /* "wfpt.pyx":41 - * + * * for i in prange(size, nogil=True): * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err) - * + * */ __Pyx_TraceLine(41,1,__PYX_ERR(0, 41, __pyx_L8_error)) __pyx_t_11 = __pyx_v_i; @@ -9139,7 +9148,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P * for i in prange(size, nogil=True): * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< - * + * * y = y * (1 - p_outlier) + (w_outlier * p_outlier) */ __Pyx_TraceLine(42,1,__PYX_ERR(0, 42, __pyx_L8_error)) @@ -9151,11 +9160,11 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P __pyx_t_12 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_13); if (unlikely(__pyx_t_12 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 41, __pyx_L8_error) /* "wfpt.pyx":41 - * + * * for i in prange(size, nogil=True): * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err) - * + * */ __Pyx_TraceLine(41,1,__PYX_ERR(0, 41, __pyx_L8_error)) __pyx_t_11 = __pyx_v_i; @@ -9243,7 +9252,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P /* "wfpt.pyx":40 * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) - * + * * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, * n_st, n_sz, use_adaptive, simps_err) @@ -9270,7 +9279,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P /* "wfpt.pyx":44 * n_st, n_sz, use_adaptive, simps_err) - * + * * y = y * (1 - p_outlier) + (w_outlier * p_outlier) # <<<<<<<<<<<<<< * if logp == 1: * return np.log(y) @@ -9311,7 +9320,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P __pyx_t_4 = 0; /* "wfpt.pyx":45 - * + * * y = y * (1 - p_outlier) + (w_outlier * p_outlier) * if logp == 1: # <<<<<<<<<<<<<< * return np.log(y) @@ -9362,7 +9371,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P goto __pyx_L0; /* "wfpt.pyx":45 - * + * * y = y * (1 - p_outlier) + (w_outlier * p_outlier) * if logp == 1: # <<<<<<<<<<<<<< * return np.log(y) @@ -9374,7 +9383,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P * return np.log(y) * else: * return y # <<<<<<<<<<<<<< - * + * * cdef inline bint p_outlier_in_range(double p_outlier): */ __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error)) @@ -9387,7 +9396,7 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P /* "wfpt.pyx":32 * include 'integrate.pxi' - * + * * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): @@ -9423,10 +9432,10 @@ static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, P /* "wfpt.pyx":50 * return y - * + * * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< * return (p_outlier >= 0) & (p_outlier <= 1) - * + * */ static CYTHON_INLINE int __pyx_f_4wfpt_p_outlier_in_range(double __pyx_v_p_outlier) { @@ -9440,11 +9449,11 @@ static CYTHON_INLINE int __pyx_f_4wfpt_p_outlier_in_range(double __pyx_v_p_outli __Pyx_TraceCall("p_outlier_in_range", __pyx_f[0], 50, 0, __PYX_ERR(0, 50, __pyx_L1_error)); /* "wfpt.pyx":51 - * + * * cdef inline bint p_outlier_in_range(double p_outlier): * return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error)) __pyx_r = ((__pyx_v_p_outlier >= 0.0) & (__pyx_v_p_outlier <= 1.0)); @@ -9452,10 +9461,10 @@ static CYTHON_INLINE int __pyx_f_4wfpt_p_outlier_in_range(double __pyx_v_p_outli /* "wfpt.pyx":50 * return y - * + * * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< * return (p_outlier >= 0) & (p_outlier <= 1) - * + * */ /* function exit code */ @@ -9469,15 +9478,15 @@ static CYTHON_INLINE int __pyx_f_4wfpt_p_outlier_in_range(double __pyx_v_p_outli } /* "wfpt.pyx":54 - * - * + * + * * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0.1): */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_5wiener_like(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_5wiener_like(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9486,7 +9495,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_4wiener_like, "wiener_like(ndarray x, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0.1)"); static PyMethodDef __pyx_mdef_4wfpt_5wiener_like = {"wiener_like", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_5wiener_like, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_4wiener_like}; -static PyObject *__pyx_pw_4wfpt_5wiener_like(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_5wiener_like(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9856,7 +9865,7 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, * cdef double p * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier - * + * */ __Pyx_TraceLine(60,0,__PYX_ERR(0, 60, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; @@ -9865,7 +9874,7 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, * cdef double p * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * + * * if not p_outlier_in_range(p_outlier): */ __Pyx_TraceLine(61,0,__PYX_ERR(0, 61, __pyx_L1_error)) @@ -9873,10 +9882,10 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, /* "wfpt.pyx":63 * cdef double wp_outlier = w_outlier * p_outlier - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(63,0,__PYX_ERR(0, 63, __pyx_L1_error)) __pyx_t_2 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) @@ -9884,10 +9893,10 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, if (__pyx_t_3) { /* "wfpt.pyx":64 - * + * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< - * + * * for i in range(size): */ __Pyx_TraceLine(64,0,__PYX_ERR(0, 64, __pyx_L1_error)) @@ -9906,16 +9915,16 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, /* "wfpt.pyx":63 * cdef double wp_outlier = w_outlier * p_outlier - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":66 * return -np.inf - * + * * for i in range(size): # <<<<<<<<<<<<<< * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, * n_st, n_sz, use_adaptive, simps_err) @@ -9927,7 +9936,7 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_i = __pyx_t_8; /* "wfpt.pyx":67 - * + * * for i in range(size): * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err) @@ -9967,7 +9976,7 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, * p = p * (1 - p_outlier) + wp_outlier * if p == 0: # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(71,0,__PYX_ERR(0, 71, __pyx_L1_error)) __pyx_t_3 = (__pyx_v_p == 0.0); @@ -9977,7 +9986,7 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, * p = p * (1 - p_outlier) + wp_outlier * if p == 0: * return -np.inf # <<<<<<<<<<<<<< - * + * * sum_logp += log(p) */ __Pyx_TraceLine(72,0,__PYX_ERR(0, 72, __pyx_L1_error)) @@ -9999,15 +10008,15 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, * p = p * (1 - p_outlier) + wp_outlier * if p == 0: # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":74 * return -np.inf - * + * * sum_logp += log(p) # <<<<<<<<<<<<<< - * + * * return sum_logp */ __Pyx_TraceLine(74,0,__PYX_ERR(0, 74, __pyx_L1_error)) @@ -10016,9 +10025,9 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, /* "wfpt.pyx":76 * sum_logp += log(p) - * + * * return sum_logp # <<<<<<<<<<<<<< - * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, */ __Pyx_TraceLine(76,0,__PYX_ERR(0, 76, __pyx_L1_error)) @@ -10030,8 +10039,8 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, goto __pyx_L0; /* "wfpt.pyx":54 - * - * + * + * * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0.1): @@ -10061,14 +10070,14 @@ static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, /* "wfpt.pyx":78 * return sum_logp - * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_7wiener_like_multi(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_7wiener_like_multi(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10077,7 +10086,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_6wiener_like_multi, "wiener_like_multi(ndarray x, v, sv, a, z, sz, t, st, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); static PyMethodDef __pyx_mdef_4wfpt_7wiener_like_multi = {"wiener_like_multi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_7wiener_like_multi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_6wiener_like_multi}; -static PyObject *__pyx_pw_4wfpt_7wiener_like_multi(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_7wiener_like_multi(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10485,7 +10494,7 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx * cdef double p = 0 * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier - * + * */ __Pyx_TraceLine(84,0,__PYX_ERR(0, 84, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; @@ -10494,7 +10503,7 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx * cdef double p = 0 * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * + * * if multi is None: */ __Pyx_TraceLine(85,0,__PYX_ERR(0, 85, __pyx_L1_error)) @@ -10502,7 +10511,7 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":87 * cdef double wp_outlier = w_outlier * p_outlier - * + * * if multi is None: # <<<<<<<<<<<<<< * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: @@ -10512,7 +10521,7 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx if (__pyx_t_2) { /* "wfpt.pyx":88 - * + * * if multi is None: * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< * else: @@ -10537,7 +10546,7 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":87 * cdef double wp_outlier = w_outlier * p_outlier - * + * * if multi is None: # <<<<<<<<<<<<<< * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: @@ -10843,7 +10852,7 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) * else: # x[i] == -999. * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< - * + * * sum_logp += log(p) */ __Pyx_TraceLine(104,0,__PYX_ERR(0, 104, __pyx_L1_error)) @@ -10867,9 +10876,9 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":106 * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * + * * sum_logp += log(p) # <<<<<<<<<<<<<< - * + * * return sum_logp */ __Pyx_TraceLine(106,0,__PYX_ERR(0, 106, __pyx_L1_error)) @@ -10878,9 +10887,9 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":108 * sum_logp += log(p) - * + * * return sum_logp # <<<<<<<<<<<<<< - * + * * def wiener_logp_array(np.ndarray[double, ndim=1] x, */ __Pyx_TraceLine(108,0,__PYX_ERR(0, 108, __pyx_L1_error)) @@ -10894,7 +10903,7 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":78 * return sum_logp - * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -10928,14 +10937,14 @@ static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":110 * return sum_logp - * + * * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] v, * np.ndarray[double, ndim=1] sv, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_9wiener_logp_array(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_9wiener_logp_array(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10944,7 +10953,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_8wiener_logp_array, "wiener_logp_array(ndarray x, ndarray v, ndarray sv, ndarray a, ndarray z, ndarray sz, ndarray t, ndarray st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0.1)"); static PyMethodDef __pyx_mdef_4wfpt_9wiener_logp_array = {"wiener_logp_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_9wiener_logp_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_8wiener_logp_array}; -static PyObject *__pyx_pw_4wfpt_9wiener_logp_array(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_9wiener_logp_array(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11402,7 +11411,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":126 * double w_outlier=0.1): - * + * * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) @@ -11463,7 +11472,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) * cdef double p * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * + * * if not p_outlier_in_range(p_outlier): */ __Pyx_TraceLine(130,0,__PYX_ERR(0, 130, __pyx_L1_error)) @@ -11471,7 +11480,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":132 * cdef double wp_outlier = w_outlier * p_outlier - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * logp[:] = -np.inf * return logp @@ -11482,11 +11491,11 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx if (__pyx_t_9) { /* "wfpt.pyx":133 - * + * * if not p_outlier_in_range(p_outlier): * logp[:] = -np.inf # <<<<<<<<<<<<<< * return logp - * + * */ __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error)) __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error) @@ -11504,7 +11513,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx * if not p_outlier_in_range(p_outlier): * logp[:] = -np.inf * return logp # <<<<<<<<<<<<<< - * + * * for i in range(size): */ __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error)) @@ -11515,7 +11524,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":132 * cdef double wp_outlier = w_outlier * p_outlier - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * logp[:] = -np.inf * return logp @@ -11524,7 +11533,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":136 * return logp - * + * * for i in range(size): # <<<<<<<<<<<<<< * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, * n_st, n_sz, use_adaptive, simps_err) @@ -11536,11 +11545,11 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx __pyx_v_i = __pyx_t_12; /* "wfpt.pyx":137 - * + * * for i in range(size): * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err) - * + * */ __Pyx_TraceLine(137,0,__PYX_ERR(0, 137, __pyx_L1_error)) __pyx_t_13 = __pyx_v_i; @@ -11556,7 +11565,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx * for i in range(size): * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< - * + * * # If one probability = 0, the log sum will be -Inf */ __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error)) @@ -11569,10 +11578,10 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx __pyx_v_p = __pyx_t_21; /* "wfpt.pyx":141 - * + * * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * + * * if p == 0: */ __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error)) @@ -11580,7 +11589,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":143 * p = p * (1 - p_outlier) + wp_outlier - * + * * if p == 0: # <<<<<<<<<<<<<< * logp[i] = -np.inf * else: @@ -11590,7 +11599,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx if (__pyx_t_9) { /* "wfpt.pyx":144 - * + * * if p == 0: * logp[i] = -np.inf # <<<<<<<<<<<<<< * else: @@ -11612,7 +11621,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":143 * p = p * (1 - p_outlier) + wp_outlier - * + * * if p == 0: # <<<<<<<<<<<<<< * logp[i] = -np.inf * else: @@ -11624,7 +11633,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx * logp[i] = -np.inf * else: * logp[i] = np.log(p) # <<<<<<<<<<<<<< - * + * * return logp */ __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error)) @@ -11669,9 +11678,9 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":148 * logp[i] = np.log(p) - * + * * return logp # <<<<<<<<<<<<<< - * + * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, */ __Pyx_TraceLine(148,0,__PYX_ERR(0, 148, __pyx_L1_error)) @@ -11682,7 +11691,7 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":110 * return sum_logp - * + * * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] v, * np.ndarray[double, ndim=1] sv, @@ -11732,14 +11741,14 @@ static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx /* "wfpt.pyx":150 * return logp - * + * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_11wiener_like_rlddm(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_11wiener_like_rlddm(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11748,7 +11757,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_10wiener_like_rlddm, "wiener_like_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); static PyMethodDef __pyx_mdef_4wfpt_11wiener_like_rlddm = {"wiener_like_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_11wiener_like_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_10wiener_like_rlddm}; -static PyObject *__pyx_pw_4wfpt_11wiener_like_rlddm(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_11wiener_like_rlddm(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12386,7 +12395,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * cdef np.ndarray[double, ndim=1] feedbacks * cdef np.ndarray[long, ndim=1] responses * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< - * + * * if not p_outlier_in_range(p_outlier): */ __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error)) @@ -12433,10 +12442,10 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":173 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error)) __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) @@ -12444,10 +12453,10 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py if (__pyx_t_11) { /* "wfpt.pyx":174 - * + * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< - * + * * if pos_alpha==100.00: */ __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error)) @@ -12466,16 +12475,16 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":173 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":176 * return -np.inf - * + * * if pos_alpha==100.00: # <<<<<<<<<<<<<< * pos_alfa = alpha * else: @@ -12485,7 +12494,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py if (__pyx_t_11) { /* "wfpt.pyx":177 - * + * * if pos_alpha==100.00: * pos_alfa = alpha # <<<<<<<<<<<<<< * else: @@ -12496,7 +12505,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":176 * return -np.inf - * + * * if pos_alpha==100.00: # <<<<<<<<<<<<<< * pos_alfa = alpha * else: @@ -12508,7 +12517,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * pos_alfa = alpha * else: * pos_alfa = pos_alpha # <<<<<<<<<<<<<< - * + * * # unique represent # of conditions */ __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error)) @@ -12518,7 +12527,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py __pyx_L4:; /* "wfpt.pyx":182 - * + * * # unique represent # of conditions * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< * s = unique[j] @@ -12672,7 +12681,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * s_size = xs.shape[0] * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q - * + * */ __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error)) __pyx_t_15 = 0; @@ -12682,7 +12691,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * s_size = xs.shape[0] * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< - * + * * # don't calculate pdf for first trial but still update q */ __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error)) @@ -12690,7 +12699,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; /* "wfpt.pyx":193 - * + * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) @@ -12714,7 +12723,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); /* "wfpt.pyx":193 - * + * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) @@ -12727,7 +12736,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< - * + * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error)) @@ -12741,7 +12750,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses[0]]) - * + * */ __Pyx_TraceLine(200,0,__PYX_ERR(0, 200, __pyx_L1_error)) __pyx_t_22 = 0; @@ -12751,7 +12760,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ * alfa * (feedbacks[0] - qs[responses[0]]) # <<<<<<<<<<<<<< - * + * * # loop through all trials in current condition */ __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error)) @@ -12764,7 +12773,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses[0]]) - * + * */ __Pyx_TraceLine(200,0,__PYX_ERR(0, 200, __pyx_L1_error)) __pyx_t_26 = 0; @@ -12772,7 +12781,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides))))); /* "wfpt.pyx":204 - * + * * # loop through all trials in current condition * for i in range(1, s_size): # <<<<<<<<<<<<<< * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, @@ -12838,7 +12847,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * if p == 0: * return -np.inf # <<<<<<<<<<<<<< * sum_logp += log(p) - * + * */ __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -12867,7 +12876,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * if p == 0: * return -np.inf * sum_logp += log(p) # <<<<<<<<<<<<<< - * + * * # get learning rate for current trial. if pos_alpha is not in */ __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error)) @@ -12911,7 +12920,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< - * + * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error)) @@ -12936,7 +12945,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * qs[responses[i]] = qs[responses[i]] + \ * alfa * (feedbacks[i] - qs[responses[i]]) # <<<<<<<<<<<<<< * return sum_logp - * + * */ __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error)) __pyx_t_15 = __pyx_v_i; @@ -12961,8 +12970,8 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py * qs[responses[i]] = qs[responses[i]] + \ * alfa * (feedbacks[i] - qs[responses[i]]) * return sum_logp # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -12974,7 +12983,7 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":150 * return logp - * + * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, @@ -13027,15 +13036,15 @@ static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__py } /* "wfpt.pyx":228 - * - * + * + * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] x, * np.ndarray[long, ndim=1] response, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_13wiener_like_rlssm_nn(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_13wiener_like_rlssm_nn(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13044,7 +13053,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_12wiener_like_rlssm_nn, "wiener_like_rlssm_nn(unicode model, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_ssm, ndarray params_rl, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); static PyMethodDef __pyx_mdef_4wfpt_13wiener_like_rlssm_nn = {"wiener_like_rlssm_nn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_13wiener_like_rlssm_nn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_12wiener_like_rlssm_nn}; -static PyObject *__pyx_pw_4wfpt_13wiener_like_rlssm_nn(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_13wiener_like_rlssm_nn(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13090,7 +13099,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * np.ndarray[double, ndim=1] params_rl, * np.ndarray[double, ndim=2] params_bnds, * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< - * + * * cdef double v = params_ssm[0] */ values[11] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); @@ -13307,8 +13316,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_4wfpt_12wiener_like_rlssm_nn(__pyx_self, __pyx_v_model, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_ssm, __pyx_v_params_rl, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); /* "wfpt.pyx":228 - * - * + * + * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] x, * np.ndarray[long, ndim=1] response, @@ -13525,20 +13534,20 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ /* "wfpt.pyx":239 * double p_outlier=0, double w_outlier=0, network = None): - * + * * cdef double v = params_ssm[0] # <<<<<<<<<<<<<< * cdef double rl_alpha = params_rl[0] - * + * */ __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error)) __pyx_t_1 = 0; __pyx_v_v = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides)); /* "wfpt.pyx":240 - * + * * cdef double v = params_ssm[0] * cdef double rl_alpha = params_rl[0] # <<<<<<<<<<<<<< - * + * * cdef Py_ssize_t size = x.shape[0] */ __Pyx_TraceLine(240,0,__PYX_ERR(0, 240, __pyx_L1_error)) @@ -13547,7 +13556,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ /* "wfpt.pyx":242 * cdef double rl_alpha = params_rl[0] - * + * * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t i, j, i_p * cdef Py_ssize_t s_size @@ -13771,7 +13780,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< * cdef int cumm_s_size = 0 - * + * */ __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error)) __pyx_v_ll_min = -16.11809; @@ -13780,7 +13789,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) * cdef float ll_min = -16.11809 * cdef int cumm_s_size = 0 # <<<<<<<<<<<<<< - * + * * if not p_outlier_in_range(p_outlier): */ __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error)) @@ -13788,10 +13797,10 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ /* "wfpt.pyx":262 * cdef int cumm_s_size = 0 - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error)) __pyx_t_12 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error) @@ -13799,10 +13808,10 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ if (__pyx_t_13) { /* "wfpt.pyx":263 - * + * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< - * + * * # Check for boundary violations -- if true, return -np.inf */ __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error)) @@ -13821,15 +13830,15 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ /* "wfpt.pyx":262 * cdef int cumm_s_size = 0 - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":266 - * + * * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, len(params_ssm)): # <<<<<<<<<<<<<< * lower_bnd = params_bnds[0][i_p] @@ -13916,7 +13925,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * for i_p in np.arange(1, len(params_ssm)): * lower_bnd = params_bnds[0][i_p] # <<<<<<<<<<<<<< * upper_bnd = params_bnds[1][i_p] - * + * */ __Pyx_TraceLine(267,0,__PYX_ERR(0, 267, __pyx_L1_error)) __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) @@ -13931,7 +13940,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * for i_p in np.arange(1, len(params_ssm)): * lower_bnd = params_bnds[0][i_p] * upper_bnd = params_bnds[1][i_p] # <<<<<<<<<<<<<< - * + * * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: */ __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error)) @@ -13945,10 +13954,10 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ /* "wfpt.pyx":270 * upper_bnd = params_bnds[1][i_p] - * + * * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(270,0,__PYX_ERR(0, 270, __pyx_L1_error)) __pyx_t_1 = __pyx_v_i_p; @@ -13975,11 +13984,11 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ if (__pyx_t_13) { /* "wfpt.pyx":271 - * + * * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: * return -np.inf # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -13998,15 +14007,15 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ /* "wfpt.pyx":270 * upper_bnd = params_bnds[1][i_p] - * + * * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":266 - * + * * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, len(params_ssm)): # <<<<<<<<<<<<<< * lower_bnd = params_bnds[0][i_p] @@ -14017,8 +14026,8 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "wfpt.pyx":274 - * - * + * + * * if len(params_rl) == 2: # <<<<<<<<<<<<<< * pos_alfa = params_rl[1] * else: @@ -14029,7 +14038,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ if (__pyx_t_13) { /* "wfpt.pyx":275 - * + * * if len(params_rl) == 2: * pos_alfa = params_rl[1] # <<<<<<<<<<<<<< * else: @@ -14040,8 +14049,8 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_v_pos_alfa = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); /* "wfpt.pyx":274 - * - * + * + * * if len(params_rl) == 2: # <<<<<<<<<<<<<< * pos_alfa = params_rl[1] * else: @@ -14053,8 +14062,8 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * pos_alfa = params_rl[1] * else: * pos_alfa = params_rl[0] # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(277,0,__PYX_ERR(0, 277, __pyx_L1_error)) /*else*/ { @@ -14064,7 +14073,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_L10:; /* "wfpt.pyx":281 - * + * * # unique represent # of conditions * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< * s = unique[j] @@ -14218,7 +14227,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * s_size = xs.shape[0] * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q - * + * */ __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error)) __pyx_t_1 = 0; @@ -14228,7 +14237,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * s_size = xs.shape[0] * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< - * + * * responses_qs = responses */ __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error)) @@ -14237,10 +14246,10 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ /* "wfpt.pyx":291 * qs[1] = q - * + * * responses_qs = responses # <<<<<<<<<<<<<< * responses_qs[responses_qs == -1] = 0 - * + * */ __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error)) { @@ -14264,10 +14273,10 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF_SET(__pyx_v_responses_qs, ((PyArrayObject *)__pyx_v_responses)); /* "wfpt.pyx":292 - * + * * responses_qs = responses * responses_qs[responses_qs == -1] = 0 # <<<<<<<<<<<<<< - * + * * # don't calculate pdf for first trial but still update q */ __Pyx_TraceLine(292,0,__PYX_ERR(0, 292, __pyx_L1_error)) @@ -14276,7 +14285,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "wfpt.pyx":295 - * + * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses_qs[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) @@ -14300,7 +14309,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); /* "wfpt.pyx":295 - * + * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses_qs[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) @@ -14313,8 +14322,8 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(298,0,__PYX_ERR(0, 298, __pyx_L1_error)) /*else*/ { @@ -14327,7 +14336,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * # received on current trial. * qs[responses_qs[0]] = qs[responses_qs[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses_qs[0]]) - * + * */ __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) __pyx_t_25 = 0; @@ -14337,8 +14346,8 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * # received on current trial. * qs[responses_qs[0]] = qs[responses_qs[0]] + \ * alfa * (feedbacks[0] - qs[responses_qs[0]]) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error)) __pyx_t_1 = 0; @@ -14350,7 +14359,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * # received on current trial. * qs[responses_qs[0]] = qs[responses_qs[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses_qs[0]]) - * + * */ __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) __pyx_t_29 = 0; @@ -14358,8 +14367,8 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_qs.diminfo[0].strides))))); /* "wfpt.pyx":307 - * - * + * + * * data[0, 0] = 0.0 # <<<<<<<<<<<<<< * # loop through all trials in current condition * for i in range(1, s_size): @@ -14401,7 +14410,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * # Check for boundary violations -- if true, return -np.inf * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error)) __pyx_t_27 = (__pyx_v_cumm_s_size + __pyx_v_i); @@ -14445,7 +14454,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * # Check for boundary violations -- if true, return -np.inf * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: * return -np.inf # <<<<<<<<<<<<<< - * + * * # get learning rate for current trial. if pos_alpha is not in */ __Pyx_TraceLine(313,0,__PYX_ERR(0, 313, __pyx_L1_error)) @@ -14467,7 +14476,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * # Check for boundary violations -- if true, return -np.inf * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< * return -np.inf - * + * */ } @@ -14509,7 +14518,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< - * + * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ __Pyx_TraceLine(321,0,__PYX_ERR(0, 321, __pyx_L1_error)) @@ -14534,7 +14543,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * qs[responses_qs[i]] = qs[responses_qs[i]] + \ * alfa * (feedbacks[i] - qs[responses_qs[i]]) # <<<<<<<<<<<<<< * cumm_s_size += s_size - * + * */ __Pyx_TraceLine(326,0,__PYX_ERR(0, 326, __pyx_L1_error)) __pyx_t_27 = __pyx_v_i; @@ -14558,19 +14567,19 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * qs[responses_qs[i]] = qs[responses_qs[i]] + \ * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error)) __pyx_v_cumm_s_size = (__pyx_v_cumm_s_size + __pyx_v_s_size); } /* "wfpt.pyx":330 - * - * + * + * * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) # <<<<<<<<<<<<<< * data[:, n_params:] = np.stack([x, response], axis = 1) - * + * */ __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error)) __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) @@ -14663,10 +14672,10 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "wfpt.pyx":331 - * + * * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) * data[:, n_params:] = np.stack([x, response], axis = 1) # <<<<<<<<<<<<<< - * + * * # Call to network: */ __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error)) @@ -14714,7 +14723,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "wfpt.pyx":334 - * + * * # Call to network: * if p_outlier == 0: # <<<<<<<<<<<<<< * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) @@ -14826,7 +14835,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ __pyx_v_sum_logp = __pyx_t_35; /* "wfpt.pyx":334 - * + * * # Call to network: * if p_outlier == 0: # <<<<<<<<<<<<<< * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) @@ -14839,7 +14848,7 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * else: * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< - * + * * return sum_logp */ __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error)) @@ -15009,10 +15018,10 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ /* "wfpt.pyx":339 * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - * + * * return sum_logp # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -15023,8 +15032,8 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ goto __pyx_L0; /* "wfpt.pyx":228 - * - * + * + * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] x, * np.ndarray[long, ndim=1] response, @@ -15097,15 +15106,15 @@ static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *_ } /* "wfpt.pyx":342 - * - * + * + * * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] feedback, * np.ndarray[long, ndim=1] split_by, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_15wiener_like_rl(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_15wiener_like_rl(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15114,7 +15123,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_14wiener_like_rl, "wiener_like_rl(ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double z, double err=1e-4, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); static PyMethodDef __pyx_mdef_4wfpt_15wiener_like_rl = {"wiener_like_rl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_15wiener_like_rl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_14wiener_like_rl}; -static PyObject *__pyx_pw_4wfpt_15wiener_like_rl(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_15wiener_like_rl(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15643,7 +15652,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * cdef np.ndarray[double, ndim=1] feedbacks * cdef np.ndarray[long, ndim=1] responses * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< - * + * * if not p_outlier_in_range(p_outlier): */ __Pyx_TraceLine(361,0,__PYX_ERR(0, 361, __pyx_L1_error)) @@ -15690,10 +15699,10 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s /* "wfpt.pyx":363 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error)) __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) @@ -15701,10 +15710,10 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s if (__pyx_t_11) { /* "wfpt.pyx":364 - * + * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< - * + * * if pos_alpha==100.00: */ __Pyx_TraceLine(364,0,__PYX_ERR(0, 364, __pyx_L1_error)) @@ -15723,16 +15732,16 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s /* "wfpt.pyx":363 * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":366 * return -np.inf - * + * * if pos_alpha==100.00: # <<<<<<<<<<<<<< * pos_alfa = alpha * else: @@ -15742,7 +15751,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s if (__pyx_t_11) { /* "wfpt.pyx":367 - * + * * if pos_alpha==100.00: * pos_alfa = alpha # <<<<<<<<<<<<<< * else: @@ -15753,7 +15762,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s /* "wfpt.pyx":366 * return -np.inf - * + * * if pos_alpha==100.00: # <<<<<<<<<<<<<< * pos_alfa = alpha * else: @@ -15765,7 +15774,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * pos_alfa = alpha * else: * pos_alfa = pos_alpha # <<<<<<<<<<<<<< - * + * * # unique represent # of conditions */ __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error)) @@ -15775,7 +15784,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_L4:; /* "wfpt.pyx":372 - * + * * # unique represent # of conditions * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< * s = unique[j] @@ -15891,7 +15900,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * s_size = responses.shape[0] * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q - * + * */ __Pyx_TraceLine(378,0,__PYX_ERR(0, 378, __pyx_L1_error)) __pyx_t_15 = 0; @@ -15901,7 +15910,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * s_size = responses.shape[0] * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< - * + * * # don't calculate pdf for first trial but still update q */ __Pyx_TraceLine(379,0,__PYX_ERR(0, 379, __pyx_L1_error)) @@ -15909,7 +15918,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; /* "wfpt.pyx":382 - * + * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) @@ -15933,7 +15942,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); /* "wfpt.pyx":382 - * + * * # don't calculate pdf for first trial but still update q * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) @@ -15946,7 +15955,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< - * + * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ __Pyx_TraceLine(385,0,__PYX_ERR(0, 385, __pyx_L1_error)) @@ -15960,7 +15969,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses[0]]) - * + * */ __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error)) __pyx_t_21 = 0; @@ -15970,7 +15979,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ * alfa * (feedbacks[0] - qs[responses[0]]) # <<<<<<<<<<<<<< - * + * * # loop through all trials in current condition */ __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error)) @@ -15983,7 +15992,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * # received on current trial. * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[0] - qs[responses[0]]) - * + * */ __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error)) __pyx_t_25 = 0; @@ -15991,10 +16000,10 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))))); /* "wfpt.pyx":393 - * + * * # loop through all trials in current condition * for i in range(1, s_size): # <<<<<<<<<<<<<< - * + * * drift = (qs[1] - qs[0]) * v */ __Pyx_TraceLine(393,0,__PYX_ERR(0, 393, __pyx_L1_error)) @@ -16005,9 +16014,9 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s /* "wfpt.pyx":395 * for i in range(1, s_size): - * + * * drift = (qs[1] - qs[0]) * v # <<<<<<<<<<<<<< - * + * * if drift == 0: */ __Pyx_TraceLine(395,0,__PYX_ERR(0, 395, __pyx_L1_error)) @@ -16017,7 +16026,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s /* "wfpt.pyx":397 * drift = (qs[1] - qs[0]) * v - * + * * if drift == 0: # <<<<<<<<<<<<<< * p = 0.5 * else: @@ -16027,7 +16036,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s if (__pyx_t_11) { /* "wfpt.pyx":398 - * + * * if drift == 0: * p = 0.5 # <<<<<<<<<<<<<< * else: @@ -16038,7 +16047,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s /* "wfpt.pyx":397 * drift = (qs[1] - qs[0]) * v - * + * * if drift == 0: # <<<<<<<<<<<<<< * p = 0.5 * else: @@ -16084,7 +16093,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * else: * p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ # <<<<<<<<<<<<<< * (2.718281828459**(-2 * drift) - 1) - * + * */ __Pyx_TraceLine(404,0,__PYX_ERR(0, 404, __pyx_L1_error)) /*else*/ { @@ -16093,7 +16102,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * else: * p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ * (2.718281828459**(-2 * drift) - 1) # <<<<<<<<<<<<<< - * + * * # If one probability = 0, the log sum will be -Inf */ __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error)) @@ -16104,7 +16113,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s __pyx_L10:; /* "wfpt.pyx":408 - * + * * # If one probability = 0, the log sum will be -Inf * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< * if p == 0: @@ -16118,7 +16127,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * p = p * (1 - p_outlier) + wp_outlier * if p == 0: # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(409,0,__PYX_ERR(0, 409, __pyx_L1_error)) __pyx_t_11 = (__pyx_v_p == 0.0); @@ -16128,7 +16137,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * p = p * (1 - p_outlier) + wp_outlier * if p == 0: * return -np.inf # <<<<<<<<<<<<<< - * + * * sum_logp += log(p) */ __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error)) @@ -16150,15 +16159,15 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * p = p * (1 - p_outlier) + wp_outlier * if p == 0: # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":412 * return -np.inf - * + * * sum_logp += log(p) # <<<<<<<<<<<<<< - * + * * # get learning rate for current trial. if pos_alpha is not in */ __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error)) @@ -16202,7 +16211,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) * else: * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< - * + * * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward */ __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error)) @@ -16227,7 +16236,7 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * qs[responses[i]] = qs[responses[i]] + \ * alfa * (feedbacks[i] - qs[responses[i]]) # <<<<<<<<<<<<<< * return sum_logp - * + * */ __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) __pyx_t_24 = __pyx_v_i; @@ -16252,8 +16261,8 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s * qs[responses[i]] = qs[responses[i]] + \ * alfa * (feedbacks[i] - qs[responses[i]]) * return sum_logp # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -16264,8 +16273,8 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L0; /* "wfpt.pyx":342 - * - * + * + * * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] feedback, * np.ndarray[long, ndim=1] split_by, @@ -16313,15 +16322,15 @@ static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_s } /* "wfpt.pyx":429 - * - * + * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_17wiener_like_multi(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_17wiener_like_multi(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16330,7 +16339,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_16wiener_like_multi, "wiener_like_multi(ndarray x, v, sv, a, z, sz, t, st, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); static PyMethodDef __pyx_mdef_4wfpt_17wiener_like_multi = {"wiener_like_multi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_17wiener_like_multi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_16wiener_like_multi}; -static PyObject *__pyx_pw_4wfpt_17wiener_like_multi(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_17wiener_like_multi(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16738,7 +16747,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py * cdef double p = 0 * cdef double sum_logp = 0 # <<<<<<<<<<<<<< * cdef double wp_outlier = w_outlier * p_outlier - * + * */ __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error)) __pyx_v_sum_logp = 0.0; @@ -16747,7 +16756,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py * cdef double p = 0 * cdef double sum_logp = 0 * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * + * * if multi is None: */ __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error)) @@ -16755,7 +16764,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":438 * cdef double wp_outlier = w_outlier * p_outlier - * + * * if multi is None: # <<<<<<<<<<<<<< * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: @@ -16765,7 +16774,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py if (__pyx_t_2) { /* "wfpt.pyx":439 - * + * * if multi is None: * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< * else: @@ -16790,7 +16799,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":438 * cdef double wp_outlier = w_outlier * p_outlier - * + * * if multi is None: # <<<<<<<<<<<<<< * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: @@ -17096,7 +17105,7 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) * else: # x[i] == -999. * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< - * + * * sum_logp += log(p) */ __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error)) @@ -17120,9 +17129,9 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":457 * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * + * * sum_logp += log(p) # <<<<<<<<<<<<<< - * + * * return sum_logp */ __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error)) @@ -17131,10 +17140,10 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":459 * sum_logp += log(p) - * + * * return sum_logp # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -17146,8 +17155,8 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py } /* "wfpt.pyx":429 - * - * + * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -17180,15 +17189,15 @@ static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__py } /* "wfpt.pyx":462 - * - * + * + * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_19wiener_like_multi_rlddm(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_19wiener_like_multi_rlddm(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17197,7 +17206,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_18wiener_like_multi_rlddm, "wiener_like_multi_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); static PyMethodDef __pyx_mdef_4wfpt_19wiener_like_multi_rlddm = {"wiener_like_multi_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_19wiener_like_multi_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_18wiener_like_multi_rlddm}; -static PyObject *__pyx_pw_4wfpt_19wiener_like_multi_rlddm(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_19wiener_like_multi_rlddm(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17599,8 +17608,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_4wfpt_18wiener_like_multi_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_alpha, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); /* "wfpt.pyx":462 - * - * + * + * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, @@ -17762,7 +17771,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject * cdef double wp_outlier = w_outlier * p_outlier * cdef int s * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< - * + * * if multi is None: */ __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error)) @@ -17822,7 +17831,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject /* "wfpt.pyx":478 * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - * + * * if multi is None: # <<<<<<<<<<<<<< * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: @@ -17832,7 +17841,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject if (__pyx_t_9) { /* "wfpt.pyx":479 - * + * * if multi is None: * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< * else: @@ -17857,7 +17866,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject /* "wfpt.pyx":478 * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - * + * * if multi is None: # <<<<<<<<<<<<<< * return full_pdf(x, v, sv, a, z, sz, t, st, err) * else: @@ -18004,7 +18013,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject * for i in range(size): * for param in multi: # <<<<<<<<<<<<<< * params_iter[param] = params[param][i] - * + * */ __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error)) if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { @@ -18053,7 +18062,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject * for i in range(size): * for param in multi: * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< - * + * * if (i != 0): */ __Pyx_TraceLine(487,0,__PYX_ERR(0, 487, __pyx_L1_error)) @@ -18070,7 +18079,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject * for i in range(size): * for param in multi: # <<<<<<<<<<<<<< * params_iter[param] = params[param][i] - * + * */ __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error)) } @@ -18078,7 +18087,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject /* "wfpt.pyx":489 * params_iter[param] = params[param][i] - * + * * if (i != 0): # <<<<<<<<<<<<<< * if (split_by[i] != split_by[i-1]): * qs[0] = q @@ -18088,7 +18097,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject if (__pyx_t_9) { /* "wfpt.pyx":490 - * + * * if (i != 0): * if (split_by[i] != split_by[i-1]): # <<<<<<<<<<<<<< * qs[0] = q @@ -18114,7 +18123,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject * if (split_by[i] != split_by[i-1]): * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q - * + * */ __Pyx_TraceLine(491,0,__PYX_ERR(0, 491, __pyx_L1_error)) __pyx_t_19 = 0; @@ -18124,7 +18133,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject * if (split_by[i] != split_by[i-1]): * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< - * + * * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), */ __Pyx_TraceLine(492,0,__PYX_ERR(0, 492, __pyx_L1_error)) @@ -18132,7 +18141,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; /* "wfpt.pyx":490 - * + * * if (i != 0): * if (split_by[i] != split_by[i-1]): # <<<<<<<<<<<<<< * qs[0] = q @@ -18142,7 +18151,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject /* "wfpt.pyx":489 * params_iter[param] = params[param][i] - * + * * if (i != 0): # <<<<<<<<<<<<<< * if (split_by[i] != split_by[i-1]): * qs[0] = q @@ -18151,7 +18160,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject /* "wfpt.pyx":494 * qs[1] = q - * + * * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), # <<<<<<<<<<<<<< * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter[ @@ -18175,7 +18184,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "wfpt.pyx":495 - * + * * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< * params_iter['sz'], params_iter[ @@ -18227,7 +18236,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject /* "wfpt.pyx":494 * qs[1] = q - * + * * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), # <<<<<<<<<<<<<< * params_iter['sv'], params_iter['a'], params_iter['z'], * params_iter['sz'], params_iter[ @@ -18246,7 +18255,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< * sum_logp += log(p) - * + * */ __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error)) __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); @@ -18255,7 +18264,7 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject * err, n_st, n_sz, use_adaptive, simps_err) * p = p * (1 - p_outlier) + wp_outlier * sum_logp += log(p) # <<<<<<<<<<<<<< - * + * * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) */ __Pyx_TraceLine(500,0,__PYX_ERR(0, 500, __pyx_L1_error)) @@ -18263,10 +18272,10 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject /* "wfpt.pyx":502 * sum_logp += log(p) - * + * * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) # <<<<<<<<<<<<<< * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) - * + * */ __Pyx_TraceLine(502,0,__PYX_ERR(0, 502, __pyx_L1_error)) __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) @@ -18290,10 +18299,10 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject __pyx_t_5 = 0; /* "wfpt.pyx":503 - * + * * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) # <<<<<<<<<<<<<< - * + * * return sum_logp */ __Pyx_TraceLine(503,0,__PYX_ERR(0, 503, __pyx_L1_error)) @@ -18339,10 +18348,10 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject /* "wfpt.pyx":505 * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) - * + * * return sum_logp # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -18354,8 +18363,8 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject } /* "wfpt.pyx":462 - * - * + * + * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, @@ -18401,15 +18410,15 @@ static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject } /* "wfpt.pyx":508 - * - * + * + * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< * np.ndarray[float, ndim=2] rl_arr, * np.ndarray[double, ndim=1] x, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18418,7 +18427,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_20wiener_like_rlssm_nn_reg, "wiener_like_rlssm_nn_reg(ndarray data, ndarray rl_arr, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); static PyMethodDef __pyx_mdef_4wfpt_21wiener_like_rlssm_nn_reg = {"wiener_like_rlssm_nn_reg", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_20wiener_like_rlssm_nn_reg}; -static PyObject *__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18665,8 +18674,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(__pyx_self, __pyx_v_data, __pyx_v_rl_arr, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); /* "wfpt.pyx":508 - * - * + * + * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< * np.ndarray[float, ndim=2] rl_arr, * np.ndarray[double, ndim=1] x, @@ -19055,7 +19064,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * cdef np.ndarray[float, ndim=2] data_copy = data * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< * cdef int cumm_s_size = 0 - * + * */ __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error)) __pyx_v_ll_min = -16.11809; @@ -19064,7 +19073,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * cdef np.ndarray[float, ndim=2] data_copy = data * cdef float ll_min = -16.11809 * cdef int cumm_s_size = 0 # <<<<<<<<<<<<<< - * + * * if not p_outlier_in_range(p_outlier): */ __Pyx_TraceLine(534,0,__PYX_ERR(0, 534, __pyx_L1_error)) @@ -19072,10 +19081,10 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":536 * cdef int cumm_s_size = 0 - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(536,0,__PYX_ERR(0, 536, __pyx_L1_error)) __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L1_error) @@ -19083,10 +19092,10 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec if (__pyx_t_11) { /* "wfpt.pyx":537 - * + * * if not p_outlier_in_range(p_outlier): * return -np.inf # <<<<<<<<<<<<<< - * + * * # Check for boundary violations -- if true, return -np.inf */ __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error)) @@ -19105,15 +19114,15 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":536 * cdef int cumm_s_size = 0 - * + * * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":540 - * + * * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, data.shape[1]-2): # <<<<<<<<<<<<<< * lower_bnd = params_bnds[0][i_p] @@ -19200,7 +19209,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * for i_p in np.arange(1, data.shape[1]-2): * lower_bnd = params_bnds[0][i_p] # <<<<<<<<<<<<<< * upper_bnd = params_bnds[1][i_p] - * + * */ __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error)) __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) @@ -19215,7 +19224,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * for i_p in np.arange(1, data.shape[1]-2): * lower_bnd = params_bnds[0][i_p] * upper_bnd = params_bnds[1][i_p] # <<<<<<<<<<<<<< - * + * * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: */ __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error)) @@ -19229,10 +19238,10 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":544 * upper_bnd = params_bnds[1][i_p] - * + * * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(544,0,__PYX_ERR(0, 544, __pyx_L1_error)) __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) @@ -19329,10 +19338,10 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec if (__pyx_t_11) { /* "wfpt.pyx":545 - * + * * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: * return -np.inf # <<<<<<<<<<<<<< - * + * * # unique represent # of conditions */ __Pyx_TraceLine(545,0,__PYX_ERR(0, 545, __pyx_L1_error)) @@ -19352,15 +19361,15 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":544 * upper_bnd = params_bnds[1][i_p] - * + * * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":540 - * + * * # Check for boundary violations -- if true, return -np.inf * for i_p in np.arange(1, data.shape[1]-2): # <<<<<<<<<<<<<< * lower_bnd = params_bnds[0][i_p] @@ -19371,7 +19380,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "wfpt.pyx":548 - * + * * # unique represent # of conditions * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< * s = unique[j] @@ -19525,7 +19534,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * s_size = xs.shape[0] * qs[0] = q # <<<<<<<<<<<<<< * qs[1] = q - * + * */ __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error)) __pyx_t_17 = 0; @@ -19535,7 +19544,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * s_size = xs.shape[0] * qs[0] = q * qs[1] = q # <<<<<<<<<<<<<< - * + * * responses_qs = responses */ __Pyx_TraceLine(556,0,__PYX_ERR(0, 556, __pyx_L1_error)) @@ -19544,10 +19553,10 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":558 * qs[1] = q - * + * * responses_qs = responses # <<<<<<<<<<<<<< * responses_qs[responses_qs == -1] = 0 - * + * */ __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error)) { @@ -19571,10 +19580,10 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __Pyx_XDECREF_SET(__pyx_v_responses_qs, ((PyArrayObject *)__pyx_v_responses)); /* "wfpt.pyx":559 - * + * * responses_qs = responses * responses_qs[responses_qs == -1] = 0 # <<<<<<<<<<<<<< - * + * * # loop through all trials in current condition */ __Pyx_TraceLine(559,0,__PYX_ERR(0, 559, __pyx_L1_error)) @@ -19583,7 +19592,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "wfpt.pyx":562 - * + * * # loop through all trials in current condition * for i in range(0, s_size): # <<<<<<<<<<<<<< * tp_scale = data[cumm_s_size + i, 0] @@ -19615,7 +19624,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * tp_scale = data[cumm_s_size + i, 0] * if tp_scale < 0: # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error)) __pyx_t_4 = PyObject_RichCompare(__pyx_v_tp_scale, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) @@ -19627,7 +19636,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * tp_scale = data[cumm_s_size + i, 0] * if tp_scale < 0: * return -np.inf # <<<<<<<<<<<<<< - * + * * data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale */ __Pyx_TraceLine(565,0,__PYX_ERR(0, 565, __pyx_L1_error)) @@ -19649,15 +19658,15 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * tp_scale = data[cumm_s_size + i, 0] * if tp_scale < 0: # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":567 * return -np.inf - * + * * data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale # <<<<<<<<<<<<<< - * + * * # Check for boundary violations -- if true, return -np.inf */ __Pyx_TraceLine(567,0,__PYX_ERR(0, 567, __pyx_L1_error)) @@ -19675,11 +19684,11 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[1].strides) = __pyx_t_27; /* "wfpt.pyx":570 - * + * * # Check for boundary violations -- if true, return -np.inf * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< * return -np.inf - * + * */ __Pyx_TraceLine(570,0,__PYX_ERR(0, 570, __pyx_L1_error)) __pyx_t_26 = (__pyx_v_cumm_s_size + __pyx_v_i); @@ -19723,7 +19732,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * # Check for boundary violations -- if true, return -np.inf * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: * return -np.inf # <<<<<<<<<<<<<< - * + * * rl_alpha = rl_arr[cumm_s_size + i, 0] */ __Pyx_TraceLine(571,0,__PYX_ERR(0, 571, __pyx_L1_error)) @@ -19741,20 +19750,20 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec goto __pyx_L0; /* "wfpt.pyx":570 - * + * * # Check for boundary violations -- if true, return -np.inf * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< * return -np.inf - * + * */ } /* "wfpt.pyx":573 * return -np.inf - * + * * rl_alpha = rl_arr[cumm_s_size + i, 0] # <<<<<<<<<<<<<< * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - * + * */ __Pyx_TraceLine(573,0,__PYX_ERR(0, 573, __pyx_L1_error)) __pyx_t_26 = (__pyx_v_cumm_s_size + __pyx_v_i); @@ -19762,10 +19771,10 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_v_rl_alpha = (*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rl_arr.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_rl_arr.diminfo[1].strides)); /* "wfpt.pyx":574 - * + * * rl_alpha = rl_arr[cumm_s_size + i, 0] * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< - * + * * qs[responses_qs[i]] = qs[responses_qs[i]] + \ */ __Pyx_TraceLine(574,0,__PYX_ERR(0, 574, __pyx_L1_error)) @@ -19773,7 +19782,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":576 * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - * + * * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size @@ -19783,11 +19792,11 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); /* "wfpt.pyx":577 - * + * * qs[responses_qs[i]] = qs[responses_qs[i]] + \ * alfa * (feedbacks[i] - qs[responses_qs[i]]) # <<<<<<<<<<<<<< * cumm_s_size += s_size - * + * */ __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error)) __pyx_t_28 = __pyx_v_i; @@ -19796,7 +19805,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":576 * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - * + * * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size @@ -19811,7 +19820,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * qs[responses_qs[i]] = qs[responses_qs[i]] + \ * alfa * (feedbacks[i] - qs[responses_qs[i]]) * cumm_s_size += s_size # <<<<<<<<<<<<<< - * + * * # Call to network: */ __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error)) @@ -19819,7 +19828,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec } /* "wfpt.pyx":581 - * + * * # Call to network: * if p_outlier == 0: # <<<<<<<<<<<<<< * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) @@ -19931,7 +19940,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec __pyx_v_sum_logp = __pyx_t_35; /* "wfpt.pyx":581 - * + * * # Call to network: * if p_outlier == 0: # <<<<<<<<<<<<<< * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) @@ -19944,7 +19953,7 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * else: * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< - * + * * return sum_logp */ __Pyx_TraceLine(584,0,__PYX_ERR(0, 584, __pyx_L1_error)) @@ -20114,9 +20123,9 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":586 * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - * + * * return sum_logp # <<<<<<<<<<<<<< - * + * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, */ __Pyx_TraceLine(586,0,__PYX_ERR(0, 586, __pyx_L1_error)) @@ -20128,8 +20137,8 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec goto __pyx_L0; /* "wfpt.pyx":508 - * - * + * + * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< * np.ndarray[float, ndim=2] rl_arr, * np.ndarray[double, ndim=1] x, @@ -20204,14 +20213,14 @@ static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObjec /* "wfpt.pyx":588 * return sum_logp - * + * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< * double sv, double a, double z, double sz, double t, double st, double t_min, * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_23wiener_like_contaminant(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_23wiener_like_contaminant(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20220,7 +20229,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_22wiener_like_contaminant, "wiener_like_contaminant(ndarray x, ndarray cont_x, double v, double sv, double a, double z, double sz, double t, double st, double t_min, double t_max, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8)\nWiener likelihood function where RTs could come from a\n separate, uniform contaminant distribution.\n\n Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007)\n "); static PyMethodDef __pyx_mdef_4wfpt_23wiener_like_contaminant = {"wiener_like_contaminant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_23wiener_like_contaminant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_22wiener_like_contaminant}; -static PyObject *__pyx_pw_4wfpt_23wiener_like_contaminant(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_23wiener_like_contaminant(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20625,7 +20634,7 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject * cdef double sum_logp = 0 * cdef int n_cont = np.sum(cont_x) # <<<<<<<<<<<<<< * cdef int pos_cont = 0 - * + * */ __Pyx_TraceLine(601,0,__PYX_ERR(0, 601, __pyx_L1_error)) __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) @@ -20663,7 +20672,7 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject * cdef double sum_logp = 0 * cdef int n_cont = np.sum(cont_x) * cdef int pos_cont = 0 # <<<<<<<<<<<<<< - * + * * for i in prange(size, nogil=True): */ __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error)) @@ -20671,7 +20680,7 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject /* "wfpt.pyx":604 * cdef int pos_cont = 0 - * + * * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< * if cont_x[i] == 0: * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, @@ -20724,7 +20733,7 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject __pyx_v_p = ((double)__PYX_NAN()); /* "wfpt.pyx":605 - * + * * for i in prange(size, nogil=True): * if cont_x[i] == 0: # <<<<<<<<<<<<<< * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, @@ -20846,13 +20855,13 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject * return -np.inf * sum_logp += log(p) # <<<<<<<<<<<<<< * # If one probability = 0, the log sum will be -Inf - * + * */ __Pyx_TraceLine(611,1,__PYX_ERR(0, 611, __pyx_L8_error)) __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); /* "wfpt.pyx":605 - * + * * for i in prange(size, nogil=True): * if cont_x[i] == 0: # <<<<<<<<<<<<<< * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, @@ -20951,7 +20960,7 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject /* "wfpt.pyx":604 * cdef int pos_cont = 0 - * + * * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< * if cont_x[i] == 0: * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, @@ -20977,10 +20986,10 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject } /* "wfpt.pyx":615 - * + * * # add the log likelihood of the contaminations * sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) # <<<<<<<<<<<<<< - * + * * return sum_logp */ __Pyx_TraceLine(615,0,__PYX_ERR(0, 615, __pyx_L1_error)) @@ -20988,9 +20997,9 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject /* "wfpt.pyx":617 * sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) - * + * * return sum_logp # <<<<<<<<<<<<<< - * + * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, */ __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error)) @@ -21003,7 +21012,7 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject /* "wfpt.pyx":588 * return sum_logp - * + * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< * double sv, double a, double z, double sz, double t, double st, double t_min, * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, @@ -21036,14 +21045,14 @@ static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject /* "wfpt.pyx":619 * return sum_logp - * + * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_25gen_cdf_using_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_25gen_cdf_using_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21052,7 +21061,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_24gen_cdf_using_pdf, "gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, int N=500, double time=5., int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)\n\n generate cdf vector using the pdf\n "); static PyMethodDef __pyx_mdef_4wfpt_25gen_cdf_using_pdf = {"gen_cdf_using_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_25gen_cdf_using_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_24gen_cdf_using_pdf}; -static PyObject *__pyx_pw_4wfpt_25gen_cdf_using_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_25gen_cdf_using_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21538,7 +21547,7 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError( # <<<<<<<<<<<<<< * "at least one of the parameters is out of the support") - * + * */ __Pyx_TraceLine(627,0,__PYX_ERR(0, 627, __pyx_L1_error)) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) @@ -21558,7 +21567,7 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":630 * "at least one of the parameters is out of the support") - * + * * cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) * cdef int idx @@ -21615,11 +21624,11 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_4 = 0; /* "wfpt.pyx":631 - * + * * cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) * cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) # <<<<<<<<<<<<<< * cdef int idx - * + * */ __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error)) __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) @@ -21664,11 +21673,11 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_5 = 0; /* "wfpt.pyx":635 - * + * * # compute pdf on the real line * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) - * + * */ __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error)) __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pdf_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error) @@ -21694,7 +21703,7 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py * # compute pdf on the real line * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) # <<<<<<<<<<<<<< - * + * * # integrate */ __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error)) @@ -21748,11 +21757,11 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py } /* "wfpt.pyx":635 - * + * * # compute pdf on the real line * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, # <<<<<<<<<<<<<< * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) - * + * */ __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error)) if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 635, __pyx_L1_error) @@ -21779,10 +21788,10 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __pyx_t_5 = 0; /* "wfpt.pyx":639 - * + * * # integrate * cdf_array[1:] = integrate.cumtrapz(cdf_array) # <<<<<<<<<<<<<< - * + * * # normalize */ __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error)) @@ -21817,10 +21826,10 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "wfpt.pyx":642 - * + * * # normalize * cdf_array /= cdf_array[x.shape[0] - 1] # <<<<<<<<<<<<<< - * + * * return x, cdf_array */ __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error)) @@ -21856,10 +21865,10 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":644 * cdf_array /= cdf_array[x.shape[0] - 1] - * + * * return x, cdf_array # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); @@ -21877,7 +21886,7 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py /* "wfpt.pyx":619 * return sum_logp - * + * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -21925,15 +21934,15 @@ static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__py } /* "wfpt.pyx":647 - * - * + * + * * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< - * + * * # get length of data */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_27split_cdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_27split_cdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21942,7 +21951,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_26split_cdf, "split_cdf(ndarray x, ndarray data)"); static PyMethodDef __pyx_mdef_4wfpt_27split_cdf = {"split_cdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_27split_cdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_26split_cdf}; -static PyObject *__pyx_pw_4wfpt_27split_cdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_27split_cdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -22131,10 +22140,10 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; /* "wfpt.pyx":650 - * + * * # get length of data * cdef int N = (len(data) - 1) / 2 # <<<<<<<<<<<<<< - * + * * # lower bound is reversed */ __Pyx_TraceLine(650,0,__PYX_ERR(0, 650, __pyx_L1_error)) @@ -22142,7 +22151,7 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_N = ((__pyx_t_1 - 1) / 2); /* "wfpt.pyx":653 - * + * * # lower bound is reversed * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] @@ -22214,7 +22223,7 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] * # lower bound is cumulative in the wrong direction * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) # <<<<<<<<<<<<<< - * + * * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] */ __Pyx_TraceLine(656,0,__PYX_ERR(0, 656, __pyx_L1_error)) @@ -22370,7 +22379,7 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, /* "wfpt.pyx":658 * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) - * + * * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] * # ub does not start at 0 @@ -22399,7 +22408,7 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = 0; /* "wfpt.pyx":659 - * + * * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] # <<<<<<<<<<<<<< * # ub does not start at 0 @@ -22432,7 +22441,7 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] * # ub does not start at 0 * ub -= ub[0] # <<<<<<<<<<<<<< - * + * * return (x_lb, lb, x_ub, ub) */ __Pyx_TraceLine(661,0,__PYX_ERR(0, 661, __pyx_L1_error)) @@ -22467,9 +22476,9 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, /* "wfpt.pyx":663 * ub -= ub[0] - * + * * return (x_lb, lb, x_ub, ub) # <<<<<<<<<<<<<< - * + * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, */ __Pyx_TraceLine(663,0,__PYX_ERR(0, 663, __pyx_L1_error)) @@ -22493,10 +22502,10 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, goto __pyx_L0; /* "wfpt.pyx":647 - * - * + * + * * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< - * + * * # get length of data */ @@ -22544,14 +22553,14 @@ static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) - * + * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -22560,7 +22569,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_28wiener_like_multi_nn_mlp, "wiener_like_multi_nn_mlp(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); static PyMethodDef __pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp = {"wiener_like_multi_nn_mlp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_28wiener_like_multi_nn_mlp}; -static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -22599,7 +22608,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * double w_outlier = 0, * network = None): # <<<<<<<<<<<<<< * #**kwargs): - * + * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { @@ -22697,7 +22706,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) - * + * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, @@ -22758,16 +22767,16 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec /* "wfpt.pyx":676 * # (in that order) - * + * * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< * cdef float log_p - * + * */ __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error)) __pyx_v_ll_min = -16.11809; /* "wfpt.pyx":680 - * + * * # Call to network: * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) @@ -22879,7 +22888,7 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec __pyx_v_log_p = __pyx_t_10; /* "wfpt.pyx":680 - * + * * # Call to network: * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) @@ -22893,7 +22902,7 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec * else: * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< * return log_p - * + * */ __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error)) /*else*/ { @@ -23064,7 +23073,7 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec * else: * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) * return log_p # <<<<<<<<<<<<<< - * + * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, */ __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error)) @@ -23077,7 +23086,7 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) - * + * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, @@ -23116,14 +23125,14 @@ static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObjec /* "wfpt.pyx":686 * return log_p - * + * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, */ /* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -23132,7 +23141,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4wfpt_30wiener_like_multi_nn_mlp_pdf, "wiener_like_multi_nn_mlp_pdf(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); static PyMethodDef __pyx_mdef_4wfpt_31wiener_like_multi_nn_mlp_pdf = {"wiener_like_multi_nn_mlp_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_30wiener_like_multi_nn_mlp_pdf}; -static PyObject *__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, +static PyObject *__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -23171,7 +23180,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * double w_outlier = 0, * network = None): # <<<<<<<<<<<<<< * #**kwargs): - * + * */ values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { @@ -23269,7 +23278,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds /* "wfpt.pyx":686 * return log_p - * + * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, @@ -23330,16 +23339,16 @@ static PyObject *__pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO /* "wfpt.pyx":697 * # (in that order) - * + * * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< * cdef float log_p - * + * */ __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error)) __pyx_v_ll_min = -16.11809; /* "wfpt.pyx":701 - * + * * # Call to network: * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) @@ -23451,7 +23460,7 @@ static PyObject *__pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO __pyx_v_log_p = __pyx_t_10; /* "wfpt.pyx":701 - * + * * # Call to network: * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) @@ -23646,7 +23655,7 @@ static PyObject *__pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyO /* "wfpt.pyx":686 * return log_p - * + * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, @@ -23871,22 +23880,22 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_umath() except -1: */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_ufunc() except -1: */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 989, __pyx_L1_error) @@ -23894,22 +23903,22 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__2); /* "wfpt.pyx":133 - * + * * if not p_outlier_in_range(p_outlier): * logp[:] = -np.inf # <<<<<<<<<<<<<< * return logp - * + * */ __pyx_slice__8 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__8); __Pyx_GIVEREF(__pyx_slice__8); /* "wfpt.pyx":330 - * - * + * + * * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) # <<<<<<<<<<<<<< * data[:, n_params:] = np.stack([x, response], axis = 1) - * + * */ __pyx_slice__11 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__11); @@ -23920,14 +23929,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): * raise ValueError( # <<<<<<<<<<<<<< * "at least one of the parameters is out of the support") - * + * */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_at_least_one_of_the_parameters_i); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "wfpt.pyx":653 - * + * * # lower bound is reversed * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] # <<<<<<<<<<<<<< * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] @@ -23939,7 +23948,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":19 * #from hddm.model_config import model_config - * + * * import scipy.integrate as integrate # <<<<<<<<<<<<<< * from copy import copy * import numpy as np @@ -23950,7 +23959,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * + * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< * z, double sz, double t, double st, double err, int * n_st=2, int n_sz=2, bint use_adaptive=1, double @@ -23965,7 +23974,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":32 * include 'integrate.pxi' - * + * * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): @@ -23976,8 +23985,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_pdf_array, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 32, __pyx_L1_error) /* "wfpt.pyx":54 - * - * + * + * * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0.1): @@ -23989,7 +23998,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":78 * return sum_logp - * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -24001,7 +24010,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":110 * return sum_logp - * + * * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] v, * np.ndarray[double, ndim=1] sv, @@ -24013,7 +24022,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":150 * return logp - * + * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, @@ -24024,8 +24033,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 36, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rlddm, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 150, __pyx_L1_error) /* "wfpt.pyx":228 - * - * + * + * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] x, * np.ndarray[long, ndim=1] response, @@ -24036,8 +24045,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(12, 0, 0, 37, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rlssm_nn, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 228, __pyx_L1_error) /* "wfpt.pyx":342 - * - * + * + * * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] feedback, * np.ndarray[long, ndim=1] split_by, @@ -24048,8 +24057,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rl, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 342, __pyx_L1_error) /* "wfpt.pyx":429 - * - * + * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -24057,8 +24066,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 429, __pyx_L1_error) /* "wfpt.pyx":462 - * - * + * + * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, @@ -24069,8 +24078,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 34, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi_rlddm, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 462, __pyx_L1_error) /* "wfpt.pyx":508 - * - * + * + * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< * np.ndarray[float, ndim=2] rl_arr, * np.ndarray[double, ndim=1] x, @@ -24082,7 +24091,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":588 * return sum_logp - * + * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< * double sv, double a, double z, double sz, double t, double st, double t_min, * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, @@ -24094,7 +24103,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":619 * return sum_logp - * + * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -24105,10 +24114,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_gen_cdf_using_pdf, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 619, __pyx_L1_error) /* "wfpt.pyx":647 - * - * + * + * * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< - * + * * # get length of data */ __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_s_x, __pyx_n_s_data, __pyx_n_s_N, __pyx_n_s_x_lb, __pyx_n_s_lb, __pyx_n_s_x_ub, __pyx_n_s_ub); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 647, __pyx_L1_error) @@ -24118,7 +24127,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) - * + * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, @@ -24130,7 +24139,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "wfpt.pyx":686 * return log_p - * + * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, @@ -24234,7 +24243,7 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API @@ -24576,8 +24585,8 @@ if (!__Pyx_RefNanny) { #endif __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_wfpt(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 + * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< * """Returns a borrowed reference to the object owning the data/memory. @@ -24586,8 +24595,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 + * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< * """Returns an owned reference to the dtype of the array. @@ -24596,8 +24605,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 + * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< * """Returns the number of dimensions in the array. @@ -24606,8 +24615,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(257,0,__PYX_ERR(1, 257, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 + * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the dimensions/shape of the array. @@ -24616,8 +24625,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(263,0,__PYX_ERR(1, 263, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 + * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the strides of the array. @@ -24626,8 +24635,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(271,0,__PYX_ERR(1, 271, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 + * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< * """Returns the total size (in number of elements) of the array. @@ -24636,8 +24645,8 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(278,0,__PYX_ERR(1, 278, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 + * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< * """The pointer to the data buffer as a char*. @@ -24646,59 +24655,59 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ __Pyx_TraceLine(773,0,__PYX_ERR(1, 773, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -24706,9 +24715,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(788,0,__PYX_ERR(1, 788, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -24716,9 +24725,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(967,0,__PYX_ERR(1, 967, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -24726,7 +24735,7 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(971,0,__PYX_ERR(1, 971, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -24736,9 +24745,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -24746,9 +24755,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -24756,9 +24765,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -24766,9 +24775,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(998,0,__PYX_ERR(1, 998, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -24776,9 +24785,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -24786,9 +24795,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -24796,9 +24805,9 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error)) - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmp83e46clf/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * + /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -24808,7 +24817,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":19 * #from hddm.model_config import model_config - * + * * import scipy.integrate as integrate # <<<<<<<<<<<<<< * from copy import copy * import numpy as np @@ -24820,11 +24829,11 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "wfpt.pyx":20 - * + * * import scipy.integrate as integrate * from copy import copy # <<<<<<<<<<<<<< * import numpy as np - * + * */ __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error)) __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) @@ -24845,7 +24854,7 @@ if (!__Pyx_RefNanny) { * import scipy.integrate as integrate * from copy import copy * import numpy as np # <<<<<<<<<<<<<< - * + * * cimport numpy as np */ __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error)) @@ -24856,7 +24865,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":6 * #cython: boundscheck=False - * + * * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np * cimport cython @@ -24869,7 +24878,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 * T max[T](T a, T b) - * + * * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method * and implementation of Navarro & Fuss, 2009. @@ -24879,7 +24888,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 * return p - * + * * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< * """Probability of hitting upper boundary.""" * if v == 0: @@ -24889,7 +24898,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) - * + * * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method * and implementation of Navarro & Fuss, 2009. @@ -24899,7 +24908,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) - * + * * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method * and implementation of Navarro & Fuss, 2009. @@ -24909,7 +24918,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * + * * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< * z, double sz, double t, double st, double err, int * n_st=2, int n_sz=2, bint use_adaptive=1, double @@ -24924,7 +24933,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 * include 'pdf.pxi' - * + * * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" @@ -24934,7 +24943,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 * return ((ht+hz) * S / 3) - * + * * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) @@ -24944,7 +24953,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 * return (ht * S / 3) - * + * * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: @@ -24954,7 +24963,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 * Sright, f_mid, f_end, fe, bottom-1) - * + * * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, * double simps_err, int maxRecursionDepth) nogil: @@ -24964,7 +24973,7 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 * return res - * + * * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< * double a, double z, double t, double * pdf_err, double err_1d, double lb_z, @@ -24973,8 +24982,8 @@ if (!__Pyx_RefNanny) { /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 - * - * + * + * * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: @@ -24983,11 +24992,11 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":33 - * + * * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, # <<<<<<<<<<<<<< * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - * + * */ __Pyx_TraceLine(33,0,__PYX_ERR(0, 33, __pyx_L1_error)) __pyx_t_3 = PyFloat_FromDouble(((double)1e-4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) @@ -25005,7 +25014,7 @@ if (!__Pyx_RefNanny) { * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< - * + * * cdef Py_ssize_t size = x.shape[0] */ __Pyx_TraceLine(34,0,__PYX_ERR(0, 34, __pyx_L1_error)) @@ -25018,7 +25027,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":32 * include 'integrate.pxi' - * + * * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): @@ -25059,16 +25068,16 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":50 * return y - * + * * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< * return (p_outlier >= 0) & (p_outlier <= 1) - * + * */ __Pyx_TraceLine(50,0,__PYX_ERR(0, 50, __pyx_L1_error)) /* "wfpt.pyx":55 - * + * * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0.1): @@ -25098,8 +25107,8 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); /* "wfpt.pyx":54 - * - * + * + * * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, * double p_outlier=0, double w_outlier=0.1): @@ -25133,7 +25142,7 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "wfpt.pyx":79 - * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0): @@ -25164,7 +25173,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":78 * return sum_logp - * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -25249,7 +25258,7 @@ if (!__Pyx_RefNanny) { * double simps_err=1e-8, * double p_outlier=0, # <<<<<<<<<<<<<< * double w_outlier=0.1): - * + * */ __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error)) __pyx_t_6 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error) @@ -25259,7 +25268,7 @@ if (!__Pyx_RefNanny) { * double simps_err=1e-8, * double p_outlier=0, * double w_outlier=0.1): # <<<<<<<<<<<<<< - * + * * cdef Py_ssize_t size = x.shape[0] */ __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error)) @@ -25268,7 +25277,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":110 * return sum_logp - * + * * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] v, * np.ndarray[double, ndim=1] sv, @@ -25333,7 +25342,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":150 * return logp - * + * * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, @@ -25370,7 +25379,7 @@ if (!__Pyx_RefNanny) { * np.ndarray[double, ndim=1] params_rl, * np.ndarray[double, ndim=2] params_bnds, * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< - * + * * cdef double v = params_ssm[0] */ __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error)) @@ -25380,8 +25389,8 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_10); /* "wfpt.pyx":228 - * - * + * + * * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] x, * np.ndarray[long, ndim=1] response, @@ -25438,8 +25447,8 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); /* "wfpt.pyx":342 - * - * + * + * * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< * np.ndarray[double, ndim=1] feedback, * np.ndarray[long, ndim=1] split_by, @@ -25476,7 +25485,7 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "wfpt.pyx":430 - * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0): @@ -25506,8 +25515,8 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_9); /* "wfpt.pyx":429 - * - * + * + * * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -25574,8 +25583,8 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); /* "wfpt.pyx":462 - * - * + * + * * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< * np.ndarray[long, ndim=1] response, * np.ndarray[double, ndim=1] feedback, @@ -25625,8 +25634,8 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); /* "wfpt.pyx":508 - * - * + * + * * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< * np.ndarray[float, ndim=2] rl_arr, * np.ndarray[double, ndim=1] x, @@ -25678,7 +25687,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":588 * return sum_logp - * + * * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< * double sv, double a, double z, double sz, double t, double st, double t_min, * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, @@ -25706,7 +25715,7 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "wfpt.pyx":620 - * + * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< * double p_outlier=0, double w_outlier=0): @@ -25741,7 +25750,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":619 * return sum_logp - * + * * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, * double p_outlier=0, double w_outlier=0): @@ -25781,10 +25790,10 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "wfpt.pyx":647 - * - * + * + * * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< - * + * * # get length of data */ __Pyx_TraceLine(647,0,__PYX_ERR(0, 647, __pyx_L1_error)) @@ -25794,7 +25803,7 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "wfpt.pyx":666 - * + * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, * double p_outlier = 0, # <<<<<<<<<<<<<< * double w_outlier = 0, @@ -25817,7 +25826,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":665 * return (x_lb, lb, x_ub, ub) - * + * * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, @@ -25842,7 +25851,7 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "wfpt.pyx":687 - * + * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, * double p_outlier = 0, # <<<<<<<<<<<<<< * double w_outlier = 0, @@ -25865,7 +25874,7 @@ if (!__Pyx_RefNanny) { /* "wfpt.pyx":686 * return log_p - * + * * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< * double p_outlier = 0, * double w_outlier = 0, @@ -28156,7 +28165,7 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long int const long b = intval; long x; long a = PyInt_AS_LONG(op1); - + x = (long)((unsigned long)a - (unsigned long)b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); @@ -28256,8 +28265,8 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long int llx = lla - llb; return PyLong_FromLongLong(llx); #endif - - + + } #endif if (PyFloat_CheckExact(op1)) { @@ -28268,7 +28277,7 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long int double a = PyFloat_AS_DOUBLE(op1); #endif double result; - + PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) @@ -28289,7 +28298,7 @@ static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, const long a = intval; long x; long b = PyInt_AS_LONG(op2); - + x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); @@ -28389,8 +28398,8 @@ static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, llx = lla + llb; return PyLong_FromLongLong(llx); #endif - - + + } #endif if (PyFloat_CheckExact(op2)) { @@ -28401,7 +28410,7 @@ static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, double b = PyFloat_AS_DOUBLE(op2); #endif double result; - + PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) From 1b43b89a06f7fb96ad389a2b27e83662847b75f7 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Fri, 8 Sep 2023 13:19:04 -0400 Subject: [PATCH 07/14] remove cython files --- src/hssm/likelihoods/hddm_wfpt/__init__.py | 4 - src/hssm/likelihoods/hddm_wfpt/cdfdif.c | 221 - src/hssm/likelihoods/hddm_wfpt/cdfdif.h | 1 - .../likelihoods/hddm_wfpt/cdfdif_wrapper.c | 11915 ------ .../likelihoods/hddm_wfpt/cdfdif_wrapper.pyx | 53 - src/hssm/likelihoods/hddm_wfpt/integrate.pxi | 206 - src/hssm/likelihoods/hddm_wfpt/pdf.pxi | 146 - src/hssm/likelihoods/hddm_wfpt/wfpt.cpp | 31774 ---------------- src/hssm/likelihoods/hddm_wfpt/wfpt.pyx | 705 - 9 files changed, 45025 deletions(-) delete mode 100644 src/hssm/likelihoods/hddm_wfpt/__init__.py delete mode 100644 src/hssm/likelihoods/hddm_wfpt/cdfdif.c delete mode 100644 src/hssm/likelihoods/hddm_wfpt/cdfdif.h delete mode 100644 src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c delete mode 100644 src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx delete mode 100644 src/hssm/likelihoods/hddm_wfpt/integrate.pxi delete mode 100644 src/hssm/likelihoods/hddm_wfpt/pdf.pxi delete mode 100644 src/hssm/likelihoods/hddm_wfpt/wfpt.cpp delete mode 100644 src/hssm/likelihoods/hddm_wfpt/wfpt.pyx diff --git a/src/hssm/likelihoods/hddm_wfpt/__init__.py b/src/hssm/likelihoods/hddm_wfpt/__init__.py deleted file mode 100644 index 121a7990..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""The HDDM wfpt likelihood function.""" - - -import wfpt # noqa: F401 diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif.c b/src/hssm/likelihoods/hddm_wfpt/cdfdif.c deleted file mode 100644 index 04ac2467..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/cdfdif.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - Name: cdfdif.c - Copyright: Academic use - Author: Joachim Vandekerckhove - Department of Psychology - Katholieke Universiteit Leuven - Belgium - email: joachim.vandekerckhove@psy.kuleuven.be - Date: The generating algorithm was written on 09/01/06 - Description: Computes Cumulative Distribution Function for the Diffusion - model with random trial to trial mean drift (normal), starting - point and non-decision (ter) time (both rectangular). - Uses 6 quadrature points for drift and 6 for the others. - Based on methods described in: - Tuerlinckx, F. (2004). The efficient computation of the - cumulative distribution and probability density functions - in the diffusion model, Behavior Research Methods, - Instruments, & Computers, 36 (4), 702-716. - - */ - -#include -#include -//#include -//#include - -#define PI 3.1415926535897932384626433832795028841971693993751 - - -//double cdfdif(double t, int x, double *par, double *prob); -//void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]); -//double fabs(double a) { return a>0 ? a : -a; } - -/* void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) */ -/* { */ -/* double *p, *nwp, *x, *t, *y, *pr, nonzero = 1e-10; */ -/* int nt,i; */ - -/* t = mxGetPr(prhs[0]); */ -/* x = mxGetPr(prhs[1]); */ -/* p = mxGetPr(prhs[2]); */ -/* nt = mxGetN(prhs[0]); */ - -/* nwp = malloc(7*sizeof(double)); */ -/* for(i=0;i<7;i++) nwp[i]=p[i]; */ - -/* plhs[0] = mxCreateDoubleMatrix(1,nt, mxREAL); */ -/* plhs[1] = mxCreateDoubleMatrix(1,1, mxREAL); */ -/* y = mxGetPr(plhs[0]); */ -/* pr = mxGetPr(plhs[1]); */ - -/* if (nwp[2]epsilon) /* test for gk(m) being close to zero */ - { - sum_nu+=(exp(-200*gz[i]*gk[m])-1)/(exp(-200*a*gk[m])-1)*w_gh[m]; - } - else - { - sum_nu+=gz[i]/a*w_gh[m]; - } - } - sum_z+=sum_nu*w_g[i]/2; - } - *prob=sum_z; - /* end of prob */ - - if (t-Ter+st/2>min_RT)/* is t larger than lower boundary Ter distribution? */ - { - upper_t = tTer+st/2) /* is t larger than upper boundary Ter distribution? */ - { - sum_hist[0] = 0; - sum_hist[1] = 0; - sum_hist[2] = 0; - for (v=0;v0)) - break; - } - Fnew=(p0*(1-x)+p1*x)-sum_hist[2]*4*PI/(a2*sZ*st); - /* cumulative distribution function for t and x */ - } - else if (t<=Ter+st/2) /* is t lower than upper boundary Ter distribution? */ - { - sum_nu=0; - for (m=0;mepsilon) - { - sum_z=0; - for (i=0;i0)) - break; - } - sum_z+=.5*w_g[i]*(ser-4*sum_hist[2])*(PI/100)/ - (a2*st)*exp((2*x-1)*zzz*gk[m]*100); - } - } - else - { - sum_hist[0] = 0; - sum_hist[1] = 0; - sum_hist[2] = 0; - su=-(Z_U*Z_U)/(12*a2)+(Z_U*Z_U*Z_U)/ - (12*a*a2)-(Z_U*Z_U*Z_U*Z_U)/(48*a2*a2); - sl=-(Z_L*Z_L)/(12*a2)+(Z_L*Z_L*Z_L)/ - (12*a*a2)-(Z_L*Z_L*Z_L*Z_L)/(48*a2*a2); - for (v=1;v0)) - break; - } - sum_z=400*a2*a*(sl-su-sum_hist[2])/(st*sZ); - } - sum_nu+=sum_z*w_gh[m]; - } - Fnew=(p0*(1-x)+p1*x)-sum_nu; - } - } - else if (t-Ter+st/2<=min_RT) /* is t lower than lower boundary Ter distr? */ - { - Fnew=0; - } - - Fnew = Fnew>delta ? Fnew : 0; - - return Fnew; -} diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif.h b/src/hssm/likelihoods/hddm_wfpt/cdfdif.h deleted file mode 100644 index 6c5b1e61..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/cdfdif.h +++ /dev/null @@ -1 +0,0 @@ -double cdfdif(double t, int x, double *par, double *prob); diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c deleted file mode 100644 index f3f4fb4b..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c +++ /dev/null @@ -1,11915 +0,0 @@ -/* Generated by Cython 3.0.2 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayscalars.h", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ufuncobject.h", - "src/hssm/likelihoods/hddm_wfpt/cdfdif.h" - ], - "include_dirs": [ - "src/hssm/likelihoods/hddm_wfpt", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include" - ], - "name": "cdfdif_wrapper", - "sources": [ - "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx", - "src/hssm/likelihoods/hddm_wfpt/cdfdif.c" - ] - }, - "module_name": "cdfdif_wrapper" -} -END: Cython Metadata */ - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif -#endif - -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" -#else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_2" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030002F0 -#define CYTHON_FUTURE_DIVISION 1 -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX -#if defined(GRAALVM_PYTHON) - /* For very preliminary testing purposes. Most variables are set the same as PyPy. - The existence of this section does not imply that anything works or is even tested */ - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PYPY_VERSION) - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #if PY_VERSION_HEX < 0x03090000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(CYTHON_LIMITED_API) - #ifdef Py_LIMITED_API - #undef __PYX_LIMITED_VERSION_HEX - #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API - #endif - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 1 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 1 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #endif - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PY_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #ifndef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 1 - #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) - #endif - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #if PY_VERSION_HEX < 0x030600B1 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) - #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) - #define CYTHON_USE_EXC_INFO_STACK 1 - #endif - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif -#endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) -#endif -#if !defined(CYTHON_VECTORCALL) -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) -#endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif - #undef SHIFT - #undef BASE - #undef MASK - #ifdef SIZEOF_VOID_P - enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; - #endif -#endif -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif -#ifndef __has_cpp_attribute - #define __has_cpp_attribute(x) 0 -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifndef CYTHON_UNUSED - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(maybe_unused) - #define CYTHON_UNUSED [[maybe_unused]] - #endif - #endif - #endif -#endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_UNUSED_VAR -# if defined(__cplusplus) - template void CYTHON_UNUSED_VAR( const T& ) { } -# else -# define CYTHON_UNUSED_VAR(x) (void)(x) -# endif -#endif -#ifndef CYTHON_MAYBE_UNUSED_VAR - #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_USE_CPP_STD_MOVE - #if defined(__cplusplus) && (\ - __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) - #define CYTHON_USE_CPP_STD_MOVE 1 - #else - #define CYTHON_USE_CPP_STD_MOVE 0 - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif -#ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] - #endif - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_attribute(fallthrough) - #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) - #else - #define CYTHON_FALLTHROUGH - #endif - #endif - #if defined(__clang__) && defined(__apple_build_version__) - #if __apple_build_version__ < 7000000 - #undef CYTHON_FALLTHROUGH - #define CYTHON_FALLTHROUGH - #endif - #endif -#endif -#ifdef __cplusplus - template - struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; - #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) -#else - #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) -#endif -#if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) -#else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) -#endif -#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) - -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #elif defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type -#if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - PyObject *version_info; // borrowed - PyObject *py_minor_version = NULL; - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } - #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 - #endif - #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 - #endif - #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 - #endif - #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 - #endif - #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 - #endif - #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 - #endif - #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 - #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#endif -#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) - #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) -#else - #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) - #define __Pyx_Py_Is(x, y) Py_Is(x, y) -#else - #define __Pyx_Py_Is(x, y) ((x) == (y)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) - #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) -#else - #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) - #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) -#else - #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) - #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) -#else - #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) -#endif -#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) -#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) -#else - #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) -#endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#ifndef Py_TPFLAGS_SEQUENCE - #define Py_TPFLAGS_SEQUENCE 0 -#endif -#ifndef Py_TPFLAGS_MAPPING - #define Py_TPFLAGS_MAPPING 0 -#endif -#ifndef METH_STACKLESS - #define METH_STACKLESS 0 -#endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) - #ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - #endif - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); - typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords -#endif -#if CYTHON_METH_FASTCALL - #define __Pyx_METH_FASTCALL METH_FASTCALL - #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast - #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords -#else - #define __Pyx_METH_FASTCALL METH_VARARGS - #define __Pyx_PyCFunction_FastCall PyCFunction - #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords -#endif -#if CYTHON_VECTORCALL - #define __pyx_vectorcallfunc vectorcallfunc - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET - #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) -#else - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) -#endif -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) - typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); -#else - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) - #define __Pyx_PyCMethod PyCMethod -#endif -#ifndef METH_METHOD - #define METH_METHOD 0x200 -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyThreadState_Current PyThreadState_Get() -#elif !CYTHON_FAST_THREAD_STATE - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#else - #define __Pyx_PyThreadState_Current _PyThreadState_Current -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) -{ - void *result; - result = PyModule_GetState(op); - if (!result) - Py_FatalError("Couldn't find the module state"); - return result; -} -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) -#else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif -#endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) -#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) -#else -#define __Pyx_PyDict_NewPresized(n) PyDict_New() -#endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS -#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { - PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); - if (res == NULL) PyErr_Clear(); - return res; -} -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) -#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#else -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { -#if CYTHON_COMPILING_IN_PYPY - return PyDict_GetItem(dict, name); -#else - PyDictEntry *ep; - PyDictObject *mp = (PyDictObject*) dict; - long hash = ((PyStringObject *) name)->ob_shash; - assert(hash != -1); - ep = (mp->ma_lookup)(mp, name, hash); - if (ep == NULL) { - return NULL; - } - return ep->me_value; -#endif -} -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#endif -#if CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) - #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) -#else - #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) - #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) -#endif -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 -#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ - assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ - PyObject_GC_Del(obj);\ - Py_DECREF(type);\ -} -#else -#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) - #define __Pyx_PyUnicode_DATA(u) ((void*)u) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_READY(op) (0) - #else - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) - #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) - #else - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #if !defined(PyUnicode_DecodeUnicodeEscape) - #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) - #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) - #endif - #if !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) - #endif - #if !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) - #endif -#endif -#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)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#if CYTHON_COMPILING_IN_CPYTHON - #define __Pyx_PySequence_ListKeepNew(obj)\ - (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) -#else - #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) -#endif -#if PY_VERSION_HEX >= 0x030900A4 - #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) -#else - #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) -#endif -#if CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) - #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) - #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) - #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) - #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) - #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) - #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) - #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) -#else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) - #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) - #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) - #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) - #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) - #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif -#else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef __Pyx_PyAsyncMethodsStruct - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - } __Pyx_PyAsyncMethodsStruct; -#endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ - { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } - -#ifdef CYTHON_EXTERN_C - #undef __PYX_EXTERN_C - #define __PYX_EXTERN_C CYTHON_EXTERN_C -#elif defined(__PYX_EXTERN_C) - #ifdef _MSC_VER - #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") - #else - #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. - #endif -#else - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__cdfdif_wrapper -#define __PYX_HAVE_API__cdfdif_wrapper -/* Early includes */ -#include -#include - - /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */ - -#include "numpy/arrayobject.h" -#include "numpy/ndarrayobject.h" -#include "numpy/ndarraytypes.h" -#include "numpy/arrayscalars.h" -#include "numpy/ufuncobject.h" -#include "cdfdif.h" -#include "math.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { - return (size_t) i < (size_t) limit; -} -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) - #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif -#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -#define __Pyx_PySequence_Tuple(obj)\ - (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); -#if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_VERSION_HEX >= 0x030C00A7 - #ifndef _PyLong_SIGN_MASK - #define _PyLong_SIGN_MASK 3 - #endif - #ifndef _PyLong_NON_SIZE_BITS - #define _PyLong_NON_SIZE_BITS 3 - #endif - #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) - #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) - #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) - #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) - #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_SignedDigitCount(x)\ - ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) - #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) - #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) - #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) - #else - #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) - #endif - typedef Py_ssize_t __Pyx_compact_pylong; - typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 - #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) - #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) - #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) - #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) - #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) - #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) - #define __Pyx_PyLong_CompactValue(x)\ - ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) - typedef sdigit __Pyx_compact_pylong; - typedef digit __Pyx_compact_upylong; - #endif - #if PY_VERSION_HEX >= 0x030C00A5 - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) - #else - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) - #endif -#endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ -static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } - -#if !CYTHON_USE_MODULE_STATE -static PyObject *__pyx_m = NULL; -#endif -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; -static const char *__pyx_filename; - -/* Header.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif -#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) - #undef _Complex_I - #define _Complex_I 1.0fj -#endif - -/* #### Code section: filename_table ### */ - -static const char *__pyx_f[] = { - "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx", - "__init__.cython-30.pxd", - "type.pxd", -}; -/* #### Code section: utility_code_proto_before_types ### */ -/* NoFastGil.proto */ -#define __Pyx_PyGILState_Ensure PyGILState_Ensure -#define __Pyx_PyGILState_Release PyGILState_Release -#define __Pyx_FastGIL_Remember() -#define __Pyx_FastGIL_Forget() -#define __Pyx_FastGilFuncInit() - -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif - -/* BufferFormatStructs.proto */ -struct __Pyx_StructField_; -#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) -typedef struct { - const char* name; - struct __Pyx_StructField_* fields; - size_t size; - size_t arraysize[8]; - int ndim; - char typegroup; - char is_unsigned; - int flags; -} __Pyx_TypeInfo; -typedef struct __Pyx_StructField_ { - __Pyx_TypeInfo* type; - const char* name; - size_t offset; -} __Pyx_StructField; -typedef struct { - __Pyx_StructField* field; - size_t parent_offset; -} __Pyx_BufFmt_StackElem; -typedef struct { - __Pyx_StructField root; - __Pyx_BufFmt_StackElem* head; - size_t fmt_offset; - size_t new_count, enc_count; - size_t struct_alignment; - int is_complex; - char enc_type; - char new_packmode; - char enc_packmode; - char is_valid_array; -} __Pyx_BufFmt_Context; - -/* #### Code section: numeric_typedefs ### */ - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 - * ctypedef npy_double float_t - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cfloat cfloat_t - */ -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -/* #### Code section: complex_type_declarations ### */ -/* Declarations.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* Declarations.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* #### Code section: type_declarations ### */ - -/*--- Type declarations ---*/ - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* #### Code section: utility_code_proto ### */ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, Py_ssize_t); - void (*DECREF)(void*, PyObject*, Py_ssize_t); - void (*GOTREF)(void*, PyObject*, Py_ssize_t); - void (*GIVEREF)(void*, PyObject*, Py_ssize_t); - void* (*SetupContext)(const char*, Py_ssize_t, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - } - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContextNogil() - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_Py_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; Py_XDECREF(tmp);\ - } while (0) -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#if PY_VERSION_HEX >= 0x030C00A6 -#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) -#else -#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) -#endif -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) -#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif -#else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* TupleAndListFromArray.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); -static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); -#endif - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* fastcall.proto */ -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) -#elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) -#else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed -#endif -#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) -#define __Pyx_KwValues_VARARGS(args, nargs) NULL -#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) -#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) -#if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) - #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) - static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); - #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array -#else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS - #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS - #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS - #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS - #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) -#endif - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* ArgTypeTest.proto */ -#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ - ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ - __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); - -/* IsLittleEndian.proto */ -static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); - -/* BufferFormatCheck.proto */ -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); - -/* BufferGetAndValidate.proto */ -#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ - ((obj == Py_None || obj == NULL) ?\ - (__Pyx_ZeroBuffer(buf), 0) :\ - __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) -static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, - __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); -static void __Pyx_ZeroBuffer(Py_buffer* buf); -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; -static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - -/* AssertionsEnabled.proto */ -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define __Pyx_init_assertions_enabled() (0) - #define __pyx_assertions_enabled() (1) -#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) - static int __pyx_assertions_enabled_flag; - #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) - static int __Pyx_init_assertions_enabled(void) { - PyObject *builtins, *debug, *debug_str; - int flag; - builtins = PyEval_GetBuiltins(); - if (!builtins) goto bad; - debug_str = PyUnicode_FromStringAndSize("__debug__", 9); - if (!debug_str) goto bad; - debug = PyObject_GetItem(builtins, debug_str); - Py_DECREF(debug_str); - if (!debug) goto bad; - flag = PyObject_IsTrue(debug); - Py_DECREF(debug); - if (flag == -1) goto bad; - __pyx_assertions_enabled_flag = flag; - return 0; - bad: - __pyx_assertions_enabled_flag = 1; - return -1; - } -#else - #define __Pyx_init_assertions_enabled() (0) - #define __pyx_assertions_enabled() (!Py_OptimizeFlag) -#endif - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif - -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) do {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif - -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectFastCall.proto */ -#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* BufferIndexError.proto */ -static void __Pyx_RaiseBufferIndexError(int axis); - -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) -/* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_2 -#define __PYX_HAVE_RT_ImportType_proto_3_0_2 -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#include -#endif -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_2(s) alignof(s) -#else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_2(s) sizeof(void*) -#endif -enum __Pyx_ImportType_CheckSize_3_0_2 { - __Pyx_ImportType_CheckSize_Error_3_0_2 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_2 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_2 = 2 -}; -static PyTypeObject *__Pyx_ImportType_3_0_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_2 check_size); -#endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif - -/* IncludeStructmemberH.proto */ -#include - -/* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif - -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); - -/* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif - -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif - -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); -#endif - -/* CythonFunctionShared.proto */ -#define __Pyx_CyFunction_USED -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CYFUNCTION_COROUTINE 0x08 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#else - #define __Pyx_CyFunction_GetClassObj(f)\ - ((PyObject*) ((PyCMethodObject *) (f))->mm_class) -#endif -#define __Pyx_CyFunction_SetClassObj(f, classobj)\ - __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject_HEAD - PyObject *func; -#elif PY_VERSION_HEX < 0x030900B1 - PyCFunctionObject func; -#else - PyCMethodObject func; -#endif -#if CYTHON_BACKPORT_VECTORCALL - __pyx_vectorcallfunc func_vectorcall; -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - PyObject *func_classobj; -#endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; - PyObject *func_is_coroutine; -} __pyx_CyFunctionObject; -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(PyObject *module); -#if CYTHON_METH_FASTCALL -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL -#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) -#else -#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) -#endif -#endif - -/* CythonFunction.proto */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); - -/* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); -#endif - -/* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* BufferStructDeclare.proto */ -typedef struct { - Py_ssize_t shape, strides, suboffsets; -} __Pyx_Buf_DimInfo; -typedef struct { - size_t refcount; - Py_buffer pybuffer; -} __Pyx_Buffer; -typedef struct { - __Pyx_Buffer *rcbuffer; - char *data; - __Pyx_Buf_DimInfo diminfo[8]; -} __Pyx_LocalBuf_ND; - -#if PY_MAJOR_VERSION < 3 - static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); - static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else - #define __Pyx_GetBuffer PyObject_GetBuffer - #define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - - -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - -/* RealImag.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX\ - && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) - #define __Pyx_SET_CREAL(z,x) ((z).real(x)) - #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) -#else - #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) - #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) -#endif - -/* Arithmetic.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #define __Pyx_c_eq_float(a, b) ((a)==(b)) - #define __Pyx_c_sum_float(a, b) ((a)+(b)) - #define __Pyx_c_diff_float(a, b) ((a)-(b)) - #define __Pyx_c_prod_float(a, b) ((a)*(b)) - #define __Pyx_c_quot_float(a, b) ((a)/(b)) - #define __Pyx_c_neg_float(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero_float(z) ((z)==(float)0) - #define __Pyx_c_conj_float(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs_float(z) (::std::abs(z)) - #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero_float(z) ((z)==0) - #define __Pyx_c_conj_float(z) (conjf(z)) - #if 1 - #define __Pyx_c_abs_float(z) (cabsf(z)) - #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); - #if 1 - static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); - #endif -#endif - -/* Arithmetic.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #define __Pyx_c_eq_double(a, b) ((a)==(b)) - #define __Pyx_c_sum_double(a, b) ((a)+(b)) - #define __Pyx_c_diff_double(a, b) ((a)-(b)) - #define __Pyx_c_prod_double(a, b) ((a)*(b)) - #define __Pyx_c_quot_double(a, b) ((a)/(b)) - #define __Pyx_c_neg_double(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero_double(z) ((z)==(double)0) - #define __Pyx_c_conj_double(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs_double(z) (::std::abs(z)) - #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero_double(z) ((z)==0) - #define __Pyx_c_conj_double(z) (conj(z)) - #if 1 - #define __Pyx_c_abs_double(z) (cabs(z)) - #define __Pyx_c_pow_double(a, b) (cpow(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); - #if 1 - static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); - #endif -#endif - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* FormatTypeName.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -typedef PyObject *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); -#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) -#else -typedef const char *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) -#define __Pyx_DECREF_TypeName(obj) -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* FastTypeChecks.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); -#else -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) -#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) -#endif -#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - -/* #### Code section: module_declarations ### */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/ - -/* Module declarations from "libc.string" */ - -/* Module declarations from "libc.stdio" */ - -/* Module declarations from "__builtin__" */ - -/* Module declarations from "cpython.type" */ - -/* Module declarations from "cpython" */ - -/* Module declarations from "cpython.object" */ - -/* Module declarations from "cpython.ref" */ - -/* Module declarations from "numpy" */ - -/* Module declarations from "numpy" */ - -/* Module declarations from "cdfdif_wrapper" */ -static CYTHON_INLINE double __pyx_f_14cdfdif_wrapper_add_outlier_cdf(double, double, double, double); /*proto*/ -static CYTHON_INLINE int __pyx_f_14cdfdif_wrapper_p_outlier_in_range(double); /*proto*/ -/* #### Code section: typeinfo ### */ -static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; -/* #### Code section: before_global_var ### */ -#define __Pyx_MODULE_NAME "cdfdif_wrapper" -extern int __pyx_module_is_main_cdfdif_wrapper; -int __pyx_module_is_main_cdfdif_wrapper = 0; - -/* Implementation of "cdfdif_wrapper" */ -/* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_AssertionError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_ImportError; -/* #### Code section: string_decls ### */ -static const char __pyx_k_a[] = "a"; -static const char __pyx_k_i[] = "i"; -static const char __pyx_k_t[] = "t"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k_x[] = "x"; -static const char __pyx_k_y[] = "y"; -static const char __pyx_k_z[] = "z"; -static const char __pyx_k__6[] = "*"; -static const char __pyx_k__8[] = "?"; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_st[] = "st"; -static const char __pyx_k_sv[] = "sv"; -static const char __pyx_k_sz[] = "sz"; -static const char __pyx_k_abs[] = "abs"; -static const char __pyx_k_max[] = "max"; -static const char __pyx_k_epsi[] = "epsi"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_sign[] = "sign"; -static const char __pyx_k_size[] = "size"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_dtype[] = "dtype"; -static const char __pyx_k_empty[] = "empty"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_double[] = "double"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_params[] = "params"; -static const char __pyx_k_boundary[] = "boundary"; -static const char __pyx_k_p_outlier[] = "p_outlier"; -static const char __pyx_k_w_outlier[] = "w_outlier"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_p_boundary[] = "p_boundary"; -static const char __pyx_k_ImportError[] = "ImportError"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_AssertionError[] = "AssertionError"; -static const char __pyx_k_cdfdif_wrapper[] = "cdfdif_wrapper"; -static const char __pyx_k_dmat_cdf_array[] = "dmat_cdf_array"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; -static const char __pyx_k_1_2_w_outlier_must_be_smaller_th[] = "1. / (2*w_outlier) must be smaller than RT"; -static const char __pyx_k_at_least_one_of_the_parameters_i[] = "at least one of the parameters is out of the support"; -static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; -static const char __pyx_k_src_hssm_likelihoods_hddm_wfpt_c[] = "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx"; -/* #### Code section: decls ### */ -static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -/* #### Code section: late_includes ### */ -/* #### Code section: module_state ### */ -typedef struct { - PyObject *__pyx_d; - PyObject *__pyx_b; - PyObject *__pyx_cython_runtime; - PyObject *__pyx_empty_tuple; - PyObject *__pyx_empty_bytes; - PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_4type_type; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_5numpy_dtype; - PyTypeObject *__pyx_ptype_5numpy_flatiter; - PyTypeObject *__pyx_ptype_5numpy_broadcast; - PyTypeObject *__pyx_ptype_5numpy_ndarray; - PyTypeObject *__pyx_ptype_5numpy_generic; - PyTypeObject *__pyx_ptype_5numpy_number; - PyTypeObject *__pyx_ptype_5numpy_integer; - PyTypeObject *__pyx_ptype_5numpy_signedinteger; - PyTypeObject *__pyx_ptype_5numpy_unsignedinteger; - PyTypeObject *__pyx_ptype_5numpy_inexact; - PyTypeObject *__pyx_ptype_5numpy_floating; - PyTypeObject *__pyx_ptype_5numpy_complexfloating; - PyTypeObject *__pyx_ptype_5numpy_flexible; - PyTypeObject *__pyx_ptype_5numpy_character; - PyTypeObject *__pyx_ptype_5numpy_ufunc; - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_kp_u_1_2_w_outlier_must_be_smaller_th; - PyObject *__pyx_n_s_AssertionError; - PyObject *__pyx_n_s_ImportError; - PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_n_s__6; - PyObject *__pyx_n_s__8; - PyObject *__pyx_n_s_a; - PyObject *__pyx_n_s_abs; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_kp_u_at_least_one_of_the_parameters_i; - PyObject *__pyx_n_s_boundary; - PyObject *__pyx_n_s_cdfdif_wrapper; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_dmat_cdf_array; - PyObject *__pyx_n_s_double; - PyObject *__pyx_n_s_dtype; - PyObject *__pyx_n_s_empty; - PyObject *__pyx_n_s_epsi; - PyObject *__pyx_n_s_i; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_max; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_np; - PyObject *__pyx_n_s_numpy; - PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; - PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; - PyObject *__pyx_n_s_p_boundary; - PyObject *__pyx_n_s_p_outlier; - PyObject *__pyx_n_s_params; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_sign; - PyObject *__pyx_n_s_size; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c; - PyObject *__pyx_n_s_st; - PyObject *__pyx_n_s_sv; - PyObject *__pyx_n_s_sz; - PyObject *__pyx_n_s_t; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_v; - PyObject *__pyx_n_s_w_outlier; - PyObject *__pyx_n_s_x; - PyObject *__pyx_n_s_y; - PyObject *__pyx_n_s_z; - PyObject *__pyx_tuple_; - PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__4; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__7; - PyObject *__pyx_codeobj__3; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc); - Py_CLEAR(clear_module_state->__pyx_kp_u_1_2_w_outlier_must_be_smaller_th); - Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); - Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); - Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_n_s__6); - Py_CLEAR(clear_module_state->__pyx_n_s__8); - Py_CLEAR(clear_module_state->__pyx_n_s_a); - Py_CLEAR(clear_module_state->__pyx_n_s_abs); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_kp_u_at_least_one_of_the_parameters_i); - Py_CLEAR(clear_module_state->__pyx_n_s_boundary); - Py_CLEAR(clear_module_state->__pyx_n_s_cdfdif_wrapper); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_dmat_cdf_array); - Py_CLEAR(clear_module_state->__pyx_n_s_double); - Py_CLEAR(clear_module_state->__pyx_n_s_dtype); - Py_CLEAR(clear_module_state->__pyx_n_s_empty); - Py_CLEAR(clear_module_state->__pyx_n_s_epsi); - Py_CLEAR(clear_module_state->__pyx_n_s_i); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_max); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_np); - Py_CLEAR(clear_module_state->__pyx_n_s_numpy); - Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); - Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); - Py_CLEAR(clear_module_state->__pyx_n_s_p_boundary); - Py_CLEAR(clear_module_state->__pyx_n_s_p_outlier); - Py_CLEAR(clear_module_state->__pyx_n_s_params); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_sign); - Py_CLEAR(clear_module_state->__pyx_n_s_size); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c); - Py_CLEAR(clear_module_state->__pyx_n_s_st); - Py_CLEAR(clear_module_state->__pyx_n_s_sv); - Py_CLEAR(clear_module_state->__pyx_n_s_sz); - Py_CLEAR(clear_module_state->__pyx_n_s_t); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_v); - Py_CLEAR(clear_module_state->__pyx_n_s_w_outlier); - Py_CLEAR(clear_module_state->__pyx_n_s_x); - Py_CLEAR(clear_module_state->__pyx_n_s_y); - Py_CLEAR(clear_module_state->__pyx_n_s_z); - Py_CLEAR(clear_module_state->__pyx_tuple_); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__4); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_codeobj__3); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif - Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc); - Py_VISIT(traverse_module_state->__pyx_kp_u_1_2_w_outlier_must_be_smaller_th); - Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); - Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); - Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_n_s__6); - Py_VISIT(traverse_module_state->__pyx_n_s__8); - Py_VISIT(traverse_module_state->__pyx_n_s_a); - Py_VISIT(traverse_module_state->__pyx_n_s_abs); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_kp_u_at_least_one_of_the_parameters_i); - Py_VISIT(traverse_module_state->__pyx_n_s_boundary); - Py_VISIT(traverse_module_state->__pyx_n_s_cdfdif_wrapper); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_dmat_cdf_array); - Py_VISIT(traverse_module_state->__pyx_n_s_double); - Py_VISIT(traverse_module_state->__pyx_n_s_dtype); - Py_VISIT(traverse_module_state->__pyx_n_s_empty); - Py_VISIT(traverse_module_state->__pyx_n_s_epsi); - Py_VISIT(traverse_module_state->__pyx_n_s_i); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_max); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_np); - Py_VISIT(traverse_module_state->__pyx_n_s_numpy); - Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); - Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); - Py_VISIT(traverse_module_state->__pyx_n_s_p_boundary); - Py_VISIT(traverse_module_state->__pyx_n_s_p_outlier); - Py_VISIT(traverse_module_state->__pyx_n_s_params); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_sign); - Py_VISIT(traverse_module_state->__pyx_n_s_size); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c); - Py_VISIT(traverse_module_state->__pyx_n_s_st); - Py_VISIT(traverse_module_state->__pyx_n_s_sv); - Py_VISIT(traverse_module_state->__pyx_n_s_sz); - Py_VISIT(traverse_module_state->__pyx_n_s_t); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_v); - Py_VISIT(traverse_module_state->__pyx_n_s_w_outlier); - Py_VISIT(traverse_module_state->__pyx_n_s_x); - Py_VISIT(traverse_module_state->__pyx_n_s_y); - Py_VISIT(traverse_module_state->__pyx_n_s_z); - Py_VISIT(traverse_module_state->__pyx_tuple_); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__4); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_codeobj__3); - return 0; -} -#endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype -#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter -#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast -#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray -#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic -#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number -#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer -#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger -#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger -#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact -#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating -#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating -#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible -#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character -#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_kp_u_1_2_w_outlier_must_be_smaller_th __pyx_mstate_global->__pyx_kp_u_1_2_w_outlier_must_be_smaller_th -#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError -#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError -#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 -#define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8 -#define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a -#define __pyx_n_s_abs __pyx_mstate_global->__pyx_n_s_abs -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_kp_u_at_least_one_of_the_parameters_i __pyx_mstate_global->__pyx_kp_u_at_least_one_of_the_parameters_i -#define __pyx_n_s_boundary __pyx_mstate_global->__pyx_n_s_boundary -#define __pyx_n_s_cdfdif_wrapper __pyx_mstate_global->__pyx_n_s_cdfdif_wrapper -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_dmat_cdf_array __pyx_mstate_global->__pyx_n_s_dmat_cdf_array -#define __pyx_n_s_double __pyx_mstate_global->__pyx_n_s_double -#define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype -#define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty -#define __pyx_n_s_epsi __pyx_mstate_global->__pyx_n_s_epsi -#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np -#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy -#define __pyx_kp_u_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy_core_multiarray_failed_to -#define __pyx_kp_u_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_u_numpy_core_umath_failed_to_impor -#define __pyx_n_s_p_boundary __pyx_mstate_global->__pyx_n_s_p_boundary -#define __pyx_n_s_p_outlier __pyx_mstate_global->__pyx_n_s_p_outlier -#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_sign __pyx_mstate_global->__pyx_n_s_sign -#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c __pyx_mstate_global->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c -#define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st -#define __pyx_n_s_sv __pyx_mstate_global->__pyx_n_s_sv -#define __pyx_n_s_sz __pyx_mstate_global->__pyx_n_s_sz -#define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v -#define __pyx_n_s_w_outlier __pyx_mstate_global->__pyx_n_s_w_outlier -#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x -#define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y -#define __pyx_n_s_z __pyx_mstate_global->__pyx_n_s_z -#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 -/* #### Code section: module_code ### */ - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * - * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { - PyObject *__pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("base", __pyx_f[1], 245, 1, __PYX_ERR(1, 245, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248 - * """Returns a borrowed reference to the object owning the data/memory. - * """ - * return PyArray_BASE(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(248,1,__PYX_ERR(1, 248, __pyx_L1_error)) - __pyx_r = PyArray_BASE(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * - * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.base.base", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * - * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ - */ - -static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) { - PyArray_Descr *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyArray_Descr *__pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("descr", 0); - __Pyx_TraceCall("descr", __pyx_f[1], 251, 0, __PYX_ERR(1, 251, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254 - * """Returns an owned reference to the dtype of the array. - * """ - * return PyArray_DESCR(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error)) - __Pyx_XDECREF((PyObject *)__pyx_r); - __pyx_t_1 = PyArray_DESCR(__pyx_v_self); - __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1)); - __pyx_r = ((PyArray_Descr *)__pyx_t_1); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * - * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.ndarray.descr.descr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * - * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ - */ - -static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { - int __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("ndim", __pyx_f[1], 257, 1, __PYX_ERR(1, 257, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260 - * """Returns the number of dimensions in the array. - * """ - * return PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(260,1,__PYX_ERR(1, 260, __pyx_L1_error)) - __pyx_r = PyArray_NDIM(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * - * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.ndim.ndim", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * - * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { - npy_intp *__pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("shape", __pyx_f[1], 263, 1, __PYX_ERR(1, 263, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268 - * Can return NULL for 0-dimensional arrays. - * """ - * return PyArray_DIMS(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(268,1,__PYX_ERR(1, 268, __pyx_L1_error)) - __pyx_r = PyArray_DIMS(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * - * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.shape.shape", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * - * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { - npy_intp *__pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("strides", __pyx_f[1], 271, 1, __PYX_ERR(1, 271, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275 - * The number of elements matches the number of dimensions of the array (ndim). - * """ - * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(275,1,__PYX_ERR(1, 275, __pyx_L1_error)) - __pyx_r = PyArray_STRIDES(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * - * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.strides.strides", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * - * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ - */ - -static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { - npy_intp __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("size", __pyx_f[1], 278, 1, __PYX_ERR(1, 278, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281 - * """Returns the total size (in number of elements) of the array. - * """ - * return PyArray_SIZE(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(281,1,__PYX_ERR(1, 281, __pyx_L1_error)) - __pyx_r = PyArray_SIZE(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * - * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.size.size", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * - * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { - char *__pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("data", __pyx_f[1], 284, 1, __PYX_ERR(1, 284, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290 - * of `PyArray_DATA()` instead, which returns a 'void*'. - * """ - * return PyArray_BYTES(self) # <<<<<<<<<<<<<< - * - * ctypedef unsigned char npy_bool - */ - __Pyx_TraceLine(290,1,__PYX_ERR(1, 290, __pyx_L1_error)) - __pyx_r = PyArray_BYTES(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * - * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.data.data", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[1], 773, 0, __PYX_ERR(1, 773, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[1], 776, 0, __PYX_ERR(1, 776, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - */ - __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[1], 779, 0, __PYX_ERR(1, 779, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - */ - __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __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(1, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -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) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[1], 782, 0, __PYX_ERR(1, 782, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - */ - __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __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(1, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -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) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[1], 785, 0, __PYX_ERR(1, 785, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline tuple PyDataType_SHAPE(dtype d): - */ - __Pyx_TraceLine(786,0,__PYX_ERR(1, 786, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __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(1, 786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[1], 788, 0, __PYX_ERR(1, 788, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 - * - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< - * return d.subarray.shape - * else: - */ - __Pyx_TraceLine(789,0,__PYX_ERR(1, 789, __pyx_L1_error)) - __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); - if (__pyx_t_1) { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape # <<<<<<<<<<<<<< - * else: - * return () - */ - __Pyx_TraceLine(790,0,__PYX_ERR(1, 790, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); - __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 - * - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< - * return d.subarray.shape - * else: - */ - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 - * return d.subarray.shape - * else: - * return () # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(792,0,__PYX_ERR(1, 792, __pyx_L1_error)) - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_empty_tuple); - __pyx_r = __pyx_empty_tuple; - goto __pyx_L0; - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 - * int _import_umath() except -1 - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_array_base", 0); - __Pyx_TraceCall("set_array_base", __pyx_f[1], 967, 0, __PYX_ERR(1, 967, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968 - * - * cdef inline void set_array_base(ndarray arr, object base): - * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< - * PyArray_SetBaseObject(arr, base) - * - */ - __Pyx_TraceLine(968,0,__PYX_ERR(1, 968, __pyx_L1_error)) - Py_INCREF(__pyx_v_base); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969 - * cdef inline void set_array_base(ndarray arr, object base): - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __Pyx_TraceLine(969,0,__PYX_ERR(1, 969, __pyx_L1_error)) - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 - * int _import_umath() except -1 - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 - * PyArray_SetBaseObject(arr, base) - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * base = PyArray_BASE(arr) - * if base is NULL: - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_v_base; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_array_base", 0); - __Pyx_TraceCall("get_array_base", __pyx_f[1], 971, 0, __PYX_ERR(1, 971, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972 - * - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< - * if base is NULL: - * return None - */ - __Pyx_TraceLine(972,0,__PYX_ERR(1, 972, __pyx_L1_error)) - __pyx_v_base = PyArray_BASE(__pyx_v_arr); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) - * if base is NULL: # <<<<<<<<<<<<<< - * return None - * return base - */ - __Pyx_TraceLine(973,0,__PYX_ERR(1, 973, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_base == NULL); - if (__pyx_t_1) { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 - * base = PyArray_BASE(arr) - * if base is NULL: - * return None # <<<<<<<<<<<<<< - * return base - * - */ - __Pyx_TraceLine(974,0,__PYX_ERR(1, 974, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) - * if base is NULL: # <<<<<<<<<<<<<< - * return None - * return base - */ - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 - * if base is NULL: - * return None - * return base # <<<<<<<<<<<<<< - * - * # Versions of the import_* functions which are more suitable for - */ - __Pyx_TraceLine(975,0,__PYX_ERR(1, 975, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_base)); - __pyx_r = ((PyObject *)__pyx_v_base); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 - * PyArray_SetBaseObject(arr, base) - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * base = PyArray_BASE(arr) - * if base is NULL: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * __pyx_import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_array", 0); - __Pyx_TraceCall("import_array", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - __Pyx_TraceLine(980,0,__PYX_ERR(1, 980, __pyx_L1_error)) - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 - * cdef inline int import_array() except -1: - * try: - * __pyx_import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") - */ - __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L3_error)) - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982 - * try: - * __pyx_import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * - */ - __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L5_except_error)) - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 982, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 - * __pyx_import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L5_except_error)) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 983, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 983, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * __pyx_import_array() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_umath", 0); - __Pyx_TraceCall("import_umath", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_TraceLine(986,0,__PYX_ERR(1, 986, __pyx_L1_error)) - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L3_error)) - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L5_except_error)) - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L5_except_error)) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_ufunc", 0); - __Pyx_TraceCall("import_ufunc", __pyx_f[1], 991, 0, __PYX_ERR(1, 991, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_TraceLine(992,0,__PYX_ERR(1, 992, __pyx_L1_error)) - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L3_error)) - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __Pyx_TraceLine(994,0,__PYX_ERR(1, 994, __pyx_L5_except_error)) - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L5_except_error)) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.timedelta64)` - */ - -static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - __Pyx_TraceCall("is_timedelta64_object", __pyx_f[1], 998, 0, __PYX_ERR(1, 998, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 - * bool - * """ - * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error)) - __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.timedelta64)` - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.datetime64)` - */ - -static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_datetime64_object", 0); - __Pyx_TraceCall("is_datetime64_object", __pyx_f[1], 1013, 0, __PYX_ERR(1, 1013, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 - * bool - * """ - * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error)) - __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.datetime64)` - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy datetime64 object - */ - -static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { - npy_datetime __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("get_datetime64_value", __pyx_f[1], 1028, 1, __PYX_ERR(1, 1028, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 - * also needed. That can be found using `get_datetime64_unit`. - * """ - * return (obj).obval # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(1035,1,__PYX_ERR(1, 1035, __pyx_L1_error)) - __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy datetime64 object - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy timedelta64 object - */ - -static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { - npy_timedelta __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("get_timedelta64_value", __pyx_f[1], 1038, 1, __PYX_ERR(1, 1038, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1042 - * returns the int64 value underlying scalar numpy timedelta64 object - * """ - * return (obj).obval # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(1042,1,__PYX_ERR(1, 1042, __pyx_L1_error)) - __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy timedelta64 object - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the unit part of the dtype for a numpy datetime64 object. - */ - -static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { - NPY_DATETIMEUNIT __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("get_datetime64_unit", __pyx_f[1], 1045, 1, __PYX_ERR(1, 1045, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1049 - * returns the unit part of the dtype for a numpy datetime64 object. - * """ - * return (obj).obmeta.base # <<<<<<<<<<<<<< - */ - __Pyx_TraceLine(1049,1,__PYX_ERR(1, 1049, __pyx_L1_error)) - __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the unit part of the dtype for a numpy datetime64 object. - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = (NPY_DATETIMEUNIT) 0; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "cdfdif_wrapper.pyx":11 - * double fabs(double) - * - * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< - * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * - */ - -static CYTHON_INLINE double __pyx_f_14cdfdif_wrapper_add_outlier_cdf(double __pyx_v_y, double __pyx_v_x, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - double __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("add_outlier_cdf", 0); - __Pyx_TraceCall("add_outlier_cdf", __pyx_f[0], 11, 0, __PYX_ERR(0, 11, __pyx_L1_error)); - - /* "cdfdif_wrapper.pyx":12 - * - * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): - * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier # <<<<<<<<<<<<<< - * - * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - */ - __Pyx_TraceLine(12,0,__PYX_ERR(0, 12, __pyx_L1_error)) - __pyx_t_1 = (2.0 * __pyx_v_w_outlier); - if (unlikely(__pyx_t_1 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 12, __pyx_L1_error) - } - __pyx_r = ((__pyx_v_y * (1.0 - __pyx_v_p_outlier)) + (((__pyx_v_x + (1. / __pyx_t_1)) * __pyx_v_w_outlier) * __pyx_v_p_outlier)); - goto __pyx_L0; - - /* "cdfdif_wrapper.pyx":11 - * double fabs(double) - * - * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< - * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("cdfdif_wrapper.add_outlier_cdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "cdfdif_wrapper.pyx":14 - * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * - * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< - * - * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, - */ - -static CYTHON_INLINE int __pyx_f_14cdfdif_wrapper_p_outlier_in_range(double __pyx_v_p_outlier) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("p_outlier_in_range", 0); - __Pyx_TraceCall("p_outlier_in_range", __pyx_f[0], 14, 0, __PYX_ERR(0, 14, __pyx_L1_error)); - __pyx_r = ((__pyx_v_p_outlier >= 0.0) & (__pyx_v_p_outlier <= 1.0)); - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("cdfdif_wrapper.p_outlier_in_range", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "cdfdif_wrapper.pyx":16 - * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - * - * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< - * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_14cdfdif_wrapper_1dmat_cdf_array = {"dmat_cdf_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_14cdfdif_wrapper_1dmat_cdf_array(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - double __pyx_v_v; - double __pyx_v_sv; - double __pyx_v_a; - double __pyx_v_z; - double __pyx_v_sz; - double __pyx_v_t; - double __pyx_v_st; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("dmat_cdf_array (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 16, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 1); __PYX_ERR(0, 16, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 2); __PYX_ERR(0, 16, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 3); __PYX_ERR(0, 16, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 4); __PYX_ERR(0, 16, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 5); __PYX_ERR(0, 16, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 6); __PYX_ERR(0, 16, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 7); __PYX_ERR(0, 16, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 8); __PYX_ERR(0, 16, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, 9); __PYX_ERR(0, 16, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dmat_cdf_array") < 0)) __PYX_ERR(0, 16, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 10)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_v = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("dmat_cdf_array", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 16, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("cdfdif_wrapper.dmat_cdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 16, __pyx_L1_error) - __pyx_r = __pyx_pf_14cdfdif_wrapper_dmat_cdf_array(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_14cdfdif_wrapper_dmat_cdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - Py_ssize_t __pyx_v_size; - PyArrayObject *__pyx_v_y = 0; - int __pyx_v_boundary; - double __pyx_v_p_boundary; - double __pyx_v_params[7]; - double __pyx_v_epsi; - Py_ssize_t __pyx_v_i; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_y; - __Pyx_Buffer __pyx_pybuffer_y; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - double __pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - npy_intp *__pyx_t_11; - PyArrayObject *__pyx_t_12 = NULL; - Py_ssize_t __pyx_t_13; - Py_ssize_t __pyx_t_14; - Py_ssize_t __pyx_t_15; - Py_ssize_t __pyx_t_16; - Py_ssize_t __pyx_t_17; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__3) - __Pyx_RefNannySetupContext("dmat_cdf_array", 0); - __Pyx_TraceCall("dmat_cdf_array", __pyx_f[0], 16, 0, __PYX_ERR(0, 16, __pyx_L1_error)); - __pyx_pybuffer_y.pybuffer.buf = NULL; - __pyx_pybuffer_y.refcount = 0; - __pyx_pybuffernd_y.data = NULL; - __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 16, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - - /* "cdfdif_wrapper.pyx":20 - * - * #check arguments - * if p_outlier > 0: # <<<<<<<<<<<<<< - * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * - */ - __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_p_outlier > 0.0); - if (__pyx_t_1) { - - /* "cdfdif_wrapper.pyx":21 - * #check arguments - * if p_outlier > 0: - * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') # <<<<<<<<<<<<<< - * - * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ - */ - __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error)) - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_abs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_x)}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_8 = (2.0 * __pyx_v_w_outlier); - if (unlikely(__pyx_t_8 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 21, __pyx_L1_error) - } - __pyx_t_4 = PyFloat_FromDouble((1. / __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) { - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 21, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 21, __pyx_L1_error) - #endif - - /* "cdfdif_wrapper.pyx":20 - * - * #check arguments - * if p_outlier > 0: # <<<<<<<<<<<<<< - * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * - */ - } - - /* "cdfdif_wrapper.pyx":23 - * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * - * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< - * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError("at least one of the parameters is out of the support") - */ - __Pyx_TraceLine(23,0,__PYX_ERR(0, 23, __pyx_L1_error)) - __pyx_t_9 = (__pyx_v_sv < 0.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = (__pyx_v_a <= 0.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = (__pyx_v_z < 0.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = (__pyx_v_z > 1.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = (__pyx_v_sz < 0.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = (__pyx_v_sz > 1.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = ((__pyx_v_z + (__pyx_v_sz / 2.)) > 1.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - - /* "cdfdif_wrapper.pyx":24 - * - * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ - * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * raise ValueError("at least one of the parameters is out of the support") - * - */ - __Pyx_TraceLine(24,0,__PYX_ERR(0, 24, __pyx_L1_error)) - __pyx_t_9 = ((__pyx_v_z - (__pyx_v_sz / 2.)) < 0.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = ((__pyx_v_t - (__pyx_v_st / 2.)) < 0.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = (__pyx_v_t < 0.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = (__pyx_v_st < 0.0); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_9 = __pyx_f_14cdfdif_wrapper_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_9 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_9); - __pyx_t_1 = __pyx_t_10; - __pyx_L5_bool_binop_done:; - - /* "cdfdif_wrapper.pyx":23 - * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * - * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< - * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError("at least one of the parameters is out of the support") - */ - __Pyx_TraceLine(23,0,__PYX_ERR(0, 23, __pyx_L1_error)) - if (unlikely(__pyx_t_1)) { - - /* "cdfdif_wrapper.pyx":25 - * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ - * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError("at least one of the parameters is out of the support") # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(25,0,__PYX_ERR(0, 25, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 25, __pyx_L1_error) - - /* "cdfdif_wrapper.pyx":23 - * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - * - * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ # <<<<<<<<<<<<<< - * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError("at least one of the parameters is out of the support") - */ - } - - /* "cdfdif_wrapper.pyx":28 - * - * - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim=1] y = np.empty(size, dtype=np.double) - * cdef int boundary - */ - __Pyx_TraceLine(28,0,__PYX_ERR(0, 28, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_11 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error) - __pyx_v_size = (__pyx_t_11[0]); - - /* "cdfdif_wrapper.pyx":29 - * - * cdef Py_ssize_t size = x.shape[0] - * cdef np.ndarray[double, ndim=1] y = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< - * cdef int boundary - * cdef double p_boundary - */ - __Pyx_TraceLine(29,0,__PYX_ERR(0, 29, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 29, __pyx_L1_error) - __pyx_t_12 = ((PyArrayObject *)__pyx_t_5); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 29, __pyx_L1_error) - } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_12 = 0; - __pyx_v_y = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "cdfdif_wrapper.pyx":33 - * cdef double p_boundary - * cdef double params[7] - * cdef double epsi = 1e-10 # <<<<<<<<<<<<<< - * - * #transform parameters - */ - __Pyx_TraceLine(33,0,__PYX_ERR(0, 33, __pyx_L1_error)) - __pyx_v_epsi = 1e-10; - - /* "cdfdif_wrapper.pyx":36 - * - * #transform parameters - * params[0] = a/10. # <<<<<<<<<<<<<< - * params[1] = t - * params[2] = sv/10. + epsi - */ - __Pyx_TraceLine(36,0,__PYX_ERR(0, 36, __pyx_L1_error)) - (__pyx_v_params[0]) = (__pyx_v_a / 10.); - - /* "cdfdif_wrapper.pyx":37 - * #transform parameters - * params[0] = a/10. - * params[1] = t # <<<<<<<<<<<<<< - * params[2] = sv/10. + epsi - * params[3] = z*(a/10.) - */ - __Pyx_TraceLine(37,0,__PYX_ERR(0, 37, __pyx_L1_error)) - (__pyx_v_params[1]) = __pyx_v_t; - - /* "cdfdif_wrapper.pyx":38 - * params[0] = a/10. - * params[1] = t - * params[2] = sv/10. + epsi # <<<<<<<<<<<<<< - * params[3] = z*(a/10.) - * params[4] = sz*(a/10.) + epsi - */ - __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error)) - (__pyx_v_params[2]) = ((__pyx_v_sv / 10.) + __pyx_v_epsi); - - /* "cdfdif_wrapper.pyx":39 - * params[1] = t - * params[2] = sv/10. + epsi - * params[3] = z*(a/10.) # <<<<<<<<<<<<<< - * params[4] = sz*(a/10.) + epsi - * params[5] = st + epsi - */ - __Pyx_TraceLine(39,0,__PYX_ERR(0, 39, __pyx_L1_error)) - (__pyx_v_params[3]) = (__pyx_v_z * (__pyx_v_a / 10.)); - - /* "cdfdif_wrapper.pyx":40 - * params[2] = sv/10. + epsi - * params[3] = z*(a/10.) - * params[4] = sz*(a/10.) + epsi # <<<<<<<<<<<<<< - * params[5] = st + epsi - * params[6] = v/10. - */ - __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error)) - (__pyx_v_params[4]) = ((__pyx_v_sz * (__pyx_v_a / 10.)) + __pyx_v_epsi); - - /* "cdfdif_wrapper.pyx":41 - * params[3] = z*(a/10.) - * params[4] = sz*(a/10.) + epsi - * params[5] = st + epsi # <<<<<<<<<<<<<< - * params[6] = v/10. - * - */ - __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error)) - (__pyx_v_params[5]) = (__pyx_v_st + __pyx_v_epsi); - - /* "cdfdif_wrapper.pyx":42 - * params[4] = sz*(a/10.) + epsi - * params[5] = st + epsi - * params[6] = v/10. # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error)) - (__pyx_v_params[6]) = (__pyx_v_v / 10.); - - /* "cdfdif_wrapper.pyx":45 - * - * - * for i in range(size): # <<<<<<<<<<<<<< - * boundary = (int) (x[i] > 0) - * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) - */ - __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error)) - __pyx_t_13 = __pyx_v_size; - __pyx_t_14 = __pyx_t_13; - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { - __pyx_v_i = __pyx_t_15; - - /* "cdfdif_wrapper.pyx":46 - * - * for i in range(size): - * boundary = (int) (x[i] > 0) # <<<<<<<<<<<<<< - * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) - * y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] - */ - __Pyx_TraceLine(46,0,__PYX_ERR(0, 46, __pyx_L1_error)) - __pyx_t_16 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 46, __pyx_L1_error) - } - __pyx_v_boundary = ((int)((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides)) > 0.0)); - - /* "cdfdif_wrapper.pyx":47 - * for i in range(size): - * boundary = (int) (x[i] > 0) - * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) # <<<<<<<<<<<<<< - * y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] - * - */ - __Pyx_TraceLine(47,0,__PYX_ERR(0, 47, __pyx_L1_error)) - __pyx_t_16 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 47, __pyx_L1_error) - } - __pyx_t_17 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_17 < 0) { - __pyx_t_17 += __pyx_pybuffernd_y.diminfo[0].shape; - if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 47, __pyx_L1_error) - } - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = cdfdif(fabs((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides))), __pyx_v_boundary, __pyx_v_params, (&__pyx_v_p_boundary)); - - /* "cdfdif_wrapper.pyx":48 - * boundary = (int) (x[i] > 0) - * y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) - * y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] # <<<<<<<<<<<<<< - * - * #add p_outlier probability - */ - __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error)) - __pyx_t_5 = PyFloat_FromDouble((1.0 - __pyx_v_p_boundary)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sign); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_16 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 48, __pyx_L1_error) - } - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_16 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_pybuffernd_y.diminfo[0].shape; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 48, __pyx_L1_error) - } - __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_16 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_pybuffernd_y.diminfo[0].shape; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 48, __pyx_L1_error) - } - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_8; - - /* "cdfdif_wrapper.pyx":51 - * - * #add p_outlier probability - * y[i] = add_outlier_cdf(y[i], x[i], p_outlier, w_outlier) # <<<<<<<<<<<<<< - * - * return y - */ - __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error)) - __pyx_t_16 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_pybuffernd_y.diminfo[0].shape; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 51, __pyx_L1_error) - } - __pyx_t_17 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_17 < 0) { - __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape; - if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 51, __pyx_L1_error) - } - __pyx_t_8 = __pyx_f_14cdfdif_wrapper_add_outlier_cdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_p_outlier, __pyx_v_w_outlier); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) - __pyx_t_17 = __pyx_v_i; - __pyx_t_7 = -1; - if (__pyx_t_17 < 0) { - __pyx_t_17 += __pyx_pybuffernd_y.diminfo[0].shape; - if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; - } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_y.diminfo[0].shape)) __pyx_t_7 = 0; - if (unlikely(__pyx_t_7 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 51, __pyx_L1_error) - } - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_8; - } - - /* "cdfdif_wrapper.pyx":53 - * y[i] = add_outlier_cdf(y[i], x[i], p_outlier, w_outlier) - * - * return y # <<<<<<<<<<<<<< - */ - __Pyx_TraceLine(53,0,__PYX_ERR(0, 53, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF((PyObject *)__pyx_v_y); - __pyx_r = ((PyObject *)__pyx_v_y); - goto __pyx_L0; - - /* "cdfdif_wrapper.pyx":16 - * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - * - * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< - * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("cdfdif_wrapper.dmat_cdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_y); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_1_2_w_outlier_must_be_smaller_th, __pyx_k_1_2_w_outlier_must_be_smaller_th, sizeof(__pyx_k_1_2_w_outlier_must_be_smaller_th), 0, 1, 0, 0}, - {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, - {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1}, - {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, - {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_kp_u_at_least_one_of_the_parameters_i, __pyx_k_at_least_one_of_the_parameters_i, sizeof(__pyx_k_at_least_one_of_the_parameters_i), 0, 1, 0, 0}, - {&__pyx_n_s_boundary, __pyx_k_boundary, sizeof(__pyx_k_boundary), 0, 0, 1, 1}, - {&__pyx_n_s_cdfdif_wrapper, __pyx_k_cdfdif_wrapper, sizeof(__pyx_k_cdfdif_wrapper), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_dmat_cdf_array, __pyx_k_dmat_cdf_array, sizeof(__pyx_k_dmat_cdf_array), 0, 0, 1, 1}, - {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, - {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, - {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, - {&__pyx_n_s_epsi, __pyx_k_epsi, sizeof(__pyx_k_epsi), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, - {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, - {&__pyx_n_s_p_boundary, __pyx_k_p_boundary, sizeof(__pyx_k_p_boundary), 0, 0, 1, 1}, - {&__pyx_n_s_p_outlier, __pyx_k_p_outlier, sizeof(__pyx_k_p_outlier), 0, 0, 1, 1}, - {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, - {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c, __pyx_k_src_hssm_likelihoods_hddm_wfpt_c, sizeof(__pyx_k_src_hssm_likelihoods_hddm_wfpt_c), 0, 0, 1, 0}, - {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, - {&__pyx_n_s_sv, __pyx_k_sv, sizeof(__pyx_k_sv), 0, 0, 1, 1}, - {&__pyx_n_s_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 0, 1, 1}, - {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_s_w_outlier, __pyx_k_w_outlier, sizeof(__pyx_k_w_outlier), 0, 0, 1, 1}, - {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, - {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 21, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 21, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 45, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 983, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 - * __pyx_import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "cdfdif_wrapper.pyx":21 - * #check arguments - * if p_outlier > 0: - * assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') # <<<<<<<<<<<<<< - * - * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_1_2_w_outlier_must_be_smaller_th); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "cdfdif_wrapper.pyx":25 - * if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ - * (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError("at least one of the parameters is out of the support") # <<<<<<<<<<<<<< - * - * - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_at_least_one_of_the_parameters_i); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "cdfdif_wrapper.pyx":16 - * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - * - * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< - * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - * - */ - __pyx_tuple__7 = PyTuple_Pack(17, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_y, __pyx_n_s_boundary, __pyx_n_s_p_boundary, __pyx_n_s_params, __pyx_n_s_epsi, __pyx_n_s_i); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_c, __pyx_n_s_dmat_cdf_array, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 2, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - /* AssertionsEnabled.init */ - if (likely(__Pyx_init_assertions_enabled() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2, __pyx_L1_error) - - /* NumpyImportArray.init */ - /* - * Cython has automatically inserted a call to _import_array since - * you didn't include one when you cimported numpy. To disable this - * add the line - * numpy._import_array - */ -#ifdef NPY_FEATURE_VERSION -#ifndef NO_IMPORT_ARRAY -if (unlikely(_import_array() == -1)) { - PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import " - "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; " - "use 'numpy._import_array' to disable if you are certain you don't need it)."); -} -#endif -#endif - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2, __pyx_L1_error) - - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", - #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), - #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), - #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyHeapTypeObject), - #endif - __Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_variable_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - - -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec_cdfdif_wrapper(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec_cdfdif_wrapper}, - {0, NULL} -}; -#endif - -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "cdfdif_wrapper", - 0, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ - #else - -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif -#endif - -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif -#endif - - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initcdfdif_wrapper(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initcdfdif_wrapper(void) -#else -__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -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) -#endif -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else - result = PyDict_SetItemString(moddict, to_name, value); -#endif - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; - } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - if (__Pyx_check_single_interpreter()) - return NULL; - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; -#endif - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} - - -static CYTHON_SMALL_CODE int __pyx_pymod_exec_cdfdif_wrapper(PyObject *__pyx_pyinit_module) -#endif -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - __Pyx_TraceDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module 'cdfdif_wrapper' has already been imported. Re-initialisation is not supported."); - return -1; - } - #elif PY_MAJOR_VERSION >= 3 - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); - #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("cdfdif_wrapper", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 2, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) - { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to cdfdif_wrapper pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 2, __pyx_L1_error) - pystate_addmodule_run = 1; - } - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - #endif - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 2, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 2, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 2, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 2, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 2, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 2, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 2, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - if (__pyx_module_is_main_cdfdif_wrapper) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 2, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "cdfdif_wrapper")) { - if (unlikely((PyDict_SetItemString(modules, "cdfdif_wrapper", __pyx_m) < 0))) __PYX_ERR(0, 2, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 2, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 2, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 2, __pyx_L1_error) - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 2, __pyx_L1_error) - #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_cdfdif_wrapper(void)", __pyx_f[0], 2, 0, __PYX_ERR(0, 2, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * - * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ - */ - __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * - * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ - */ - __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * - * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ - */ - __Pyx_TraceLine(257,0,__PYX_ERR(1, 257, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * - * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - __Pyx_TraceLine(263,0,__PYX_ERR(1, 263, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * - * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - __Pyx_TraceLine(271,0,__PYX_ERR(1, 271, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * - * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ - */ - __Pyx_TraceLine(278,0,__PYX_ERR(1, 278, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * - * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. - */ - __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - __Pyx_TraceLine(773,0,__PYX_ERR(1, 773, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape - */ - __Pyx_TraceLine(788,0,__PYX_ERR(1, 788, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 - * int _import_umath() except -1 - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) - */ - __Pyx_TraceLine(967,0,__PYX_ERR(1, 967, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 - * PyArray_SetBaseObject(arr, base) - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * base = PyArray_BASE(arr) - * if base is NULL: - */ - __Pyx_TraceLine(971,0,__PYX_ERR(1, 971, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * __pyx_import_array() - */ - __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.timedelta64)` - */ - __Pyx_TraceLine(998,0,__PYX_ERR(1, 998, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.datetime64)` - */ - __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy datetime64 object - */ - __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy timedelta64 object - */ - __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the unit part of the dtype for a numpy datetime64 object. - */ - __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error)) - - - /* "cdfdif_wrapper.pyx":3 - * - * cimport numpy as np - * import numpy as np # <<<<<<<<<<<<<< - * - * cdef extern from "cdfdif.h": - */ - __Pyx_TraceLine(3,0,__PYX_ERR(0, 3, __pyx_L1_error)) - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "cdfdif_wrapper.pyx":11 - * double fabs(double) - * - * cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): # <<<<<<<<<<<<<< - * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * - */ - __Pyx_TraceLine(11,0,__PYX_ERR(0, 11, __pyx_L1_error)) - - - /* "cdfdif_wrapper.pyx":14 - * return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - * - * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< - * - * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, - */ - __Pyx_TraceLine(14,0,__PYX_ERR(0, 14, __pyx_L1_error)) - - - /* "cdfdif_wrapper.pyx":16 - * cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - * - * def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, # <<<<<<<<<<<<<< - * double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - * - */ - __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error)) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14cdfdif_wrapper_1dmat_cdf_array, 0, __pyx_n_s_dmat_cdf_array, NULL, __pyx_n_s_cdfdif_wrapper, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dmat_cdf_array, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "cdfdif_wrapper.pyx":2 - * - * cimport numpy as np # <<<<<<<<<<<<<< - * import numpy as np - * - */ - __Pyx_TraceLine(2,0,__PYX_ERR(0, 2, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_TraceReturn(Py_None, 0); - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init cdfdif_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); - } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init cdfdif_wrapper"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif -} -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#endif - - - -/* #### Code section: utility_code_def ### */ - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* PyObjectGetAttrStrNoError */ -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; - } - return exc_info; -} -#endif - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif -} -#endif - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) -#endif -{ - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 - local_value = tstate->current_exception; - tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif - } - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} -static CYTHON_INLINE PyObject * -__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return PyList_New(0); - } - res = PyList_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); - return res; -} -#endif - -/* BytesEquals */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } -#endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } - } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -/* fastcall */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) -{ - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); - for (i = 0; i < n; i++) - { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; - } - for (i = 0; i < n; i++) - { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); - if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error - return kwvalues[i]; - } - } - return NULL; // not found (no exception set) -} -#endif - -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; -#endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; -#endif - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values - Py_DECREF(key); -#endif - key = NULL; - value = NULL; - continue; - } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* IsLittleEndian */ -static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) -{ - union { - uint32_t u32; - uint8_t u8[4]; - } S; - S.u32 = 0x01020304; - return S.u8[0] == 4; -} - -/* BufferFormatCheck */ -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type) { - stack[0].field = &ctx->root; - stack[0].parent_offset = 0; - ctx->root.type = type; - ctx->root.name = "buffer dtype"; - ctx->root.offset = 0; - ctx->head = stack; - ctx->head->field = &ctx->root; - ctx->fmt_offset = 0; - ctx->head->parent_offset = 0; - ctx->new_packmode = '@'; - ctx->enc_packmode = '@'; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->is_complex = 0; - ctx->is_valid_array = 0; - ctx->struct_alignment = 0; - while (type->typegroup == 'S') { - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = 0; - type = type->fields->type; - } -} -static int __Pyx_BufFmt_ParseNumber(const char** ts) { - int count; - const char* t = *ts; - if (*t < '0' || *t > '9') { - return -1; - } else { - count = *t++ - '0'; - while (*t >= '0' && *t <= '9') { - count *= 10; - count += *t++ - '0'; - } - } - *ts = t; - return count; -} -static int __Pyx_BufFmt_ExpectNumber(const char **ts) { - int number = __Pyx_BufFmt_ParseNumber(ts); - if (number == -1) - PyErr_Format(PyExc_ValueError,\ - "Does not understand character buffer dtype format string ('%c')", **ts); - return number; -} -static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { - PyErr_Format(PyExc_ValueError, - "Unexpected format string character: '%c'", ch); -} -static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { - switch (ch) { - case '?': return "'bool'"; - case 'c': return "'char'"; - case 'b': return "'signed char'"; - case 'B': return "'unsigned char'"; - case 'h': return "'short'"; - case 'H': return "'unsigned short'"; - case 'i': return "'int'"; - case 'I': return "'unsigned int'"; - case 'l': return "'long'"; - case 'L': return "'unsigned long'"; - case 'q': return "'long long'"; - case 'Q': return "'unsigned long long'"; - case 'f': return (is_complex ? "'complex float'" : "'float'"); - case 'd': return (is_complex ? "'complex double'" : "'double'"); - case 'g': return (is_complex ? "'complex long double'" : "'long double'"); - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - case 's': case 'p': return "a string"; - case 0: return "end"; - default: return "unparsable format string"; - } -} -static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return 2; - case 'i': case 'I': case 'l': case 'L': return 4; - case 'q': case 'Q': return 8; - case 'f': return (is_complex ? 8 : 4); - case 'd': return (is_complex ? 16 : 8); - case 'g': { - PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); - return 0; - } - case 'O': case 'P': return sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(short); - case 'i': case 'I': return sizeof(int); - case 'l': case 'L': return sizeof(long); - #ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(PY_LONG_LONG); - #endif - case 'f': return sizeof(float) * (is_complex ? 2 : 1); - case 'd': return sizeof(double) * (is_complex ? 2 : 1); - case 'g': return sizeof(long double) * (is_complex ? 2 : 1); - case 'O': case 'P': return sizeof(void*); - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} -typedef struct { char c; short x; } __Pyx_st_short; -typedef struct { char c; int x; } __Pyx_st_int; -typedef struct { char c; long x; } __Pyx_st_long; -typedef struct { char c; float x; } __Pyx_st_float; -typedef struct { char c; double x; } __Pyx_st_double; -typedef struct { char c; long double x; } __Pyx_st_longdouble; -typedef struct { char c; void *x; } __Pyx_st_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) { - CYTHON_UNUSED_VAR(is_complex); - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_st_float) - sizeof(float); - case 'd': return sizeof(__Pyx_st_double) - sizeof(double); - case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -/* These are for computing the padding at the end of the struct to align - on the first member of the struct. This will probably the same as above, - but we don't have any guarantees. - */ -typedef struct { short x; char c; } __Pyx_pad_short; -typedef struct { int x; char c; } __Pyx_pad_int; -typedef struct { long x; char c; } __Pyx_pad_long; -typedef struct { float x; char c; } __Pyx_pad_float; -typedef struct { double x; char c; } __Pyx_pad_double; -typedef struct { long double x; char c; } __Pyx_pad_longdouble; -typedef struct { void *x; char c; } __Pyx_pad_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) { - CYTHON_UNUSED_VAR(is_complex); - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); - case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); - case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { - switch (ch) { - case 'c': - return 'H'; - case 'b': case 'h': case 'i': - case 'l': case 'q': case 's': case 'p': - return 'I'; - case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': - return 'U'; - case 'f': case 'd': case 'g': - return (is_complex ? 'C' : 'R'); - case 'O': - return 'O'; - case 'P': - return 'P'; - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} -static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { - if (ctx->head == NULL || ctx->head->field == &ctx->root) { - const char* expected; - const char* quote; - if (ctx->head == NULL) { - expected = "end"; - quote = ""; - } else { - expected = ctx->head->field->type->name; - quote = "'"; - } - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected %s%s%s but got %s", - quote, expected, quote, - __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); - } else { - __Pyx_StructField* field = ctx->head->field; - __Pyx_StructField* parent = (ctx->head - 1)->field; - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", - field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), - parent->type->name, field->name); - } -} -static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { - char group; - size_t size, offset, arraysize = 1; - if (ctx->enc_type == 0) return 0; - if (ctx->head->field->type->arraysize[0]) { - int i, ndim = 0; - if (ctx->enc_type == 's' || ctx->enc_type == 'p') { - ctx->is_valid_array = ctx->head->field->type->ndim == 1; - ndim = 1; - if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { - PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %zu", - ctx->head->field->type->arraysize[0], ctx->enc_count); - return -1; - } - } - if (!ctx->is_valid_array) { - PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", - ctx->head->field->type->ndim, ndim); - return -1; - } - for (i = 0; i < ctx->head->field->type->ndim; i++) { - arraysize *= ctx->head->field->type->arraysize[i]; - } - ctx->is_valid_array = 0; - ctx->enc_count = 1; - } - group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); - do { - __Pyx_StructField* field = ctx->head->field; - __Pyx_TypeInfo* type = field->type; - if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { - size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); - } else { - size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); - } - if (ctx->enc_packmode == '@') { - size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); - size_t align_mod_offset; - if (align_at == 0) return -1; - align_mod_offset = ctx->fmt_offset % align_at; - if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; - if (ctx->struct_alignment == 0) - ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, - ctx->is_complex); - } - if (type->size != size || type->typegroup != group) { - if (type->typegroup == 'C' && type->fields != NULL) { - size_t parent_offset = ctx->head->parent_offset + field->offset; - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = parent_offset; - continue; - } - if ((type->typegroup == 'H' || group == 'H') && type->size == size) { - } else { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - } - offset = ctx->head->parent_offset + field->offset; - if (ctx->fmt_offset != offset) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", - (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); - return -1; - } - ctx->fmt_offset += size; - if (arraysize) - ctx->fmt_offset += (arraysize - 1) * size; - --ctx->enc_count; - while (1) { - if (field == &ctx->root) { - ctx->head = NULL; - if (ctx->enc_count != 0) { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - break; - } - ctx->head->field = ++field; - if (field->type == NULL) { - --ctx->head; - field = ctx->head->field; - continue; - } else if (field->type->typegroup == 'S') { - size_t parent_offset = ctx->head->parent_offset + field->offset; - if (field->type->fields->type == NULL) continue; - field = field->type->fields; - ++ctx->head; - ctx->head->field = field; - ctx->head->parent_offset = parent_offset; - break; - } else { - break; - } - } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 0; -} -static int -__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) -{ - const char *ts = *tsp; - int i = 0, number, ndim; - ++ts; - if (ctx->new_count != 1) { - PyErr_SetString(PyExc_ValueError, - "Cannot handle repeated arrays in format string"); - return -1; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1; - ndim = ctx->head->field->type->ndim; - while (*ts && *ts != ')') { - switch (*ts) { - case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; - default: break; - } - number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return -1; - if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) { - PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %d", - ctx->head->field->type->arraysize[i], number); - return -1; - } - if (*ts != ',' && *ts != ')') { - PyErr_Format(PyExc_ValueError, - "Expected a comma in format string, got '%c'", *ts); - return -1; - } - if (*ts == ',') ts++; - i++; - } - if (i != ndim) { - PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", - ctx->head->field->type->ndim, i); - return -1; - } - if (!*ts) { - PyErr_SetString(PyExc_ValueError, - "Unexpected end of format string, expected ')'"); - return -1; - } - ctx->is_valid_array = 1; - ctx->new_count = 1; - *tsp = ++ts; - return 0; -} -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { - int got_Z = 0; - while (1) { - switch(*ts) { - case 0: - if (ctx->enc_type != 0 && ctx->head == NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - return ts; - case ' ': - case '\r': - case '\n': - ++ts; - break; - case '<': - if (!__Pyx_Is_Little_Endian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_Is_Little_Endian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '=': - case '@': - case '^': - ctx->new_packmode = *ts++; - break; - case 'T': - { - const char* ts_after_sub; - size_t i, struct_count = ctx->new_count; - size_t struct_alignment = ctx->struct_alignment; - ctx->new_count = 1; - ++ts; - if (*ts != '{') { - PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - ctx->enc_count = 0; - ctx->struct_alignment = 0; - ++ts; - ts_after_sub = ts; - for (i = 0; i != struct_count; ++i) { - ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); - if (!ts_after_sub) return NULL; - } - ts = ts_after_sub; - if (struct_alignment) ctx->struct_alignment = struct_alignment; - } - break; - case '}': - { - size_t alignment = ctx->struct_alignment; - ++ts; - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - if (alignment && ctx->fmt_offset % alignment) { - ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); - } - } - return ts; - case 'x': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->fmt_offset += ctx->new_count; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->enc_packmode = ctx->new_packmode; - ++ts; - break; - case 'Z': - got_Z = 1; - ++ts; - if (*ts != 'f' && *ts != 'd' && *ts != 'g') { - __Pyx_BufFmt_RaiseUnexpectedChar('Z'); - return NULL; - } - CYTHON_FALLTHROUGH; - case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': - case 'l': case 'L': case 'q': case 'Q': - case 'f': case 'd': case 'g': - case 'O': case 'p': - if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && - (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { - ctx->enc_count += ctx->new_count; - ctx->new_count = 1; - got_Z = 0; - ++ts; - break; - } - CYTHON_FALLTHROUGH; - case 's': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_count = ctx->new_count; - ctx->enc_packmode = ctx->new_packmode; - ctx->enc_type = *ts; - ctx->is_complex = got_Z; - ++ts; - ctx->new_count = 1; - got_Z = 0; - break; - case ':': - ++ts; - while(*ts != ':') ++ts; - ++ts; - break; - case '(': - if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL; - break; - default: - { - int number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - ctx->new_count = (size_t)number; - } - } - } -} - -/* BufferGetAndValidate */ - static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (unlikely(info->buf == NULL)) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} -static void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} -static int __Pyx__GetBufferAndValidate( - Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, - int nd, int cast, __Pyx_BufFmt_StackElem* stack) -{ - buf->buf = NULL; - if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { - __Pyx_ZeroBuffer(buf); - return -1; - } - if (unlikely(buf->ndim != nd)) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if (unlikely((size_t)buf->itemsize != dtype->size)) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_SafeReleaseBuffer(buf); - return -1; -} - -/* PyDictVersioning */ - #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ - #if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - -/* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectFastCall */ - static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result = 0; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; - } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - bad: - Py_DECREF(argstuple); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { -#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) - if (__Pyx_IsCyOrPyCFunction(func)) -#else - if (PyCFunction_Check(func)) -#endif - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - } - else if (nargs == 1 && kwargs == NULL) { - if (PyCFunction_Check(func)) - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, args[0]); - } - } - } -#endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - #if PY_VERSION_HEX >= 0x030700A1 - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif - #if CYTHON_VECTORCALL - #if Py_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif - if (f) { - return f(func, args, (size_t)nargs, kwargs); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, kwargs); - } - #endif - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); - } - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); -} - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - __Pyx_TypeName obj_type_name; - __Pyx_TypeName type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(__Pyx_TypeCheck(obj, type))) - return 1; - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_TypeError, - "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, - obj_type_name, type_name); - __Pyx_DECREF_TypeName(obj_type_name); - __Pyx_DECREF_TypeName(type_name); - return 0; -} - -/* BufferIndexError */ - static void __Pyx_RaiseBufferIndexError(int axis) { - PyErr_Format(PyExc_IndexError, - "Out of bounds on buffer access (axis %d)", axis); -} - -/* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_2 -#define __PYX_HAVE_RT_ImportType_3_0_2 -static PyTypeObject *__Pyx_ImportType_3_0_2(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_2 check_size) -{ - PyObject *result = 0; - char warning[200]; - Py_ssize_t basicsize; - Py_ssize_t itemsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - PyObject *py_itemsize; -#endif - result = PyObject_GetAttrString(module, class_name); - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#if !CYTHON_COMPILING_IN_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; - itemsize = ((PyTypeObject *)result)->tp_itemsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; - py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); - if (!py_itemsize) - goto bad; - itemsize = PyLong_AsSsize_t(py_itemsize); - Py_DECREF(py_itemsize); - py_itemsize = 0; - if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (itemsize) { - if (size % alignment) { - alignment = size % alignment; - } - if (itemsize < (Py_ssize_t)alignment) - itemsize = (Py_ssize_t)alignment; - } - if ((size_t)(basicsize + itemsize) < size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize+itemsize); - goto bad; - } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_2 && - ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd-%zd from PyObject", - module_name, class_name, size, basicsize, basicsize+itemsize); - goto bad; - } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_2 && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(result); - return NULL; -} -#endif - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif - } - } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif - return module; -} - -/* ImportDottedModule */ - #if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 - PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif - "No module named '%U'", partial_name); -#endif -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; - nparts = PyTuple_GET_SIZE(parts_tuple); - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = PySequence_ITEM(parts_tuple, i); -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -#endif -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__6; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* FixUpExtensionType */ - #if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - CYTHON_UNUSED_VAR(spec); - CYTHON_UNUSED_VAR(type); -#else - const PyType_Slot *slot = spec->slots; - while (slot && slot->slot && slot->slot != Py_tp_members) - slot++; - if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) - const -#endif - PyMemberDef *memb = (PyMemberDef*) slot->pfunc; - while (memb && memb->name) { - if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 - if (strcmp(memb->name, "__weaklistoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_weaklistoffset = memb->offset; - changed = 1; - } - else if (strcmp(memb->name, "__dictoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_dictoffset = memb->offset; - changed = 1; - } -#if CYTHON_METH_FASTCALL - else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 - type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif - changed = 1; - } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON - else if (strcmp(memb->name, "__module__") == 0) { - PyObject *descr; - assert(memb->type == T_OBJECT); - assert(memb->flags == 0 || memb->flags == READONLY); - descr = PyDescr_NewMember(type, memb); - if (unlikely(!descr)) - return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); - return -1; - } - Py_DECREF(descr); - changed = 1; - } -#endif - } - memb++; - } - if (changed) - PyType_Modified(type); - } -#endif - return 0; -} -#endif - -/* FetchSharedCythonModule */ - static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); - if (unlikely(!abi_module)) return NULL; - Py_INCREF(abi_module); - return abi_module; -} - -/* FetchCommonType */ - static int __Pyx_VerifyCachedType(PyObject *cached_type, - const char *name, - Py_ssize_t basicsize, - Py_ssize_t expected_basicsize) { - if (!PyType_Check(cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", name); - return -1; - } - if (basicsize != expected_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - name); - return -1; - } - return 0; -} -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; - const char* object_name = strrchr(spec->name, '.'); - object_name = object_name ? object_name+1 : spec->name; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif - if (__Pyx_VerifyCachedType( - cached_type, - object_name, - basicsize, - spec->basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); - if (unlikely(!cached_type)) goto bad; - if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; -done: - Py_DECREF(abi_module); - assert(cached_type == NULL || PyType_Check(cached_type)); - return (PyTypeObject *) cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#endif - -/* PyVectorcallFastCallDict */ - #if CYTHON_METH_FASTCALL -static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - PyObject *res = NULL; - PyObject *kwnames; - PyObject **newargs; - PyObject **kwvalues; - Py_ssize_t i, pos; - size_t j; - PyObject *key, *value; - unsigned long keys_are_strings; - Py_ssize_t nkw = PyDict_GET_SIZE(kw); - newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); - if (unlikely(newargs == NULL)) { - PyErr_NoMemory(); - return NULL; - } - for (j = 0; j < nargs; j++) newargs[j] = args[j]; - kwnames = PyTuple_New(nkw); - if (unlikely(kwnames == NULL)) { - PyMem_Free(newargs); - return NULL; - } - kwvalues = newargs + nargs; - pos = i = 0; - keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; - Py_INCREF(key); - Py_INCREF(value); - PyTuple_SET_ITEM(kwnames, i, key); - kwvalues[i] = value; - i++; - } - if (unlikely(!keys_are_strings)) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - goto cleanup; - } - res = vc(func, newargs, nargs, kwnames); -cleanup: - Py_DECREF(kwnames); - for (i = 0; i < nkw; i++) - Py_DECREF(kwvalues[i]); - PyMem_Free(newargs); - return res; -} -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { - return vc(func, args, nargs, NULL); - } - return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); -} -#endif - -/* CythonFunctionShared */ - static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - __Pyx_Py_XDECREF_SET( - __Pyx_CyFunction_GetClassObj(f), - ((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#else - __Pyx_Py_XDECREF_SET( - ((PyCMethodObject *) (f))->mm_class, - (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#endif -} -static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) -{ - CYTHON_UNUSED_VAR(closure); - if (unlikely(op->func_doc == NULL)) { -#if CYTHON_COMPILING_IN_LIMITED_API - op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); - if (unlikely(!op->func_doc)) return NULL; -#else - if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 - op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } -#endif - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_doc, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_name == NULL)) { -#if CYTHON_COMPILING_IN_LIMITED_API - op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_name, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_qualname); - return op->func_qualname; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_qualname, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(op); - CYTHON_UNUSED_VAR(context); - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - CYTHON_UNUSED_VAR(context); - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value || value == Py_None) { - value = NULL; - } else if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - __Pyx_Py_XDECREF_SET(op->func_annotations, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; - CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 - if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; - fromlist = PyList_New(1); - if (unlikely(!fromlist)) return NULL; - Py_INCREF(marker); -#if CYTHON_ASSUME_SAFE_MACROS - PyList_SET_ITEM(fromlist, 0, marker); -#else - if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); - Py_DECREF(fromlist); - return NULL; - } -#endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); - Py_DECREF(fromlist); - if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); - Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); - } -ignore: - PyErr_Clear(); - } -#endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); -} -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject * -__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { - CYTHON_UNUSED_VAR(context); - return PyObject_GetAttrString(op->func, "__module__"); -} -static int -__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - return PyObject_SetAttrString(op->func, "__module__", value); -} -#endif -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, -#if CYTHON_COMPILING_IN_LIMITED_API - {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, -#endif - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, -#endif -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, -#if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, -#else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#endif -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, -#else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, -#endif -#endif - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) -{ - CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 - Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { -#if !CYTHON_COMPILING_IN_LIMITED_API - PyCFunctionObject *cf = (PyCFunctionObject*) op; -#endif - if (unlikely(op == NULL)) - return NULL; -#if CYTHON_COMPILING_IN_LIMITED_API - op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); - if (unlikely(!op->func)) return NULL; -#endif - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; -#if !CYTHON_COMPILING_IN_LIMITED_API - cf->m_ml = ml; - cf->m_self = (PyObject *) op; -#endif - Py_XINCREF(closure); - op->func_closure = closure; -#if !CYTHON_COMPILING_IN_LIMITED_API - Py_XINCREF(module); - cf->m_module = module; -#endif - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - op->func_classobj = NULL; -#else - ((PyCMethodObject*)op)->mm_class = NULL; -#endif - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - op->func_is_coroutine = NULL; -#if CYTHON_METH_FASTCALL - switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { - case METH_NOARGS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; - break; - case METH_O: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; - break; - case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; - break; - case METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; - break; - case METH_VARARGS | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = NULL; - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - Py_DECREF(op); - return NULL; - } -#endif - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); -#if CYTHON_COMPILING_IN_LIMITED_API - Py_CLEAR(m->func); -#else - Py_CLEAR(((PyCFunctionObject*)m)->m_module); -#endif - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 - Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); -#else - { - PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; - ((PyCMethodObject *) (m))->mm_class = NULL; - Py_XDECREF(cls); - } -#endif -#endif - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } - return 0; -} -static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - __Pyx_PyHeapTypeObject_GC_Del(m); -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - __Pyx__CyFunction_dealloc(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - Py_VISIT(m->func_closure); -#if CYTHON_COMPILING_IN_LIMITED_API - Py_VISIT(m->func); -#else - Py_VISIT(((PyCFunctionObject*)m)->m_module); -#endif - Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API - Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } - return 0; -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", - op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif -} -static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; - PyCFunction meth; - int flags; - meth = PyCFunction_GetFunction(f); - if (unlikely(!meth)) return NULL; - flags = PyCFunction_GetFlags(f); - if (unlikely(flags < 0)) return NULL; -#else - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - int flags = f->m_ml->ml_flags; -#endif - Py_ssize_t size; - switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(arg); -#else - size = PyTuple_Size(arg); - if (unlikely(size < 0)) return NULL; -#endif - if (likely(size == 0)) - return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(arg); -#else - size = PyTuple_Size(arg); - if (unlikely(size < 0)) return NULL; -#endif - if (likely(size == 1)) { - PyObject *result, *arg0; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - arg0 = PyTuple_GET_ITEM(arg, 0); - #else - arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; - #endif - result = (*meth)(self, arg0); - #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(arg0); - #endif - return result; - } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - return NULL; - } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif - return NULL; -} -static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *self, *result; -#if CYTHON_COMPILING_IN_LIMITED_API - self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); - if (unlikely(!self) && PyErr_Occurred()) return NULL; -#else - self = ((PyCFunctionObject*)func)->m_self; -#endif - result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); - return result; -} -static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { - PyObject *result; - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL - __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); - if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS - return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); -#else - (void) &__Pyx_PyVectorcall_FastCallDict; - return PyVectorcall_Call(func, args, kw); -#endif - } -#endif - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - Py_ssize_t argc; - PyObject *new_args; - PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS - argc = PyTuple_GET_SIZE(args); -#else - argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; -#endif - new_args = PyTuple_GetSlice(args, 1, argc); - if (unlikely(!new_args)) - return NULL; - self = PyTuple_GetItem(args, 0); - if (unlikely(!self)) { - Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 - PyErr_Format(PyExc_TypeError, - "unbound method %.200S() needs an argument", - cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif - return NULL; - } - result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); - Py_DECREF(new_args); - } else { - result = __Pyx_CyFunction_Call(func, args, kw); - } - return result; -} -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) -{ - int ret = 0; - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - ret = 1; - } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - return ret; -} -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, NULL); -} -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, args[0]); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; - PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); -} -#endif -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_CyFunctionType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, - {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, - {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, - {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, - {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, - {Py_tp_methods, (void *)__pyx_CyFunction_methods}, - {Py_tp_members, (void *)__pyx_CyFunction_members}, - {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, - {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, - {0, 0}, -}; -static PyType_Spec __pyx_CyFunctionType_spec = { - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif -}; -#endif -static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { - return -1; - } - return 0; -} -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); - if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -/* CythonFunction */ - static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), - ml, flags, qualname, closure, module, globals, code - ); - if (likely(op)) { - PyObject_GC_Track(op); - } - return op; -} - -/* CLineInTraceback */ - #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; - PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif - CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { - return c_line; - } - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); - if (likely(cython_runtime_dict)) { - __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { - c_line = 0; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - return c_line; -} -#endif - -/* CodeObjectCache */ - #if !CYTHON_COMPILING_IN_LIMITED_API -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} -#endif - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, - PyObject *firstlineno, PyObject *name) { - PyObject *replace = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; - replace = PyObject_GetAttrString(code, "replace"); - if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); - Py_DECREF(replace); - return result; - } - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - PyErr_Clear(); - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #endif -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; - PyObject *replace = NULL, *getframe = NULL, *frame = NULL; - PyObject *exc_type, *exc_value, *exc_traceback; - int success = 0; - if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); - } - PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); - } - if (unlikely(!code_object)) goto bad; - getframe = PySys_GetObject("_getframe"); - if (unlikely(!getframe)) goto bad; - if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; - frame = PyEval_EvalCode(code_object, dict, dict); - if (unlikely(!frame) || frame == Py_None) goto bad; - success = 1; - bad: - PyErr_Restore(exc_type, exc_value, exc_traceback); - Py_XDECREF(code_object); - Py_XDECREF(py_py_line); - Py_XDECREF(py_funcname); - Py_XDECREF(dict); - Py_XDECREF(replace); - if (success) { - PyTraceBack_Here( - (struct _frame*)frame); - } - Py_XDECREF(frame); -} -#else -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = NULL; - PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - funcname = PyUnicode_AsUTF8(py_funcname); - if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif - } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else - py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline - return py_code; -bad: - Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject *ptype, *pvalue, *ptraceback; - if (c_line) { - c_line = __Pyx_CLineForTraceback(tstate, c_line); - } - py_code = __pyx_find_code_object(c_line ? -c_line : py_line); - if (!py_code) { - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) { - /* If the code object creation fails, then we should clear the - fetched exception references and propagate the new exception */ - Py_XDECREF(ptype); - Py_XDECREF(pvalue); - Py_XDECREF(ptraceback); - goto bad; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); - } - py_frame = PyFrame_New( - tstate, /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} -#endif - -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - __Pyx_TypeName obj_type_name; - if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface", - obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; - } - if ((0)) {} - view->obj = NULL; - Py_DECREF(obj); -} -#endif - - - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* Declarations */ - #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* Arithmetic */ - #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) -#else - static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - #if 1 - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - if (b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabsf(b.real) >= fabsf(b.imag)) { - if (b.real == 0 && b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); - } else { - float r = b.imag / b.real; - float s = (float)(1.0) / (b.real + b.imag * r); - return __pyx_t_float_complex_from_parts( - (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); - } - } else { - float r = b.real / b.imag; - float s = (float)(1.0) / (b.imag + b.real * r); - return __pyx_t_float_complex_from_parts( - (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); - } - } - #else - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - if (b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); - } else { - float denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_float_complex_from_parts( - (a.real * b.real + a.imag * b.imag) / denom, - (a.imag * b.real - a.real * b.imag) / denom); - } - } - #endif - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - return __Pyx_c_prod_float(a, a); - case 3: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(z, a); - case 4: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } else if ((b.imag == 0) && (a.real >= 0)) { - z.real = powf(a.real, b.real); - z.imag = 0; - return z; - } else if (a.real > 0) { - r = a.real; - theta = 0; - } else { - r = -a.real; - theta = atan2f(0.0, -1.0); - } - } else { - r = __Pyx_c_abs_float(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; - } - #endif -#endif - -/* Declarations */ - #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* Arithmetic */ - #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) -#else - static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - #if 1 - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabs(b.real) >= fabs(b.imag)) { - if (b.real == 0 && b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); - } else { - double r = b.imag / b.real; - double s = (double)(1.0) / (b.real + b.imag * r); - return __pyx_t_double_complex_from_parts( - (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); - } - } else { - double r = b.real / b.imag; - double s = (double)(1.0) / (b.imag + b.real * r); - return __pyx_t_double_complex_from_parts( - (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); - } - } - #else - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); - } else { - double denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_double_complex_from_parts( - (a.real * b.real + a.imag * b.imag) / denom, - (a.imag * b.real - a.real * b.imag) / denom); - } - } - #endif - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - return __Pyx_c_prod_double(a, a); - case 3: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, a); - case 4: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } else if ((b.imag == 0) && (a.real >= 0)) { - z.real = pow(a.real, b.real); - z.imag = 0; - return z; - } else if (a.real > 0) { - r = a.real; - theta = 0; - } else { - r = -a.real; - theta = atan2(0.0, -1.0); - } - } else { - r = __Pyx_c_abs_double(a); - theta = atan2(a.imag, a.real); - } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; - } - #endif -#endif - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* FormatTypeName */ - #if CYTHON_COMPILING_IN_LIMITED_API -static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) -{ - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__8); - } - return name; -} -#endif - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); -#else - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); - if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); - if (!py_bytes) goto limited_bad; - order_str = PyUnicode_FromString(little ? "little" : "big"); - if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; - result = PyObject_Call(from_bytes, arg_tuple, kwds); - limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); - Py_XDECREF(kwds); - return result; -#endif - } -} - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* FastTypeChecks */ - #if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { - while (a) { - a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); - if (a == b) - return 1; - } - return b == &PyBaseObject_Type; -} -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (a == b) return 1; - mro = a->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(a, b); -} -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (cls == a || cls == b) return 1; - mro = cls->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - PyObject *base = PyTuple_GET_ITEM(mro, i); - if (base == (PyObject *)a || base == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else -static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - if (exc_type1) { - return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); - } else { - return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); - } -} -#endif -static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - assert(PyExceptionClass_Check(exc_type)); - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i '9'); - break; - } - if (rt_from_call[i] != ctversion[i]) { - same = 0; - break; - } - } - if (!same) { - char rtversion[5] = {'\0'}; - char message[200]; - for (i=0; i<4; ++i) { - if (rt_from_call[i] == '.') { - if (found_dot) break; - found_dot = 1; - } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { - break; - } - rtversion[i] = rt_from_call[i]; - } - PyOS_snprintf(message, sizeof(message), - "compile time version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* InitStrings */ - #if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - if (!*t->p) - return -1; - if (PyObject_Hash(*t->p) == -1) - return -1; - #endif - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} -#else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (likely(PyUnicode_IS_ASCII(o))) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -} -#endif -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { - return __Pyx_PyUnicode_AsStringAndSize(o, length); - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { - int retval; - if (unlikely(!x)) return -1; - retval = __Pyx_PyObject_IsTrue(x); - Py_DECREF(x); - return retval; -} -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 - if (PyLong_Check(result)) { - if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, - "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " - "The ability to return an instance of a strict subclass of int is deprecated, " - "and may be removed in a future version of Python.", - result_type_name)) { - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; - } - __Pyx_DECREF_TypeName(result_type_name); - return result; - } -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { -#if CYTHON_USE_TYPE_SLOTS - PyNumberMethods *m; -#endif - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else - if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); -#if CYTHON_USE_TYPE_SLOTS - m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else - if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); - } - #endif -#else - if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); - } -#endif - if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(__Pyx_PyLong_IsCompact(b))) { - return __Pyx_PyLong_CompactValue(b); - } else { - const digit* digits = __Pyx_PyLong_Digits(b); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - 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])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - 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])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { - if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { - return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif - } else { - Py_ssize_t ival; - PyObject *x; - x = PyNumber_Index(o); - if (!x) return -1; - ival = PyInt_AsLong(x); - Py_DECREF(x); - return ival; - } -} -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -/* #### Code section: utility_code_pragmas_end ### */ -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - - - -/* #### Code section: end ### */ -#endif /* Py_PYTHON_H */ diff --git a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx b/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx deleted file mode 100644 index 3bfe1987..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx +++ /dev/null @@ -1,53 +0,0 @@ - -cimport numpy as np -import numpy as np - -cdef extern from "cdfdif.h": - double cdfdif(double t, int x, double *par, double *prob) - -cdef extern from "math.h": - double fabs(double) - -cdef inline double add_outlier_cdf(double y, double x, double p_outlier, double w_outlier): - return y * (1 - p_outlier) + (x + (1. / (2 * w_outlier))) * w_outlier * p_outlier - -cdef inline bint p_outlier_in_range(double p_outlier): return (p_outlier >= 0) & (p_outlier <= 1) - -def dmat_cdf_array(np.ndarray[double, ndim=1] x, double v, double sv, - double a, double z, double sz, double t, double st, double p_outlier, double w_outlier): - - #check arguments - if p_outlier > 0: - assert np.max(np.abs(x)) < (1./(2*w_outlier)), ValueError('1. / (2*w_outlier) must be smaller than RT') - - if (sv < 0) or (a <=0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z+sz/2.>1) or \ - (z-sz/2.<0) or (t-st/2.<0) or (t<0) or (st < 0) or not p_outlier_in_range(p_outlier): - raise ValueError("at least one of the parameters is out of the support") - - - cdef Py_ssize_t size = x.shape[0] - cdef np.ndarray[double, ndim=1] y = np.empty(size, dtype=np.double) - cdef int boundary - cdef double p_boundary - cdef double params[7] - cdef double epsi = 1e-10 - - #transform parameters - params[0] = a/10. - params[1] = t - params[2] = sv/10. + epsi - params[3] = z*(a/10.) - params[4] = sz*(a/10.) + epsi - params[5] = st + epsi - params[6] = v/10. - - - for i in range(size): - boundary = (int) (x[i] > 0) - y[i] = cdfdif(fabs(x[i]), boundary, params, &p_boundary) - y[i] = (1 - p_boundary) + np.sign(x[i])*y[i] - - #add p_outlier probability - y[i] = add_outlier_cdf(y[i], x[i], p_outlier, w_outlier) - - return y diff --git a/src/hssm/likelihoods/hddm_wfpt/integrate.pxi b/src/hssm/likelihoods/hddm_wfpt/integrate.pxi deleted file mode 100644 index c2505c9c..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/integrate.pxi +++ /dev/null @@ -1,206 +0,0 @@ -#cython: embedsignature=True -#cython: cdivision=True -#cython: wraparound=False -#cython: boundscheck=False - -import numpy as np -cimport numpy as np -cimport cython - -include 'pdf.pxi' - -cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, - double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: - #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" - #assert ((ub_t-lb_t)*(ub_z-lb_z)==0 and (n_sz*n_st)==0), "the function is defined for 1D-integration only" - - cdef double ht, hz - cdef int n = max(n_st, n_sz) - if n_st==0: #integration over z - hz = (ub_z-lb_z)/n - ht = 0 - lb_t = t - ub_t = t - else: #integration over t - hz = 0 - ht = (ub_t-lb_t)/n - lb_z = z - ub_z = z - - cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) - cdef double z_tag, t_tag, y - cdef int i - - for i from 1 <= i <= n: - z_tag = lb_z + hz * i - t_tag = lb_t + ht * i - y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) - if i&1: #check if i is odd - S += (4 * y) - else: - S += (2 * y) - S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y - S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st - - return ((ht+hz) * S / 3) - -cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: - #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" - #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) - - cdef double ht - cdef double S - cdef double t_tag, y - cdef int i_t - - ht = (ub_t-lb_t)/n_st - - S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) - - for i_t from 1 <= i_t <= n_st: - t_tag = lb_t + ht * i_t - y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) - if i_t&1: #check if i is odd - S += (4 * y) - else: - S += (2 * y) - S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y - S = S/ (ub_t-lb_t) - - return (ht * S / 3) - -cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, - double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, - double S, double f_beg, double f_end, double f_mid, int bottom) nogil: - - cdef double z_c, z_d, z_e, t_c, t_d, t_e, h - cdef double fd, fe - cdef double Sleft, Sright, S2 - #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) - - if (ub_t-lb_t) == 0: #integration over sz - h = ub_z - lb_z - z_c = (ub_z + lb_z)/2. - z_d = (lb_z + z_c)/2. - z_e = (z_c + ub_z)/2. - t_c = t - t_d = t - t_e = t - - else: #integration over t - h = ub_t - lb_t - t_c = (ub_t + lb_t)/2. - t_d = (lb_t + t_c)/2. - t_e = (t_c + ub_t)/2. - z_c = z - z_d = z - z_e = z - - fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT - fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT - - Sleft = (h/12)*(f_beg + 4*fd + f_mid) - Sright = (h/12)*(f_mid + 4*fe + f_end) - S2 = Sleft + Sright - if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): - return S2 + (S2 - S)/15 - return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - lb_z, z_c, lb_t, t_c, ZT, simps_err/2, - Sleft, f_beg, f_mid, fd, bottom-1) + \ - adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - z_c, ub_z, t_c, ub_t, ZT, simps_err/2, - Sright, f_mid, f_end, fe, bottom-1) - -cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, - double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, - double simps_err, int maxRecursionDepth) nogil: - - cdef double h - - if (ub_t - lb_t) == 0: #integration over z - lb_t = t - ub_t = t - h = ub_z - lb_z - else: #integration over t - h = (ub_t-lb_t) - lb_z = z - ub_z = z - - cdef double ZT = h - cdef double c_t = (lb_t + ub_t)/2. - cdef double c_z = (lb_z + ub_z)/2. - - cdef double f_beg, f_end, f_mid, S - f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT - f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT - f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT - S = (h/6)*(f_beg + 4*f_mid + f_end) - cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - lb_z, ub_z, lb_t, ub_t, ZT, simps_err, - S, f_beg, f_end, f_mid, maxRecursionDepth) - return res - -cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, - double a, double z, double t, double - pdf_err, double err_1d, double lb_z, - double ub_z, double lb_t, double - ub_t, double st, double err_2d, double - S, double f_beg, double f_end, double - f_mid, int maxRecursionDepth_sz, int - bottom) nogil: - - cdef double fd, fe - cdef double Sleft, Sright, S2 - #print "in AdaptiveSimpsAux_2D: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) - - cdef double t_c = (ub_t + lb_t)/2. - cdef double t_d = (lb_t + t_c)/2. - cdef double t_e = (t_c + ub_t)/2. - cdef double h = ub_t - lb_t - - fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, - 0, 0, err_1d, maxRecursionDepth_sz)/st - fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, - 0, 0, err_1d, maxRecursionDepth_sz)/st - - Sleft = (h/12)*(f_beg + 4*fd + f_mid) - Sright = (h/12)*(f_mid + 4*fe + f_end) - S2 = Sleft + Sright - - if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): - return S2 + (S2 - S)/15; - - return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, - lb_z, ub_z, lb_t, t_c, st, err_2d/2, - Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ - adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, - lb_z, ub_z, t_c, ub_t, st, err_2d/2, - Sright, f_mid, f_end, fe, maxRecursionDepth_sz, bottom-1) - - -cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, - double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, - double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: - - cdef double h = (ub_t-lb_t) - - cdef double st = (ub_t - lb_t) - cdef double c_t = (lb_t + ub_t)/2. - cdef double c_z = (lb_z + ub_z)/2. - - cdef double f_beg, f_end, f_mid, S - cdef double err_1d = simps_err - cdef double err_2d = simps_err - - f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, - 0, 0, err_1d, maxRecursionDepth_sz)/st - - f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, - 0, 0, err_1d, maxRecursionDepth_sz)/st - f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, - 0, 0, err_1d, maxRecursionDepth_sz)/st - S = (h/6)*(f_beg + 4*f_mid + f_end) - cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, - lb_z, ub_z, lb_t, ub_t, st, err_2d, - S, f_beg, f_end, f_mid, maxRecursionDepth_sz, maxRecursionDepth_st) - return res diff --git a/src/hssm/likelihoods/hddm_wfpt/pdf.pxi b/src/hssm/likelihoods/hddm_wfpt/pdf.pxi deleted file mode 100644 index 3964f74c..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/pdf.pxi +++ /dev/null @@ -1,146 +0,0 @@ -#cython: embedsignature=True -#cython: cdivision=True -#cython: wraparound=False -#cython: boundscheck=False - -cimport cython - -#include "integrate.pxi" - -#from libc.math cimport tan, sin, cos, log, exp, sqrt, fmax, pow, ceil, floor, fabs, M_PI - -cdef extern from "math.h" nogil: - double sin(double) - double cos(double) - double log(double) - double exp(double) - double sqrt(double) -# double fmax(double, double) - double pow(double, double) - double ceil(double) - double floor(double) - double fabs(double) - double M_PI - -cdef extern from "" namespace "std" nogil: - T max[T](T a, T b) - -cdef double ftt_01w(double tt, double w, double err) nogil: - """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method - and implementation of Navarro & Fuss, 2009. - """ - cdef double kl, ks, p - cdef int k, K, lower, upper - - # calculate number of terms needed for large t - if M_PI*tt*err<1: # if error threshold is set low enough - kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound - kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met - else: # if error threshold set too high - kl=1./(M_PI*sqrt(tt)) # set to boundary condition - - # calculate number of terms needed for small t - if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough - ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound - ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met - else: # if error threshold was set too high - ks=2 # minimal kappa for that case - - # compute f(tt|0,1,w) - p=0 #initialize density - if ks(ceil(ks)) # round to smallest integer meeting error - lower = (-floor((K-1)/2.)) - upper = (ceil((K-1)/2.)) - for k from lower <= k <= upper: # loop over k - p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum - p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term - - else: # if large t is better... - K=(ceil(kl)) # round to smallest integer meeting error - for k from 1 <= k <= K: - p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum - p*=M_PI # add con_stant term - - return p - -cdef inline double prob_ub(double v, double a, double z) nogil: - """Probability of hitting upper boundary.""" - if v == 0: - return z - else: - return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) - -cdef double pdf(double x, double v, double a, double w, double err) nogil: - """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method - and implementation of Navarro & Fuss, 2009. - """ - if x <= 0: - return 0 - - cdef double tt = x/a**2 # use normalized time - cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) - - # convert to f(t|v,a,w) - return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) - -cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: - """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method - and implementation of Navarro & Fuss, 2009. - sv is the std of the drift rate - """ - if x <= 0: - return 0 - - if sv==0: - return pdf(x, v, a, z, err) - - cdef double tt = x/(pow(a,2)) # use normalized time - cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) - - # convert to f(t|v,a,w) - return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - -cpdef double full_pdf(double x, double v, double sv, double a, double - z, double sz, double t, double st, double err, int - n_st=2, int n_sz=2, bint use_adaptive=1, double - simps_err=1e-3) nogil: - """full pdf""" - - # Check if parpameters are valid - if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ - ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): - return 0 - - # transform x,v,z if x is upper bound response - if x > 0: - v = -v - z = 1.-z - - x = fabs(x) - - if st<1e-3: - st = 0 - if sz <1e-3: - sz = 0 - - if (sz==0): - if (st==0): #sv=0,sz=0,st=0 - return pdf_sv(x - t, v, sv, a, z, err) - else: #sv=0,sz=0,st=$ - if use_adaptive>0: - return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) - else: - return simpson_1D(x, v, sv, a, z, t, err, z, z, 0, t-st/2., t+st/2., n_st) - - else: #sz=$ - if (st==0): #sv=0,sz=$,st=0 - if use_adaptive: - return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) - else: - return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) - else: #sv=0,sz=$,st=$ - if use_adaptive: - return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) - else: - return simpson_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t-st/2., t+st/2., n_st) diff --git a/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp b/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp deleted file mode 100644 index 26aa1ba7..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/wfpt.cpp +++ /dev/null @@ -1,31774 +0,0 @@ -/* Generated by Cython 3.0.2 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayscalars.h", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h", - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include/numpy/ufuncobject.h" - ], - "extra_compile_args": [ - "-stdlib=libc++" - ], - "extra_link_args": [ - "-stdlib=libc++", - "-mmacosx-version-min=10.9" - ], - "include_dirs": [ - "/private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/core/include" - ], - "language": "c++", - "name": "wfpt", - "sources": [ - "src/hssm/likelihoods/hddm_wfpt/wfpt.pyx" - ] - }, - "module_name": "wfpt" -} -END: Cython Metadata */ - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif -#endif - -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" -#else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_2" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030002F0 -#define CYTHON_FUTURE_DIVISION 1 -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX -#if defined(GRAALVM_PYTHON) - /* For very preliminary testing purposes. Most variables are set the same as PyPy. - The existence of this section does not imply that anything works or is even tested */ - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PYPY_VERSION) - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #if PY_VERSION_HEX < 0x03090000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(CYTHON_LIMITED_API) - #ifdef Py_LIMITED_API - #undef __PYX_LIMITED_VERSION_HEX - #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API - #endif - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 1 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 1 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #endif - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PY_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #ifndef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 1 - #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) - #endif - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #if PY_VERSION_HEX < 0x030600B1 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) - #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) - #define CYTHON_USE_EXC_INFO_STACK 1 - #endif - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif -#endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) -#endif -#if !defined(CYTHON_VECTORCALL) -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) -#endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif - #undef SHIFT - #undef BASE - #undef MASK - #ifdef SIZEOF_VOID_P - enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; - #endif -#endif -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif -#ifndef __has_cpp_attribute - #define __has_cpp_attribute(x) 0 -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifndef CYTHON_UNUSED - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(maybe_unused) - #define CYTHON_UNUSED [[maybe_unused]] - #endif - #endif - #endif -#endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_UNUSED_VAR -# if defined(__cplusplus) - template void CYTHON_UNUSED_VAR( const T& ) { } -# else -# define CYTHON_UNUSED_VAR(x) (void)(x) -# endif -#endif -#ifndef CYTHON_MAYBE_UNUSED_VAR - #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_USE_CPP_STD_MOVE - #if defined(__cplusplus) && (\ - __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) - #define CYTHON_USE_CPP_STD_MOVE 1 - #else - #define CYTHON_USE_CPP_STD_MOVE 0 - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif -#ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] - #endif - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_attribute(fallthrough) - #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) - #else - #define CYTHON_FALLTHROUGH - #endif - #endif - #if defined(__clang__) && defined(__apple_build_version__) - #if __apple_build_version__ < 7000000 - #undef CYTHON_FALLTHROUGH - #define CYTHON_FALLTHROUGH - #endif - #endif -#endif -#ifdef __cplusplus - template - struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; - #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) -#else - #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) -#endif -#if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) -#else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) -#endif -#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) - -#ifndef __cplusplus - #error "Cython files generated with the C++ option must be compiled with a C++ compiler." -#endif -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #else - #define CYTHON_INLINE inline - #endif -#endif -template -void __Pyx_call_destructor(T& x) { - x.~T(); -} -template -class __Pyx_FakeReference { - public: - __Pyx_FakeReference() : ptr(NULL) { } - __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } - T *operator->() { return ptr; } - T *operator&() { return ptr; } - operator T&() { return *ptr; } - template bool operator ==(const U& other) const { return *ptr == other; } - template bool operator !=(const U& other) const { return *ptr != other; } - template bool operator==(const __Pyx_FakeReference& other) const { return *ptr == *other.ptr; } - template bool operator!=(const __Pyx_FakeReference& other) const { return *ptr != *other.ptr; } - private: - T *ptr; -}; - -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type -#if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - PyObject *version_info; // borrowed - PyObject *py_minor_version = NULL; - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } - #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 - #endif - #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 - #endif - #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 - #endif - #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 - #endif - #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 - #endif - #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 - #endif - #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 - #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#endif -#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) - #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) -#else - #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) - #define __Pyx_Py_Is(x, y) Py_Is(x, y) -#else - #define __Pyx_Py_Is(x, y) ((x) == (y)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) - #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) -#else - #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) - #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) -#else - #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) - #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) -#else - #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) -#endif -#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) -#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) -#else - #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) -#endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#ifndef Py_TPFLAGS_SEQUENCE - #define Py_TPFLAGS_SEQUENCE 0 -#endif -#ifndef Py_TPFLAGS_MAPPING - #define Py_TPFLAGS_MAPPING 0 -#endif -#ifndef METH_STACKLESS - #define METH_STACKLESS 0 -#endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) - #ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - #endif - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); - typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords -#endif -#if CYTHON_METH_FASTCALL - #define __Pyx_METH_FASTCALL METH_FASTCALL - #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast - #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords -#else - #define __Pyx_METH_FASTCALL METH_VARARGS - #define __Pyx_PyCFunction_FastCall PyCFunction - #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords -#endif -#if CYTHON_VECTORCALL - #define __pyx_vectorcallfunc vectorcallfunc - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET - #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) -#else - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) -#endif -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) - typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); -#else - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) - #define __Pyx_PyCMethod PyCMethod -#endif -#ifndef METH_METHOD - #define METH_METHOD 0x200 -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyThreadState_Current PyThreadState_Get() -#elif !CYTHON_FAST_THREAD_STATE - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#else - #define __Pyx_PyThreadState_Current _PyThreadState_Current -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) -{ - void *result; - result = PyModule_GetState(op); - if (!result) - Py_FatalError("Couldn't find the module state"); - return result; -} -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) -#else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif -#endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) -#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) -#else -#define __Pyx_PyDict_NewPresized(n) PyDict_New() -#endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS -#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { - PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); - if (res == NULL) PyErr_Clear(); - return res; -} -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) -#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#else -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { -#if CYTHON_COMPILING_IN_PYPY - return PyDict_GetItem(dict, name); -#else - PyDictEntry *ep; - PyDictObject *mp = (PyDictObject*) dict; - long hash = ((PyStringObject *) name)->ob_shash; - assert(hash != -1); - ep = (mp->ma_lookup)(mp, name, hash); - if (ep == NULL) { - return NULL; - } - return ep->me_value; -#endif -} -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#endif -#if CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) - #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) -#else - #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) - #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) -#endif -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 -#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ - assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ - PyObject_GC_Del(obj);\ - Py_DECREF(type);\ -} -#else -#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) - #define __Pyx_PyUnicode_DATA(u) ((void*)u) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_READY(op) (0) - #else - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) - #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) - #else - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #if !defined(PyUnicode_DecodeUnicodeEscape) - #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) - #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) - #endif - #if !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) - #endif - #if !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) - #endif -#endif -#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)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#if CYTHON_COMPILING_IN_CPYTHON - #define __Pyx_PySequence_ListKeepNew(obj)\ - (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) -#else - #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) -#endif -#if PY_VERSION_HEX >= 0x030900A4 - #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) -#else - #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) -#endif -#if CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) - #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) - #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) - #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) - #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) - #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) - #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) - #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) -#else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) - #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) - #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) - #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) - #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) - #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif -#else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef __Pyx_PyAsyncMethodsStruct - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - } __Pyx_PyAsyncMethodsStruct; -#endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ - { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } - -#ifdef CYTHON_EXTERN_C - #undef __PYX_EXTERN_C - #define __PYX_EXTERN_C CYTHON_EXTERN_C -#elif defined(__PYX_EXTERN_C) - #ifdef _MSC_VER - #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") - #else - #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. - #endif -#else - #define __PYX_EXTERN_C extern "C++" -#endif - -#define __PYX_HAVE__wfpt -#define __PYX_HAVE_API__wfpt -/* Early includes */ -#include -#include - - /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */ - -#include "numpy/arrayobject.h" -#include "numpy/ndarrayobject.h" -#include "numpy/ndarraytypes.h" -#include "numpy/arrayscalars.h" -#include "numpy/ufuncobject.h" -#include "math.h" -#include -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { - return (size_t) i < (size_t) limit; -} -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) - #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif -#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -#define __Pyx_PySequence_Tuple(obj)\ - (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); -#if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_VERSION_HEX >= 0x030C00A7 - #ifndef _PyLong_SIGN_MASK - #define _PyLong_SIGN_MASK 3 - #endif - #ifndef _PyLong_NON_SIZE_BITS - #define _PyLong_NON_SIZE_BITS 3 - #endif - #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) - #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) - #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) - #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) - #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_SignedDigitCount(x)\ - ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) - #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) - #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) - #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) - #else - #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) - #endif - typedef Py_ssize_t __Pyx_compact_pylong; - typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 - #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) - #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) - #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) - #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) - #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) - #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) - #define __Pyx_PyLong_CompactValue(x)\ - ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) - typedef sdigit __Pyx_compact_pylong; - typedef digit __Pyx_compact_upylong; - #endif - #if PY_VERSION_HEX >= 0x030C00A5 - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) - #else - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) - #endif -#endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ -static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } - -#if !CYTHON_USE_MODULE_STATE -static PyObject *__pyx_m = NULL; -#endif -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; -static const char *__pyx_filename; - -/* Header.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif -#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) - #undef _Complex_I - #define _Complex_I 1.0fj -#endif - -/* #### Code section: filename_table ### */ - -static const char *__pyx_f[] = { - "src/hssm/likelihoods/hddm_wfpt/wfpt.pyx", - "__init__.cython-30.pxd", - "src/hssm/likelihoods/hddm_wfpt/pdf.pxi", - "src/hssm/likelihoods/hddm_wfpt/integrate.pxi", - "type.pxd", -}; -/* #### Code section: utility_code_proto_before_types ### */ -/* NoFastGil.proto */ -#define __Pyx_PyGILState_Ensure PyGILState_Ensure -#define __Pyx_PyGILState_Release PyGILState_Release -#define __Pyx_FastGIL_Remember() -#define __Pyx_FastGIL_Forget() -#define __Pyx_FastGilFuncInit() - -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif - -/* BufferFormatStructs.proto */ -struct __Pyx_StructField_; -#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) -typedef struct { - const char* name; - struct __Pyx_StructField_* fields; - size_t size; - size_t arraysize[8]; - int ndim; - char typegroup; - char is_unsigned; - int flags; -} __Pyx_TypeInfo; -typedef struct __Pyx_StructField_ { - __Pyx_TypeInfo* type; - const char* name; - size_t offset; -} __Pyx_StructField; -typedef struct { - __Pyx_StructField* field; - size_t parent_offset; -} __Pyx_BufFmt_StackElem; -typedef struct { - __Pyx_StructField root; - __Pyx_BufFmt_StackElem* head; - size_t fmt_offset; - size_t new_count, enc_count; - size_t struct_alignment; - int is_complex; - char enc_type; - char new_packmode; - char enc_packmode; - char is_valid_array; -} __Pyx_BufFmt_Context; - -/* #### Code section: numeric_typedefs ### */ - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 - * ctypedef npy_double float_t - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cfloat cfloat_t - */ -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -/* #### Code section: complex_type_declarations ### */ -/* Declarations.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* Declarations.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* #### Code section: type_declarations ### */ - -/*--- Type declarations ---*/ - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; -struct __pyx_opt_args_4wfpt_full_pdf; - -/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 - * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * - * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< - * z, double sz, double t, double st, double err, int - * n_st=2, int n_sz=2, bint use_adaptive=1, double - */ -struct __pyx_opt_args_4wfpt_full_pdf { - int __pyx_n; - int n_st; - int n_sz; - int use_adaptive; - double simps_err; -}; -/* #### Code section: utility_code_proto ### */ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, Py_ssize_t); - void (*DECREF)(void*, PyObject*, Py_ssize_t); - void (*GOTREF)(void*, PyObject*, Py_ssize_t); - void (*GIVEREF)(void*, PyObject*, Py_ssize_t); - void* (*SetupContext)(const char*, Py_ssize_t, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - } - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContextNogil() - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_Py_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; Py_XDECREF(tmp);\ - } while (0) -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#if PY_VERSION_HEX >= 0x030C00A6 -#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) -#else -#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) -#endif -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) -#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif -#else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* ErrOccurredWithGIL.proto */ -static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); - -/* TupleAndListFromArray.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); -static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); -#endif - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* fastcall.proto */ -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) -#elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) -#else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed -#endif -#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) -#define __Pyx_KwValues_VARARGS(args, nargs) NULL -#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) -#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) -#if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) - #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) - static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); - #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array -#else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS - #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS - #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS - #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS - #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) -#endif - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* ArgTypeTest.proto */ -#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ - ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ - __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); - -/* IsLittleEndian.proto */ -static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); - -/* BufferFormatCheck.proto */ -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); - -/* BufferGetAndValidate.proto */ -#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ - ((obj == Py_None || obj == NULL) ?\ - (__Pyx_ZeroBuffer(buf), 0) :\ - __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) -static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, - __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); -static void __Pyx_ZeroBuffer(Py_buffer* buf); -static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; -static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif - -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) do {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) -/* BufferFallbackError.proto */ -static void __Pyx_RaiseBufferFallbackError(void); - -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectFastCall.proto */ -#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); -#define __Pyx_PyObject_Dict_GetItem(obj, name)\ - (likely(PyDict_CheckExact(obj)) ?\ - __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) -#else -#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) -#endif - -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* ObjectGetItem.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); -#else -#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) -#endif - -#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) -/* PyIntCompare.proto */ -static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); - -/* PyIntBinop.proto */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); -#else -#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ - (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) -#endif - -/* PyIntBinop.proto */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); -#else -#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\ - (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) -#endif - -/* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_2 -#define __PYX_HAVE_RT_ImportType_proto_3_0_2 -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#include -#endif -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_2(s) alignof(s) -#else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_2(s) sizeof(void*) -#endif -enum __Pyx_ImportType_CheckSize_3_0_2 { - __Pyx_ImportType_CheckSize_Error_3_0_2 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_2 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_2 = 2 -}; -static PyTypeObject *__Pyx_ImportType_3_0_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_2 check_size); -#endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* IncludeStructmemberH.proto */ -#include - -/* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif - -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); - -/* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif - -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif - -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); -#endif - -/* CythonFunctionShared.proto */ -#define __Pyx_CyFunction_USED -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CYFUNCTION_COROUTINE 0x08 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#else - #define __Pyx_CyFunction_GetClassObj(f)\ - ((PyObject*) ((PyCMethodObject *) (f))->mm_class) -#endif -#define __Pyx_CyFunction_SetClassObj(f, classobj)\ - __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject_HEAD - PyObject *func; -#elif PY_VERSION_HEX < 0x030900B1 - PyCFunctionObject func; -#else - PyCMethodObject func; -#endif -#if CYTHON_BACKPORT_VECTORCALL - __pyx_vectorcallfunc func_vectorcall; -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - PyObject *func_classobj; -#endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; - PyObject *func_is_coroutine; -} __pyx_CyFunctionObject; -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(PyObject *module); -#if CYTHON_METH_FASTCALL -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL -#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) -#else -#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) -#endif -#endif - -/* CythonFunction.proto */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); - -/* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); -#endif - -/* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* BufferStructDeclare.proto */ -typedef struct { - Py_ssize_t shape, strides, suboffsets; -} __Pyx_Buf_DimInfo; -typedef struct { - size_t refcount; - Py_buffer pybuffer; -} __Pyx_Buffer; -typedef struct { - __Pyx_Buffer *rcbuffer; - char *data; - __Pyx_Buf_DimInfo diminfo[8]; -} __Pyx_LocalBuf_ND; - -#if PY_MAJOR_VERSION < 3 - static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); - static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else - #define __Pyx_GetBuffer PyObject_GetBuffer - #define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - - -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - -/* RealImag.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX\ - && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) - #define __Pyx_SET_CREAL(z,x) ((z).real(x)) - #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) -#else - #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) - #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) -#endif - -/* Arithmetic.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #define __Pyx_c_eq_float(a, b) ((a)==(b)) - #define __Pyx_c_sum_float(a, b) ((a)+(b)) - #define __Pyx_c_diff_float(a, b) ((a)-(b)) - #define __Pyx_c_prod_float(a, b) ((a)*(b)) - #define __Pyx_c_quot_float(a, b) ((a)/(b)) - #define __Pyx_c_neg_float(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero_float(z) ((z)==(float)0) - #define __Pyx_c_conj_float(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs_float(z) (::std::abs(z)) - #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero_float(z) ((z)==0) - #define __Pyx_c_conj_float(z) (conjf(z)) - #if 1 - #define __Pyx_c_abs_float(z) (cabsf(z)) - #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); - #if 1 - static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); - #endif -#endif - -/* Arithmetic.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #define __Pyx_c_eq_double(a, b) ((a)==(b)) - #define __Pyx_c_sum_double(a, b) ((a)+(b)) - #define __Pyx_c_diff_double(a, b) ((a)-(b)) - #define __Pyx_c_prod_double(a, b) ((a)*(b)) - #define __Pyx_c_quot_double(a, b) ((a)/(b)) - #define __Pyx_c_neg_double(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero_double(z) ((z)==(double)0) - #define __Pyx_c_conj_double(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs_double(z) (::std::abs(z)) - #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero_double(z) ((z)==0) - #define __Pyx_c_conj_double(z) (conj(z)) - #if 1 - #define __Pyx_c_abs_double(z) (cabs(z)) - #define __Pyx_c_pow_double(a, b) (cpow(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); - #if 1 - static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); - #endif -#endif - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* FormatTypeName.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -typedef PyObject *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); -#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) -#else -typedef const char *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) -#define __Pyx_DECREF_TypeName(obj) -#endif - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* FastTypeChecks.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); -#else -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) -#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) -#endif -#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - -/* #### Code section: module_declarations ### */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/ - -/* Module declarations from "libc.string" */ - -/* Module declarations from "libc.stdio" */ - -/* Module declarations from "__builtin__" */ - -/* Module declarations from "cpython.type" */ - -/* Module declarations from "cpython" */ - -/* Module declarations from "cpython.object" */ - -/* Module declarations from "cpython.ref" */ - -/* Module declarations from "numpy" */ - -/* Module declarations from "numpy" */ - -/* Module declarations from "cython" */ - -/* Module declarations from "wfpt" */ -static double __pyx_f_4wfpt_ftt_01w(double, double, double); /*proto*/ -static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double, double, double); /*proto*/ -static double __pyx_f_4wfpt_pdf(double, double, double, double, double); /*proto*/ -static double __pyx_f_4wfpt_pdf_sv(double, double, double, double, double, double); /*proto*/ -static double __pyx_f_4wfpt_full_pdf(double, double, double, double, double, double, double, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4wfpt_full_pdf *__pyx_optional_args); /*proto*/ -static double __pyx_f_4wfpt_simpson_1D(double, double, double, double, double, double, double, double, double, int, double, double, int); /*proto*/ -static double __pyx_f_4wfpt_simpson_2D(double, double, double, double, double, double, double, double, double, int, double, double, int); /*proto*/ -static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, int); /*proto*/ -static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double, double, double, double, double, double, double, double, double, double, double, double, int); /*proto*/ -static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, int, int); /*proto*/ -static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double, double, double, double, double, double, double, double, double, double, double, double, int, int); /*proto*/ -static CYTHON_INLINE int __pyx_f_4wfpt_p_outlier_in_range(double); /*proto*/ -/* #### Code section: typeinfo ### */ -static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_long = { "long", NULL, sizeof(long), { 0 }, 0, __PYX_IS_UNSIGNED(long) ? 'U' : 'I', __PYX_IS_UNSIGNED(long), 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 }; -/* #### Code section: before_global_var ### */ -#define __Pyx_MODULE_NAME "wfpt" -extern int __pyx_module_is_main_wfpt; -int __pyx_module_is_main_wfpt = 0; - -/* Implementation of "wfpt" */ -/* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_ImportError; -/* #### Code section: string_decls ### */ -static const char __pyx_k_N[] = "N"; -static const char __pyx_k_a[] = "a"; -static const char __pyx_k_i[] = "i"; -static const char __pyx_k_j[] = "j"; -static const char __pyx_k_p[] = "p"; -static const char __pyx_k_q[] = "q"; -static const char __pyx_k_s[] = "s"; -static const char __pyx_k_t[] = "t"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k_x[] = "x"; -static const char __pyx_k_y[] = "y"; -static const char __pyx_k_z[] = "z"; -static const char __pyx_k_ij[] = "ij"; -static const char __pyx_k_lb[] = "lb"; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_qs[] = "qs"; -static const char __pyx_k_st[] = "st"; -static const char __pyx_k_sv[] = "sv"; -static const char __pyx_k_sz[] = "sz"; -static const char __pyx_k_ub[] = "ub"; -static const char __pyx_k_xs[] = "xs"; -static const char __pyx_k__24[] = "*"; -static const char __pyx_k__25[] = "."; -static const char __pyx_k__41[] = "?"; -static const char __pyx_k_err[] = "err"; -static const char __pyx_k_exp[] = "exp"; -static const char __pyx_k_i_p[] = "i_p"; -static const char __pyx_k_idx[] = "idx"; -static const char __pyx_k_inf[] = "inf"; -static const char __pyx_k_log[] = "log"; -static const char __pyx_k_max[] = "max"; -static const char __pyx_k_min[] = "min"; -static const char __pyx_k_sum[] = "sum"; -static const char __pyx_k_alfa[] = "alfa"; -static const char __pyx_k_axis[] = "axis"; -static const char __pyx_k_copy[] = "copy"; -static const char __pyx_k_core[] = "core"; -static const char __pyx_k_data[] = "data"; -static const char __pyx_k_diff[] = "diff"; -static const char __pyx_k_logp[] = "logp"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_n_st[] = "n_st"; -static const char __pyx_k_n_sz[] = "n_sz"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_size[] = "size"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_tile[] = "tile"; -static const char __pyx_k_time[] = "time"; -static const char __pyx_k_wfpt[] = "wfpt"; -static const char __pyx_k_x_lb[] = "x_lb"; -static const char __pyx_k_x_ub[] = "x_ub"; -static const char __pyx_k_alpha[] = "alpha"; -static const char __pyx_k_array[] = "array"; -static const char __pyx_k_drift[] = "drift"; -static const char __pyx_k_dtype[] = "dtype"; -static const char __pyx_k_empty[] = "empty"; -static const char __pyx_k_log_p[] = "log_p"; -static const char __pyx_k_model[] = "model"; -static const char __pyx_k_multi[] = "multi"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_param[] = "param"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_scipy[] = "scipy"; -static const char __pyx_k_stack[] = "stack"; -static const char __pyx_k_t_max[] = "t_max"; -static const char __pyx_k_t_min[] = "t_min"; -static const char __pyx_k_umath[] = "umath"; -static const char __pyx_k_zeros[] = "zeros"; -static const char __pyx_k_arange[] = "arange"; -static const char __pyx_k_astype[] = "astype"; -static const char __pyx_k_cont_x[] = "cont_x"; -static const char __pyx_k_cumsum[] = "cumsum"; -static const char __pyx_k_double[] = "double"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_ll_min[] = "ll_min"; -static const char __pyx_k_n_cont[] = "n_cont"; -static const char __pyx_k_params[] = "params"; -static const char __pyx_k_rl_arr[] = "rl_arr"; -static const char __pyx_k_s_size[] = "s_size"; -static const char __pyx_k_unique[] = "unique"; -static const char __pyx_k_float32[] = "float32"; -static const char __pyx_k_maximum[] = "maximum"; -static const char __pyx_k_network[] = "network"; -static const char __pyx_k_squeeze[] = "squeeze"; -static const char __pyx_k_cumtrapz[] = "cumtrapz"; -static const char __pyx_k_feedback[] = "feedback"; -static const char __pyx_k_full_pdf[] = "full_pdf"; -static const char __pyx_k_linspace[] = "linspace"; -static const char __pyx_k_n_params[] = "n_params"; -static const char __pyx_k_pos_alfa[] = "pos_alfa"; -static const char __pyx_k_pos_cont[] = "pos_cont"; -static const char __pyx_k_response[] = "response"; -static const char __pyx_k_rl_alpha[] = "rl_alpha"; -static const char __pyx_k_split_by[] = "split_by"; -static const char __pyx_k_sum_logp[] = "sum_logp"; -static const char __pyx_k_tp_scale[] = "tp_scale"; -static const char __pyx_k_cdf_array[] = "cdf_array"; -static const char __pyx_k_data_copy[] = "data_copy"; -static const char __pyx_k_feedbacks[] = "feedbacks"; -static const char __pyx_k_integrate[] = "integrate"; -static const char __pyx_k_lower_bnd[] = "lower_bnd"; -static const char __pyx_k_p_outlier[] = "p_outlier"; -static const char __pyx_k_params_rl[] = "params_rl"; -static const char __pyx_k_pdf_array[] = "pdf_array"; -static const char __pyx_k_pos_alpha[] = "pos_alpha"; -static const char __pyx_k_responses[] = "responses"; -static const char __pyx_k_simps_err[] = "simps_err"; -static const char __pyx_k_split_cdf[] = "split_cdf"; -static const char __pyx_k_upper_bnd[] = "upper_bnd"; -static const char __pyx_k_w_outlier[] = "w_outlier"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_params_ssm[] = "params_ssm"; -static const char __pyx_k_wp_outlier[] = "wp_outlier"; -static const char __pyx_k_ImportError[] = "ImportError"; -static const char __pyx_k_concatenate[] = "concatenate"; -static const char __pyx_k_cumm_s_size[] = "cumm_s_size"; -static const char __pyx_k_params_bnds[] = "params_bnds"; -static const char __pyx_k_params_iter[] = "params_iter"; -static const char __pyx_k_wiener_like[] = "wiener_like"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_responses_qs[] = "responses_qs"; -static const char __pyx_k_use_adaptive[] = "use_adaptive"; -static const char __pyx_k_class_getitem[] = "__class_getitem__"; -static const char __pyx_k_wiener_like_rl[] = "wiener_like_rl"; -static const char __pyx_k_scipy_integrate[] = "scipy.integrate"; -static const char __pyx_k_predict_on_batch[] = "predict_on_batch"; -static const char __pyx_k_gen_cdf_using_pdf[] = "gen_cdf_using_pdf"; -static const char __pyx_k_wiener_like_multi[] = "wiener_like_multi"; -static const char __pyx_k_wiener_like_rlddm[] = "wiener_like_rlddm"; -static const char __pyx_k_wiener_logp_array[] = "wiener_logp_array"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_wiener_like_rlssm_nn[] = "wiener_like_rlssm_nn"; -static const char __pyx_k_wiener_like_contaminant[] = "wiener_like_contaminant"; -static const char __pyx_k_wiener_like_multi_rlddm[] = "wiener_like_multi_rlddm"; -static const char __pyx_k_wiener_like_multi_nn_mlp[] = "wiener_like_multi_nn_mlp"; -static const char __pyx_k_wiener_like_rlssm_nn_reg[] = "wiener_like_rlssm_nn_reg"; -static const char __pyx_k_wiener_like_multi_nn_mlp_pdf[] = "wiener_like_multi_nn_mlp_pdf"; -static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; -static const char __pyx_k_at_least_one_of_the_parameters_i[] = "at least one of the parameters is out of the support"; -static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; -static const char __pyx_k_src_hssm_likelihoods_hddm_wfpt_p[] = "src/hssm/likelihoods/hddm_wfpt/pdf.pxi"; -static const char __pyx_k_src_hssm_likelihoods_hddm_wfpt_w[] = "src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"; -/* #### Code section: decls ### */ -static PyObject *__pyx_pf_4wfpt_full_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err); /* proto */ -static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_logp, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_sv, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_z, PyArrayObject *__pyx_v_sz, PyArrayObject *__pyx_v_t, PyArrayObject *__pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_model, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_ssm, PyArrayObject *__pyx_v_params_rl, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ -static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_err, CYTHON_UNUSED int __pyx_v_n_st, CYTHON_UNUSED int __pyx_v_n_sz, CYTHON_UNUSED int __pyx_v_use_adaptive, CYTHON_UNUSED double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, PyObject *__pyx_v_alpha, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_rl_arr, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ -static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_cont_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_t_min, double __pyx_v_t_max, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err); /* proto */ -static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_N, double __pyx_v_time, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier); /* proto */ -static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_data); /* proto */ -static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ -static PyObject *__pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network); /* proto */ -/* #### Code section: late_includes ### */ -/* #### Code section: module_state ### */ -typedef struct { - PyObject *__pyx_d; - PyObject *__pyx_b; - PyObject *__pyx_cython_runtime; - PyObject *__pyx_empty_tuple; - PyObject *__pyx_empty_bytes; - PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_4type_type; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_5numpy_dtype; - PyTypeObject *__pyx_ptype_5numpy_flatiter; - PyTypeObject *__pyx_ptype_5numpy_broadcast; - PyTypeObject *__pyx_ptype_5numpy_ndarray; - PyTypeObject *__pyx_ptype_5numpy_generic; - PyTypeObject *__pyx_ptype_5numpy_number; - PyTypeObject *__pyx_ptype_5numpy_integer; - PyTypeObject *__pyx_ptype_5numpy_signedinteger; - PyTypeObject *__pyx_ptype_5numpy_unsignedinteger; - PyTypeObject *__pyx_ptype_5numpy_inexact; - PyTypeObject *__pyx_ptype_5numpy_floating; - PyTypeObject *__pyx_ptype_5numpy_complexfloating; - PyTypeObject *__pyx_ptype_5numpy_flexible; - PyTypeObject *__pyx_ptype_5numpy_character; - PyTypeObject *__pyx_ptype_5numpy_ufunc; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_n_s_ImportError; - PyObject *__pyx_n_s_N; - PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_n_s__24; - PyObject *__pyx_kp_u__25; - PyObject *__pyx_n_s__41; - PyObject *__pyx_n_s_a; - PyObject *__pyx_n_u_a; - PyObject *__pyx_n_s_alfa; - PyObject *__pyx_n_s_alpha; - PyObject *__pyx_n_u_alpha; - PyObject *__pyx_n_s_arange; - PyObject *__pyx_n_s_array; - PyObject *__pyx_n_s_astype; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_kp_u_at_least_one_of_the_parameters_i; - PyObject *__pyx_n_s_axis; - PyObject *__pyx_n_s_cdf_array; - PyObject *__pyx_n_s_class_getitem; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_concatenate; - PyObject *__pyx_n_s_cont_x; - PyObject *__pyx_n_s_copy; - PyObject *__pyx_n_s_core; - PyObject *__pyx_n_s_cumm_s_size; - PyObject *__pyx_n_s_cumsum; - PyObject *__pyx_n_s_cumtrapz; - PyObject *__pyx_n_s_data; - PyObject *__pyx_n_s_data_copy; - PyObject *__pyx_n_s_diff; - PyObject *__pyx_n_s_double; - PyObject *__pyx_n_s_drift; - PyObject *__pyx_n_s_dtype; - PyObject *__pyx_n_s_empty; - PyObject *__pyx_n_s_err; - PyObject *__pyx_n_s_exp; - PyObject *__pyx_n_s_feedback; - PyObject *__pyx_n_s_feedbacks; - PyObject *__pyx_n_s_float32; - PyObject *__pyx_n_s_full_pdf; - PyObject *__pyx_n_s_gen_cdf_using_pdf; - PyObject *__pyx_n_s_i; - PyObject *__pyx_n_s_i_p; - PyObject *__pyx_n_s_idx; - PyObject *__pyx_n_s_ij; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_inf; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_integrate; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_j; - PyObject *__pyx_n_s_lb; - PyObject *__pyx_n_s_linspace; - PyObject *__pyx_n_s_ll_min; - PyObject *__pyx_n_s_log; - PyObject *__pyx_n_s_log_p; - PyObject *__pyx_n_s_logp; - PyObject *__pyx_n_s_lower_bnd; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_max; - PyObject *__pyx_n_s_maximum; - PyObject *__pyx_n_s_min; - PyObject *__pyx_n_s_model; - PyObject *__pyx_n_s_multi; - PyObject *__pyx_n_s_n_cont; - PyObject *__pyx_n_s_n_params; - PyObject *__pyx_n_s_n_st; - PyObject *__pyx_n_s_n_sz; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_network; - PyObject *__pyx_n_s_np; - PyObject *__pyx_n_s_numpy; - PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; - PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; - PyObject *__pyx_n_s_p; - PyObject *__pyx_n_s_p_outlier; - PyObject *__pyx_n_s_param; - PyObject *__pyx_n_s_params; - PyObject *__pyx_n_s_params_bnds; - PyObject *__pyx_n_s_params_iter; - PyObject *__pyx_n_s_params_rl; - PyObject *__pyx_n_s_params_ssm; - PyObject *__pyx_n_s_pdf_array; - PyObject *__pyx_n_s_pos_alfa; - PyObject *__pyx_n_s_pos_alpha; - PyObject *__pyx_n_s_pos_cont; - PyObject *__pyx_n_s_predict_on_batch; - PyObject *__pyx_n_s_q; - PyObject *__pyx_n_s_qs; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_response; - PyObject *__pyx_n_s_responses; - PyObject *__pyx_n_s_responses_qs; - PyObject *__pyx_n_s_rl_alpha; - PyObject *__pyx_n_s_rl_arr; - PyObject *__pyx_n_s_s; - PyObject *__pyx_n_s_s_size; - PyObject *__pyx_n_s_scipy; - PyObject *__pyx_n_s_scipy_integrate; - PyObject *__pyx_n_s_simps_err; - PyObject *__pyx_n_s_size; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_split_by; - PyObject *__pyx_n_s_split_cdf; - PyObject *__pyx_n_s_squeeze; - PyObject *__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p; - PyObject *__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w; - PyObject *__pyx_n_s_st; - PyObject *__pyx_n_u_st; - PyObject *__pyx_n_s_stack; - PyObject *__pyx_n_s_sum; - PyObject *__pyx_n_s_sum_logp; - PyObject *__pyx_n_s_sv; - PyObject *__pyx_n_u_sv; - PyObject *__pyx_n_s_sz; - PyObject *__pyx_n_u_sz; - PyObject *__pyx_n_s_t; - PyObject *__pyx_n_u_t; - PyObject *__pyx_n_s_t_max; - PyObject *__pyx_n_s_t_min; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_tile; - PyObject *__pyx_n_s_time; - PyObject *__pyx_n_s_tp_scale; - PyObject *__pyx_n_s_ub; - PyObject *__pyx_n_s_umath; - PyObject *__pyx_n_s_unique; - PyObject *__pyx_n_s_upper_bnd; - PyObject *__pyx_n_s_use_adaptive; - PyObject *__pyx_n_s_v; - PyObject *__pyx_n_u_v; - PyObject *__pyx_n_s_w_outlier; - PyObject *__pyx_n_s_wfpt; - PyObject *__pyx_n_s_wiener_like; - PyObject *__pyx_n_s_wiener_like_contaminant; - PyObject *__pyx_n_s_wiener_like_multi; - PyObject *__pyx_n_s_wiener_like_multi_nn_mlp; - PyObject *__pyx_n_s_wiener_like_multi_nn_mlp_pdf; - PyObject *__pyx_n_s_wiener_like_multi_rlddm; - PyObject *__pyx_n_s_wiener_like_rl; - PyObject *__pyx_n_s_wiener_like_rlddm; - PyObject *__pyx_n_s_wiener_like_rlssm_nn; - PyObject *__pyx_n_s_wiener_like_rlssm_nn_reg; - PyObject *__pyx_n_s_wiener_logp_array; - PyObject *__pyx_n_s_wp_outlier; - PyObject *__pyx_n_s_x; - PyObject *__pyx_n_s_x_lb; - PyObject *__pyx_n_s_x_ub; - PyObject *__pyx_n_s_xs; - PyObject *__pyx_n_s_y; - PyObject *__pyx_n_s_z; - PyObject *__pyx_n_u_z; - PyObject *__pyx_n_s_zeros; - PyObject *__pyx_float_1eneg_3; - PyObject *__pyx_float_2_718281828459; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_2; - PyObject *__pyx_int_neg_1; - PyObject *__pyx_tuple_; - PyObject *__pyx_slice__8; - PyObject *__pyx_tuple__2; - PyObject *__pyx_slice__11; - PyObject *__pyx_slice__20; - PyObject *__pyx_tuple__18; - PyObject *__pyx_tuple__23; - PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__27; - PyObject *__pyx_tuple__28; - PyObject *__pyx_tuple__29; - PyObject *__pyx_tuple__30; - PyObject *__pyx_tuple__31; - PyObject *__pyx_tuple__32; - PyObject *__pyx_tuple__33; - PyObject *__pyx_tuple__34; - PyObject *__pyx_tuple__35; - PyObject *__pyx_tuple__36; - PyObject *__pyx_tuple__37; - PyObject *__pyx_tuple__38; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__40; - PyObject *__pyx_codeobj__3; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__5; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__7; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__10; - PyObject *__pyx_codeobj__12; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__14; - PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__17; - PyObject *__pyx_codeobj__19; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__22; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc); - Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); - Py_CLEAR(clear_module_state->__pyx_n_s_N); - Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_n_s__24); - Py_CLEAR(clear_module_state->__pyx_kp_u__25); - Py_CLEAR(clear_module_state->__pyx_n_s__41); - Py_CLEAR(clear_module_state->__pyx_n_s_a); - Py_CLEAR(clear_module_state->__pyx_n_u_a); - Py_CLEAR(clear_module_state->__pyx_n_s_alfa); - Py_CLEAR(clear_module_state->__pyx_n_s_alpha); - Py_CLEAR(clear_module_state->__pyx_n_u_alpha); - Py_CLEAR(clear_module_state->__pyx_n_s_arange); - Py_CLEAR(clear_module_state->__pyx_n_s_array); - Py_CLEAR(clear_module_state->__pyx_n_s_astype); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_kp_u_at_least_one_of_the_parameters_i); - Py_CLEAR(clear_module_state->__pyx_n_s_axis); - Py_CLEAR(clear_module_state->__pyx_n_s_cdf_array); - Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_concatenate); - Py_CLEAR(clear_module_state->__pyx_n_s_cont_x); - Py_CLEAR(clear_module_state->__pyx_n_s_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_core); - Py_CLEAR(clear_module_state->__pyx_n_s_cumm_s_size); - Py_CLEAR(clear_module_state->__pyx_n_s_cumsum); - Py_CLEAR(clear_module_state->__pyx_n_s_cumtrapz); - Py_CLEAR(clear_module_state->__pyx_n_s_data); - Py_CLEAR(clear_module_state->__pyx_n_s_data_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_diff); - Py_CLEAR(clear_module_state->__pyx_n_s_double); - Py_CLEAR(clear_module_state->__pyx_n_s_drift); - Py_CLEAR(clear_module_state->__pyx_n_s_dtype); - Py_CLEAR(clear_module_state->__pyx_n_s_empty); - Py_CLEAR(clear_module_state->__pyx_n_s_err); - Py_CLEAR(clear_module_state->__pyx_n_s_exp); - Py_CLEAR(clear_module_state->__pyx_n_s_feedback); - Py_CLEAR(clear_module_state->__pyx_n_s_feedbacks); - Py_CLEAR(clear_module_state->__pyx_n_s_float32); - Py_CLEAR(clear_module_state->__pyx_n_s_full_pdf); - Py_CLEAR(clear_module_state->__pyx_n_s_gen_cdf_using_pdf); - Py_CLEAR(clear_module_state->__pyx_n_s_i); - Py_CLEAR(clear_module_state->__pyx_n_s_i_p); - Py_CLEAR(clear_module_state->__pyx_n_s_idx); - Py_CLEAR(clear_module_state->__pyx_n_s_ij); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_inf); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_integrate); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_j); - Py_CLEAR(clear_module_state->__pyx_n_s_lb); - Py_CLEAR(clear_module_state->__pyx_n_s_linspace); - Py_CLEAR(clear_module_state->__pyx_n_s_ll_min); - Py_CLEAR(clear_module_state->__pyx_n_s_log); - Py_CLEAR(clear_module_state->__pyx_n_s_log_p); - Py_CLEAR(clear_module_state->__pyx_n_s_logp); - Py_CLEAR(clear_module_state->__pyx_n_s_lower_bnd); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_max); - Py_CLEAR(clear_module_state->__pyx_n_s_maximum); - Py_CLEAR(clear_module_state->__pyx_n_s_min); - Py_CLEAR(clear_module_state->__pyx_n_s_model); - Py_CLEAR(clear_module_state->__pyx_n_s_multi); - Py_CLEAR(clear_module_state->__pyx_n_s_n_cont); - Py_CLEAR(clear_module_state->__pyx_n_s_n_params); - Py_CLEAR(clear_module_state->__pyx_n_s_n_st); - Py_CLEAR(clear_module_state->__pyx_n_s_n_sz); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_network); - Py_CLEAR(clear_module_state->__pyx_n_s_np); - Py_CLEAR(clear_module_state->__pyx_n_s_numpy); - Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); - Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); - Py_CLEAR(clear_module_state->__pyx_n_s_p); - Py_CLEAR(clear_module_state->__pyx_n_s_p_outlier); - Py_CLEAR(clear_module_state->__pyx_n_s_param); - Py_CLEAR(clear_module_state->__pyx_n_s_params); - Py_CLEAR(clear_module_state->__pyx_n_s_params_bnds); - Py_CLEAR(clear_module_state->__pyx_n_s_params_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_params_rl); - Py_CLEAR(clear_module_state->__pyx_n_s_params_ssm); - Py_CLEAR(clear_module_state->__pyx_n_s_pdf_array); - Py_CLEAR(clear_module_state->__pyx_n_s_pos_alfa); - Py_CLEAR(clear_module_state->__pyx_n_s_pos_alpha); - Py_CLEAR(clear_module_state->__pyx_n_s_pos_cont); - Py_CLEAR(clear_module_state->__pyx_n_s_predict_on_batch); - Py_CLEAR(clear_module_state->__pyx_n_s_q); - Py_CLEAR(clear_module_state->__pyx_n_s_qs); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_response); - Py_CLEAR(clear_module_state->__pyx_n_s_responses); - Py_CLEAR(clear_module_state->__pyx_n_s_responses_qs); - Py_CLEAR(clear_module_state->__pyx_n_s_rl_alpha); - Py_CLEAR(clear_module_state->__pyx_n_s_rl_arr); - Py_CLEAR(clear_module_state->__pyx_n_s_s); - Py_CLEAR(clear_module_state->__pyx_n_s_s_size); - Py_CLEAR(clear_module_state->__pyx_n_s_scipy); - Py_CLEAR(clear_module_state->__pyx_n_s_scipy_integrate); - Py_CLEAR(clear_module_state->__pyx_n_s_simps_err); - Py_CLEAR(clear_module_state->__pyx_n_s_size); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_split_by); - Py_CLEAR(clear_module_state->__pyx_n_s_split_cdf); - Py_CLEAR(clear_module_state->__pyx_n_s_squeeze); - Py_CLEAR(clear_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p); - Py_CLEAR(clear_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w); - Py_CLEAR(clear_module_state->__pyx_n_s_st); - Py_CLEAR(clear_module_state->__pyx_n_u_st); - Py_CLEAR(clear_module_state->__pyx_n_s_stack); - Py_CLEAR(clear_module_state->__pyx_n_s_sum); - Py_CLEAR(clear_module_state->__pyx_n_s_sum_logp); - Py_CLEAR(clear_module_state->__pyx_n_s_sv); - Py_CLEAR(clear_module_state->__pyx_n_u_sv); - Py_CLEAR(clear_module_state->__pyx_n_s_sz); - Py_CLEAR(clear_module_state->__pyx_n_u_sz); - Py_CLEAR(clear_module_state->__pyx_n_s_t); - Py_CLEAR(clear_module_state->__pyx_n_u_t); - Py_CLEAR(clear_module_state->__pyx_n_s_t_max); - Py_CLEAR(clear_module_state->__pyx_n_s_t_min); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_tile); - Py_CLEAR(clear_module_state->__pyx_n_s_time); - Py_CLEAR(clear_module_state->__pyx_n_s_tp_scale); - Py_CLEAR(clear_module_state->__pyx_n_s_ub); - Py_CLEAR(clear_module_state->__pyx_n_s_umath); - Py_CLEAR(clear_module_state->__pyx_n_s_unique); - Py_CLEAR(clear_module_state->__pyx_n_s_upper_bnd); - Py_CLEAR(clear_module_state->__pyx_n_s_use_adaptive); - Py_CLEAR(clear_module_state->__pyx_n_s_v); - Py_CLEAR(clear_module_state->__pyx_n_u_v); - Py_CLEAR(clear_module_state->__pyx_n_s_w_outlier); - Py_CLEAR(clear_module_state->__pyx_n_s_wfpt); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_contaminant); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_multi); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_multi_nn_mlp); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_multi_nn_mlp_pdf); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_multi_rlddm); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_rl); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_rlddm); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_rlssm_nn); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_like_rlssm_nn_reg); - Py_CLEAR(clear_module_state->__pyx_n_s_wiener_logp_array); - Py_CLEAR(clear_module_state->__pyx_n_s_wp_outlier); - Py_CLEAR(clear_module_state->__pyx_n_s_x); - Py_CLEAR(clear_module_state->__pyx_n_s_x_lb); - Py_CLEAR(clear_module_state->__pyx_n_s_x_ub); - Py_CLEAR(clear_module_state->__pyx_n_s_xs); - Py_CLEAR(clear_module_state->__pyx_n_s_y); - Py_CLEAR(clear_module_state->__pyx_n_s_z); - Py_CLEAR(clear_module_state->__pyx_n_u_z); - Py_CLEAR(clear_module_state->__pyx_n_s_zeros); - Py_CLEAR(clear_module_state->__pyx_float_1eneg_3); - Py_CLEAR(clear_module_state->__pyx_float_2_718281828459); - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_int_2); - Py_CLEAR(clear_module_state->__pyx_int_neg_1); - Py_CLEAR(clear_module_state->__pyx_tuple_); - Py_CLEAR(clear_module_state->__pyx_slice__8); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_slice__11); - Py_CLEAR(clear_module_state->__pyx_slice__20); - Py_CLEAR(clear_module_state->__pyx_tuple__18); - Py_CLEAR(clear_module_state->__pyx_tuple__23); - Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__27); - Py_CLEAR(clear_module_state->__pyx_tuple__28); - Py_CLEAR(clear_module_state->__pyx_tuple__29); - Py_CLEAR(clear_module_state->__pyx_tuple__30); - Py_CLEAR(clear_module_state->__pyx_tuple__31); - Py_CLEAR(clear_module_state->__pyx_tuple__32); - Py_CLEAR(clear_module_state->__pyx_tuple__33); - Py_CLEAR(clear_module_state->__pyx_tuple__34); - Py_CLEAR(clear_module_state->__pyx_tuple__35); - Py_CLEAR(clear_module_state->__pyx_tuple__36); - Py_CLEAR(clear_module_state->__pyx_tuple__37); - Py_CLEAR(clear_module_state->__pyx_tuple__38); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__40); - Py_CLEAR(clear_module_state->__pyx_codeobj__3); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__5); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__7); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__10); - Py_CLEAR(clear_module_state->__pyx_codeobj__12); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__17); - Py_CLEAR(clear_module_state->__pyx_codeobj__19); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__22); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif - Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc); - Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); - Py_VISIT(traverse_module_state->__pyx_n_s_N); - Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_n_s__24); - Py_VISIT(traverse_module_state->__pyx_kp_u__25); - Py_VISIT(traverse_module_state->__pyx_n_s__41); - Py_VISIT(traverse_module_state->__pyx_n_s_a); - Py_VISIT(traverse_module_state->__pyx_n_u_a); - Py_VISIT(traverse_module_state->__pyx_n_s_alfa); - Py_VISIT(traverse_module_state->__pyx_n_s_alpha); - Py_VISIT(traverse_module_state->__pyx_n_u_alpha); - Py_VISIT(traverse_module_state->__pyx_n_s_arange); - Py_VISIT(traverse_module_state->__pyx_n_s_array); - Py_VISIT(traverse_module_state->__pyx_n_s_astype); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_kp_u_at_least_one_of_the_parameters_i); - Py_VISIT(traverse_module_state->__pyx_n_s_axis); - Py_VISIT(traverse_module_state->__pyx_n_s_cdf_array); - Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_concatenate); - Py_VISIT(traverse_module_state->__pyx_n_s_cont_x); - Py_VISIT(traverse_module_state->__pyx_n_s_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_core); - Py_VISIT(traverse_module_state->__pyx_n_s_cumm_s_size); - Py_VISIT(traverse_module_state->__pyx_n_s_cumsum); - Py_VISIT(traverse_module_state->__pyx_n_s_cumtrapz); - Py_VISIT(traverse_module_state->__pyx_n_s_data); - Py_VISIT(traverse_module_state->__pyx_n_s_data_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_diff); - Py_VISIT(traverse_module_state->__pyx_n_s_double); - Py_VISIT(traverse_module_state->__pyx_n_s_drift); - Py_VISIT(traverse_module_state->__pyx_n_s_dtype); - Py_VISIT(traverse_module_state->__pyx_n_s_empty); - Py_VISIT(traverse_module_state->__pyx_n_s_err); - Py_VISIT(traverse_module_state->__pyx_n_s_exp); - Py_VISIT(traverse_module_state->__pyx_n_s_feedback); - Py_VISIT(traverse_module_state->__pyx_n_s_feedbacks); - Py_VISIT(traverse_module_state->__pyx_n_s_float32); - Py_VISIT(traverse_module_state->__pyx_n_s_full_pdf); - Py_VISIT(traverse_module_state->__pyx_n_s_gen_cdf_using_pdf); - Py_VISIT(traverse_module_state->__pyx_n_s_i); - Py_VISIT(traverse_module_state->__pyx_n_s_i_p); - Py_VISIT(traverse_module_state->__pyx_n_s_idx); - Py_VISIT(traverse_module_state->__pyx_n_s_ij); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_inf); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_integrate); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_j); - Py_VISIT(traverse_module_state->__pyx_n_s_lb); - Py_VISIT(traverse_module_state->__pyx_n_s_linspace); - Py_VISIT(traverse_module_state->__pyx_n_s_ll_min); - Py_VISIT(traverse_module_state->__pyx_n_s_log); - Py_VISIT(traverse_module_state->__pyx_n_s_log_p); - Py_VISIT(traverse_module_state->__pyx_n_s_logp); - Py_VISIT(traverse_module_state->__pyx_n_s_lower_bnd); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_max); - Py_VISIT(traverse_module_state->__pyx_n_s_maximum); - Py_VISIT(traverse_module_state->__pyx_n_s_min); - Py_VISIT(traverse_module_state->__pyx_n_s_model); - Py_VISIT(traverse_module_state->__pyx_n_s_multi); - Py_VISIT(traverse_module_state->__pyx_n_s_n_cont); - Py_VISIT(traverse_module_state->__pyx_n_s_n_params); - Py_VISIT(traverse_module_state->__pyx_n_s_n_st); - Py_VISIT(traverse_module_state->__pyx_n_s_n_sz); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_network); - Py_VISIT(traverse_module_state->__pyx_n_s_np); - Py_VISIT(traverse_module_state->__pyx_n_s_numpy); - Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); - Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); - Py_VISIT(traverse_module_state->__pyx_n_s_p); - Py_VISIT(traverse_module_state->__pyx_n_s_p_outlier); - Py_VISIT(traverse_module_state->__pyx_n_s_param); - Py_VISIT(traverse_module_state->__pyx_n_s_params); - Py_VISIT(traverse_module_state->__pyx_n_s_params_bnds); - Py_VISIT(traverse_module_state->__pyx_n_s_params_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_params_rl); - Py_VISIT(traverse_module_state->__pyx_n_s_params_ssm); - Py_VISIT(traverse_module_state->__pyx_n_s_pdf_array); - Py_VISIT(traverse_module_state->__pyx_n_s_pos_alfa); - Py_VISIT(traverse_module_state->__pyx_n_s_pos_alpha); - Py_VISIT(traverse_module_state->__pyx_n_s_pos_cont); - Py_VISIT(traverse_module_state->__pyx_n_s_predict_on_batch); - Py_VISIT(traverse_module_state->__pyx_n_s_q); - Py_VISIT(traverse_module_state->__pyx_n_s_qs); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_response); - Py_VISIT(traverse_module_state->__pyx_n_s_responses); - Py_VISIT(traverse_module_state->__pyx_n_s_responses_qs); - Py_VISIT(traverse_module_state->__pyx_n_s_rl_alpha); - Py_VISIT(traverse_module_state->__pyx_n_s_rl_arr); - Py_VISIT(traverse_module_state->__pyx_n_s_s); - Py_VISIT(traverse_module_state->__pyx_n_s_s_size); - Py_VISIT(traverse_module_state->__pyx_n_s_scipy); - Py_VISIT(traverse_module_state->__pyx_n_s_scipy_integrate); - Py_VISIT(traverse_module_state->__pyx_n_s_simps_err); - Py_VISIT(traverse_module_state->__pyx_n_s_size); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_split_by); - Py_VISIT(traverse_module_state->__pyx_n_s_split_cdf); - Py_VISIT(traverse_module_state->__pyx_n_s_squeeze); - Py_VISIT(traverse_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p); - Py_VISIT(traverse_module_state->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w); - Py_VISIT(traverse_module_state->__pyx_n_s_st); - Py_VISIT(traverse_module_state->__pyx_n_u_st); - Py_VISIT(traverse_module_state->__pyx_n_s_stack); - Py_VISIT(traverse_module_state->__pyx_n_s_sum); - Py_VISIT(traverse_module_state->__pyx_n_s_sum_logp); - Py_VISIT(traverse_module_state->__pyx_n_s_sv); - Py_VISIT(traverse_module_state->__pyx_n_u_sv); - Py_VISIT(traverse_module_state->__pyx_n_s_sz); - Py_VISIT(traverse_module_state->__pyx_n_u_sz); - Py_VISIT(traverse_module_state->__pyx_n_s_t); - Py_VISIT(traverse_module_state->__pyx_n_u_t); - Py_VISIT(traverse_module_state->__pyx_n_s_t_max); - Py_VISIT(traverse_module_state->__pyx_n_s_t_min); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_tile); - Py_VISIT(traverse_module_state->__pyx_n_s_time); - Py_VISIT(traverse_module_state->__pyx_n_s_tp_scale); - Py_VISIT(traverse_module_state->__pyx_n_s_ub); - Py_VISIT(traverse_module_state->__pyx_n_s_umath); - Py_VISIT(traverse_module_state->__pyx_n_s_unique); - Py_VISIT(traverse_module_state->__pyx_n_s_upper_bnd); - Py_VISIT(traverse_module_state->__pyx_n_s_use_adaptive); - Py_VISIT(traverse_module_state->__pyx_n_s_v); - Py_VISIT(traverse_module_state->__pyx_n_u_v); - Py_VISIT(traverse_module_state->__pyx_n_s_w_outlier); - Py_VISIT(traverse_module_state->__pyx_n_s_wfpt); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_contaminant); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_multi); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_multi_nn_mlp); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_multi_nn_mlp_pdf); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_multi_rlddm); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_rl); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_rlddm); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_rlssm_nn); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_like_rlssm_nn_reg); - Py_VISIT(traverse_module_state->__pyx_n_s_wiener_logp_array); - Py_VISIT(traverse_module_state->__pyx_n_s_wp_outlier); - Py_VISIT(traverse_module_state->__pyx_n_s_x); - Py_VISIT(traverse_module_state->__pyx_n_s_x_lb); - Py_VISIT(traverse_module_state->__pyx_n_s_x_ub); - Py_VISIT(traverse_module_state->__pyx_n_s_xs); - Py_VISIT(traverse_module_state->__pyx_n_s_y); - Py_VISIT(traverse_module_state->__pyx_n_s_z); - Py_VISIT(traverse_module_state->__pyx_n_u_z); - Py_VISIT(traverse_module_state->__pyx_n_s_zeros); - Py_VISIT(traverse_module_state->__pyx_float_1eneg_3); - Py_VISIT(traverse_module_state->__pyx_float_2_718281828459); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_2); - Py_VISIT(traverse_module_state->__pyx_int_neg_1); - Py_VISIT(traverse_module_state->__pyx_tuple_); - Py_VISIT(traverse_module_state->__pyx_slice__8); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_slice__11); - Py_VISIT(traverse_module_state->__pyx_slice__20); - Py_VISIT(traverse_module_state->__pyx_tuple__18); - Py_VISIT(traverse_module_state->__pyx_tuple__23); - Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__27); - Py_VISIT(traverse_module_state->__pyx_tuple__28); - Py_VISIT(traverse_module_state->__pyx_tuple__29); - Py_VISIT(traverse_module_state->__pyx_tuple__30); - Py_VISIT(traverse_module_state->__pyx_tuple__31); - Py_VISIT(traverse_module_state->__pyx_tuple__32); - Py_VISIT(traverse_module_state->__pyx_tuple__33); - Py_VISIT(traverse_module_state->__pyx_tuple__34); - Py_VISIT(traverse_module_state->__pyx_tuple__35); - Py_VISIT(traverse_module_state->__pyx_tuple__36); - Py_VISIT(traverse_module_state->__pyx_tuple__37); - Py_VISIT(traverse_module_state->__pyx_tuple__38); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__40); - Py_VISIT(traverse_module_state->__pyx_codeobj__3); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__5); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__7); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__10); - Py_VISIT(traverse_module_state->__pyx_codeobj__12); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__17); - Py_VISIT(traverse_module_state->__pyx_codeobj__19); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__22); - return 0; -} -#endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype -#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter -#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast -#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray -#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic -#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number -#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer -#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger -#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger -#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact -#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating -#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating -#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible -#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character -#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError -#define __pyx_n_s_N __pyx_mstate_global->__pyx_n_s_N -#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_n_s__24 __pyx_mstate_global->__pyx_n_s__24 -#define __pyx_kp_u__25 __pyx_mstate_global->__pyx_kp_u__25 -#define __pyx_n_s__41 __pyx_mstate_global->__pyx_n_s__41 -#define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a -#define __pyx_n_u_a __pyx_mstate_global->__pyx_n_u_a -#define __pyx_n_s_alfa __pyx_mstate_global->__pyx_n_s_alfa -#define __pyx_n_s_alpha __pyx_mstate_global->__pyx_n_s_alpha -#define __pyx_n_u_alpha __pyx_mstate_global->__pyx_n_u_alpha -#define __pyx_n_s_arange __pyx_mstate_global->__pyx_n_s_arange -#define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array -#define __pyx_n_s_astype __pyx_mstate_global->__pyx_n_s_astype -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_kp_u_at_least_one_of_the_parameters_i __pyx_mstate_global->__pyx_kp_u_at_least_one_of_the_parameters_i -#define __pyx_n_s_axis __pyx_mstate_global->__pyx_n_s_axis -#define __pyx_n_s_cdf_array __pyx_mstate_global->__pyx_n_s_cdf_array -#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_concatenate __pyx_mstate_global->__pyx_n_s_concatenate -#define __pyx_n_s_cont_x __pyx_mstate_global->__pyx_n_s_cont_x -#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy -#define __pyx_n_s_core __pyx_mstate_global->__pyx_n_s_core -#define __pyx_n_s_cumm_s_size __pyx_mstate_global->__pyx_n_s_cumm_s_size -#define __pyx_n_s_cumsum __pyx_mstate_global->__pyx_n_s_cumsum -#define __pyx_n_s_cumtrapz __pyx_mstate_global->__pyx_n_s_cumtrapz -#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data -#define __pyx_n_s_data_copy __pyx_mstate_global->__pyx_n_s_data_copy -#define __pyx_n_s_diff __pyx_mstate_global->__pyx_n_s_diff -#define __pyx_n_s_double __pyx_mstate_global->__pyx_n_s_double -#define __pyx_n_s_drift __pyx_mstate_global->__pyx_n_s_drift -#define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype -#define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty -#define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err -#define __pyx_n_s_exp __pyx_mstate_global->__pyx_n_s_exp -#define __pyx_n_s_feedback __pyx_mstate_global->__pyx_n_s_feedback -#define __pyx_n_s_feedbacks __pyx_mstate_global->__pyx_n_s_feedbacks -#define __pyx_n_s_float32 __pyx_mstate_global->__pyx_n_s_float32 -#define __pyx_n_s_full_pdf __pyx_mstate_global->__pyx_n_s_full_pdf -#define __pyx_n_s_gen_cdf_using_pdf __pyx_mstate_global->__pyx_n_s_gen_cdf_using_pdf -#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i -#define __pyx_n_s_i_p __pyx_mstate_global->__pyx_n_s_i_p -#define __pyx_n_s_idx __pyx_mstate_global->__pyx_n_s_idx -#define __pyx_n_s_ij __pyx_mstate_global->__pyx_n_s_ij -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_inf __pyx_mstate_global->__pyx_n_s_inf -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_integrate __pyx_mstate_global->__pyx_n_s_integrate -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j -#define __pyx_n_s_lb __pyx_mstate_global->__pyx_n_s_lb -#define __pyx_n_s_linspace __pyx_mstate_global->__pyx_n_s_linspace -#define __pyx_n_s_ll_min __pyx_mstate_global->__pyx_n_s_ll_min -#define __pyx_n_s_log __pyx_mstate_global->__pyx_n_s_log -#define __pyx_n_s_log_p __pyx_mstate_global->__pyx_n_s_log_p -#define __pyx_n_s_logp __pyx_mstate_global->__pyx_n_s_logp -#define __pyx_n_s_lower_bnd __pyx_mstate_global->__pyx_n_s_lower_bnd -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max -#define __pyx_n_s_maximum __pyx_mstate_global->__pyx_n_s_maximum -#define __pyx_n_s_min __pyx_mstate_global->__pyx_n_s_min -#define __pyx_n_s_model __pyx_mstate_global->__pyx_n_s_model -#define __pyx_n_s_multi __pyx_mstate_global->__pyx_n_s_multi -#define __pyx_n_s_n_cont __pyx_mstate_global->__pyx_n_s_n_cont -#define __pyx_n_s_n_params __pyx_mstate_global->__pyx_n_s_n_params -#define __pyx_n_s_n_st __pyx_mstate_global->__pyx_n_s_n_st -#define __pyx_n_s_n_sz __pyx_mstate_global->__pyx_n_s_n_sz -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_network __pyx_mstate_global->__pyx_n_s_network -#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np -#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy -#define __pyx_kp_u_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy_core_multiarray_failed_to -#define __pyx_kp_u_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_u_numpy_core_umath_failed_to_impor -#define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p -#define __pyx_n_s_p_outlier __pyx_mstate_global->__pyx_n_s_p_outlier -#define __pyx_n_s_param __pyx_mstate_global->__pyx_n_s_param -#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params -#define __pyx_n_s_params_bnds __pyx_mstate_global->__pyx_n_s_params_bnds -#define __pyx_n_s_params_iter __pyx_mstate_global->__pyx_n_s_params_iter -#define __pyx_n_s_params_rl __pyx_mstate_global->__pyx_n_s_params_rl -#define __pyx_n_s_params_ssm __pyx_mstate_global->__pyx_n_s_params_ssm -#define __pyx_n_s_pdf_array __pyx_mstate_global->__pyx_n_s_pdf_array -#define __pyx_n_s_pos_alfa __pyx_mstate_global->__pyx_n_s_pos_alfa -#define __pyx_n_s_pos_alpha __pyx_mstate_global->__pyx_n_s_pos_alpha -#define __pyx_n_s_pos_cont __pyx_mstate_global->__pyx_n_s_pos_cont -#define __pyx_n_s_predict_on_batch __pyx_mstate_global->__pyx_n_s_predict_on_batch -#define __pyx_n_s_q __pyx_mstate_global->__pyx_n_s_q -#define __pyx_n_s_qs __pyx_mstate_global->__pyx_n_s_qs -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_response __pyx_mstate_global->__pyx_n_s_response -#define __pyx_n_s_responses __pyx_mstate_global->__pyx_n_s_responses -#define __pyx_n_s_responses_qs __pyx_mstate_global->__pyx_n_s_responses_qs -#define __pyx_n_s_rl_alpha __pyx_mstate_global->__pyx_n_s_rl_alpha -#define __pyx_n_s_rl_arr __pyx_mstate_global->__pyx_n_s_rl_arr -#define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s -#define __pyx_n_s_s_size __pyx_mstate_global->__pyx_n_s_s_size -#define __pyx_n_s_scipy __pyx_mstate_global->__pyx_n_s_scipy -#define __pyx_n_s_scipy_integrate __pyx_mstate_global->__pyx_n_s_scipy_integrate -#define __pyx_n_s_simps_err __pyx_mstate_global->__pyx_n_s_simps_err -#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_split_by __pyx_mstate_global->__pyx_n_s_split_by -#define __pyx_n_s_split_cdf __pyx_mstate_global->__pyx_n_s_split_cdf -#define __pyx_n_s_squeeze __pyx_mstate_global->__pyx_n_s_squeeze -#define __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p __pyx_mstate_global->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p -#define __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w __pyx_mstate_global->__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w -#define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st -#define __pyx_n_u_st __pyx_mstate_global->__pyx_n_u_st -#define __pyx_n_s_stack __pyx_mstate_global->__pyx_n_s_stack -#define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum -#define __pyx_n_s_sum_logp __pyx_mstate_global->__pyx_n_s_sum_logp -#define __pyx_n_s_sv __pyx_mstate_global->__pyx_n_s_sv -#define __pyx_n_u_sv __pyx_mstate_global->__pyx_n_u_sv -#define __pyx_n_s_sz __pyx_mstate_global->__pyx_n_s_sz -#define __pyx_n_u_sz __pyx_mstate_global->__pyx_n_u_sz -#define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t -#define __pyx_n_u_t __pyx_mstate_global->__pyx_n_u_t -#define __pyx_n_s_t_max __pyx_mstate_global->__pyx_n_s_t_max -#define __pyx_n_s_t_min __pyx_mstate_global->__pyx_n_s_t_min -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_tile __pyx_mstate_global->__pyx_n_s_tile -#define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time -#define __pyx_n_s_tp_scale __pyx_mstate_global->__pyx_n_s_tp_scale -#define __pyx_n_s_ub __pyx_mstate_global->__pyx_n_s_ub -#define __pyx_n_s_umath __pyx_mstate_global->__pyx_n_s_umath -#define __pyx_n_s_unique __pyx_mstate_global->__pyx_n_s_unique -#define __pyx_n_s_upper_bnd __pyx_mstate_global->__pyx_n_s_upper_bnd -#define __pyx_n_s_use_adaptive __pyx_mstate_global->__pyx_n_s_use_adaptive -#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v -#define __pyx_n_u_v __pyx_mstate_global->__pyx_n_u_v -#define __pyx_n_s_w_outlier __pyx_mstate_global->__pyx_n_s_w_outlier -#define __pyx_n_s_wfpt __pyx_mstate_global->__pyx_n_s_wfpt -#define __pyx_n_s_wiener_like __pyx_mstate_global->__pyx_n_s_wiener_like -#define __pyx_n_s_wiener_like_contaminant __pyx_mstate_global->__pyx_n_s_wiener_like_contaminant -#define __pyx_n_s_wiener_like_multi __pyx_mstate_global->__pyx_n_s_wiener_like_multi -#define __pyx_n_s_wiener_like_multi_nn_mlp __pyx_mstate_global->__pyx_n_s_wiener_like_multi_nn_mlp -#define __pyx_n_s_wiener_like_multi_nn_mlp_pdf __pyx_mstate_global->__pyx_n_s_wiener_like_multi_nn_mlp_pdf -#define __pyx_n_s_wiener_like_multi_rlddm __pyx_mstate_global->__pyx_n_s_wiener_like_multi_rlddm -#define __pyx_n_s_wiener_like_rl __pyx_mstate_global->__pyx_n_s_wiener_like_rl -#define __pyx_n_s_wiener_like_rlddm __pyx_mstate_global->__pyx_n_s_wiener_like_rlddm -#define __pyx_n_s_wiener_like_rlssm_nn __pyx_mstate_global->__pyx_n_s_wiener_like_rlssm_nn -#define __pyx_n_s_wiener_like_rlssm_nn_reg __pyx_mstate_global->__pyx_n_s_wiener_like_rlssm_nn_reg -#define __pyx_n_s_wiener_logp_array __pyx_mstate_global->__pyx_n_s_wiener_logp_array -#define __pyx_n_s_wp_outlier __pyx_mstate_global->__pyx_n_s_wp_outlier -#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x -#define __pyx_n_s_x_lb __pyx_mstate_global->__pyx_n_s_x_lb -#define __pyx_n_s_x_ub __pyx_mstate_global->__pyx_n_s_x_ub -#define __pyx_n_s_xs __pyx_mstate_global->__pyx_n_s_xs -#define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y -#define __pyx_n_s_z __pyx_mstate_global->__pyx_n_s_z -#define __pyx_n_u_z __pyx_mstate_global->__pyx_n_u_z -#define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros -#define __pyx_float_1eneg_3 __pyx_mstate_global->__pyx_float_1eneg_3 -#define __pyx_float_2_718281828459 __pyx_mstate_global->__pyx_float_2_718281828459 -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 -#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 -#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ -#define __pyx_slice__8 __pyx_mstate_global->__pyx_slice__8 -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_slice__11 __pyx_mstate_global->__pyx_slice__11 -#define __pyx_slice__20 __pyx_mstate_global->__pyx_slice__20 -#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 -#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 -#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 -#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 -#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 -#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 -#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 -#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 -#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 -#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 -#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 -#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 -#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 -#define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 -#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 -#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 -#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 -/* #### Code section: module_code ### */ - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * - * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { - PyObject *__pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("base", __pyx_f[1], 245, 1, __PYX_ERR(1, 245, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248 - * """Returns a borrowed reference to the object owning the data/memory. - * """ - * return PyArray_BASE(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(248,1,__PYX_ERR(1, 248, __pyx_L1_error)) - __pyx_r = PyArray_BASE(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * - * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.base.base", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * - * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ - */ - -static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) { - PyArray_Descr *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyArray_Descr *__pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("descr", 0); - __Pyx_TraceCall("descr", __pyx_f[1], 251, 0, __PYX_ERR(1, 251, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254 - * """Returns an owned reference to the dtype of the array. - * """ - * return PyArray_DESCR(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error)) - __Pyx_XDECREF((PyObject *)__pyx_r); - __pyx_t_1 = PyArray_DESCR(__pyx_v_self); - __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1)); - __pyx_r = ((PyArray_Descr *)__pyx_t_1); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * - * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.ndarray.descr.descr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * - * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ - */ - -static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { - int __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("ndim", __pyx_f[1], 257, 1, __PYX_ERR(1, 257, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260 - * """Returns the number of dimensions in the array. - * """ - * return PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(260,1,__PYX_ERR(1, 260, __pyx_L1_error)) - __pyx_r = PyArray_NDIM(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * - * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.ndim.ndim", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * - * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { - npy_intp *__pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("shape", __pyx_f[1], 263, 1, __PYX_ERR(1, 263, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268 - * Can return NULL for 0-dimensional arrays. - * """ - * return PyArray_DIMS(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(268,1,__PYX_ERR(1, 268, __pyx_L1_error)) - __pyx_r = PyArray_DIMS(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * - * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.shape.shape", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * - * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { - npy_intp *__pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("strides", __pyx_f[1], 271, 1, __PYX_ERR(1, 271, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275 - * The number of elements matches the number of dimensions of the array (ndim). - * """ - * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(275,1,__PYX_ERR(1, 275, __pyx_L1_error)) - __pyx_r = PyArray_STRIDES(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * - * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.strides.strides", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * - * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ - */ - -static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { - npy_intp __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("size", __pyx_f[1], 278, 1, __PYX_ERR(1, 278, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281 - * """Returns the total size (in number of elements) of the array. - * """ - * return PyArray_SIZE(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_TraceLine(281,1,__PYX_ERR(1, 281, __pyx_L1_error)) - __pyx_r = PyArray_SIZE(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * - * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.size.size", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * - * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { - char *__pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("data", __pyx_f[1], 284, 1, __PYX_ERR(1, 284, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290 - * of `PyArray_DATA()` instead, which returns a 'void*'. - * """ - * return PyArray_BYTES(self) # <<<<<<<<<<<<<< - * - * ctypedef unsigned char npy_bool - */ - __Pyx_TraceLine(290,1,__PYX_ERR(1, 290, __pyx_L1_error)) - __pyx_r = PyArray_BYTES(__pyx_v_self); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * - * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.ndarray.data.data", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[1], 773, 0, __PYX_ERR(1, 773, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[1], 776, 0, __PYX_ERR(1, 776, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - */ - __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[1], 779, 0, __PYX_ERR(1, 779, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - */ - __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __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(1, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -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) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[1], 782, 0, __PYX_ERR(1, 782, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - */ - __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __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(1, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -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) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[1], 785, 0, __PYX_ERR(1, 785, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline tuple PyDataType_SHAPE(dtype d): - */ - __Pyx_TraceLine(786,0,__PYX_ERR(1, 786, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __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(1, 786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[1], 788, 0, __PYX_ERR(1, 788, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 - * - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< - * return d.subarray.shape - * else: - */ - __Pyx_TraceLine(789,0,__PYX_ERR(1, 789, __pyx_L1_error)) - __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); - if (__pyx_t_1) { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape # <<<<<<<<<<<<<< - * else: - * return () - */ - __Pyx_TraceLine(790,0,__PYX_ERR(1, 790, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); - __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 - * - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< - * return d.subarray.shape - * else: - */ - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 - * return d.subarray.shape - * else: - * return () # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(792,0,__PYX_ERR(1, 792, __pyx_L1_error)) - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_empty_tuple); - __pyx_r = __pyx_empty_tuple; - goto __pyx_L0; - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 - * int _import_umath() except -1 - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_array_base", 0); - __Pyx_TraceCall("set_array_base", __pyx_f[1], 967, 0, __PYX_ERR(1, 967, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968 - * - * cdef inline void set_array_base(ndarray arr, object base): - * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< - * PyArray_SetBaseObject(arr, base) - * - */ - __Pyx_TraceLine(968,0,__PYX_ERR(1, 968, __pyx_L1_error)) - Py_INCREF(__pyx_v_base); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969 - * cdef inline void set_array_base(ndarray arr, object base): - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __Pyx_TraceLine(969,0,__PYX_ERR(1, 969, __pyx_L1_error)) - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 - * int _import_umath() except -1 - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 - * PyArray_SetBaseObject(arr, base) - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * base = PyArray_BASE(arr) - * if base is NULL: - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_v_base; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_array_base", 0); - __Pyx_TraceCall("get_array_base", __pyx_f[1], 971, 0, __PYX_ERR(1, 971, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972 - * - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< - * if base is NULL: - * return None - */ - __Pyx_TraceLine(972,0,__PYX_ERR(1, 972, __pyx_L1_error)) - __pyx_v_base = PyArray_BASE(__pyx_v_arr); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) - * if base is NULL: # <<<<<<<<<<<<<< - * return None - * return base - */ - __Pyx_TraceLine(973,0,__PYX_ERR(1, 973, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_base == NULL); - if (__pyx_t_1) { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 - * base = PyArray_BASE(arr) - * if base is NULL: - * return None # <<<<<<<<<<<<<< - * return base - * - */ - __Pyx_TraceLine(974,0,__PYX_ERR(1, 974, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) - * if base is NULL: # <<<<<<<<<<<<<< - * return None - * return base - */ - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 - * if base is NULL: - * return None - * return base # <<<<<<<<<<<<<< - * - * # Versions of the import_* functions which are more suitable for - */ - __Pyx_TraceLine(975,0,__PYX_ERR(1, 975, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_base)); - __pyx_r = ((PyObject *)__pyx_v_base); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 - * PyArray_SetBaseObject(arr, base) - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * base = PyArray_BASE(arr) - * if base is NULL: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * __pyx_import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_array", 0); - __Pyx_TraceCall("import_array", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - __Pyx_TraceLine(980,0,__PYX_ERR(1, 980, __pyx_L1_error)) - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 - * cdef inline int import_array() except -1: - * try: - * __pyx_import_array() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") - */ - __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L3_error)) - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982 - * try: - * __pyx_import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * - */ - __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L5_except_error)) - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 982, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 - * __pyx_import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L5_except_error)) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 983, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 983, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * __pyx_import_array() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_umath", 0); - __Pyx_TraceCall("import_umath", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_TraceLine(986,0,__PYX_ERR(1, 986, __pyx_L1_error)) - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 - * cdef inline int import_umath() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L3_error)) - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L5_except_error)) - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L5_except_error)) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_ufunc", 0); - __Pyx_TraceCall("import_ufunc", __pyx_f[1], 991, 0, __PYX_ERR(1, 991, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __Pyx_TraceLine(992,0,__PYX_ERR(1, 992, __pyx_L1_error)) - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 - * cdef inline int import_ufunc() except -1: - * try: - * _import_umath() # <<<<<<<<<<<<<< - * except Exception: - * raise ImportError("numpy.core.umath failed to import") - */ - __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L3_error)) - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __Pyx_TraceLine(994,0,__PYX_ERR(1, 994, __pyx_L5_except_error)) - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L5_except_error)) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.timedelta64)` - */ - -static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - __Pyx_TraceCall("is_timedelta64_object", __pyx_f[1], 998, 0, __PYX_ERR(1, 998, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 - * bool - * """ - * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error)) - __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.timedelta64)` - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.datetime64)` - */ - -static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_datetime64_object", 0); - __Pyx_TraceCall("is_datetime64_object", __pyx_f[1], 1013, 0, __PYX_ERR(1, 1013, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 - * bool - * """ - * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error)) - __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.datetime64)` - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy datetime64 object - */ - -static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { - npy_datetime __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("get_datetime64_value", __pyx_f[1], 1028, 1, __PYX_ERR(1, 1028, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 - * also needed. That can be found using `get_datetime64_unit`. - * """ - * return (obj).obval # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(1035,1,__PYX_ERR(1, 1035, __pyx_L1_error)) - __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy datetime64 object - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy timedelta64 object - */ - -static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { - npy_timedelta __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("get_timedelta64_value", __pyx_f[1], 1038, 1, __PYX_ERR(1, 1038, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1042 - * returns the int64 value underlying scalar numpy timedelta64 object - * """ - * return (obj).obval # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(1042,1,__PYX_ERR(1, 1042, __pyx_L1_error)) - __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy timedelta64 object - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the unit part of the dtype for a numpy datetime64 object. - */ - -static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { - NPY_DATETIMEUNIT __pyx_r; - __Pyx_TraceDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("get_datetime64_unit", __pyx_f[1], 1045, 1, __PYX_ERR(1, 1045, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1049 - * returns the unit part of the dtype for a numpy datetime64 object. - * """ - * return (obj).obmeta.base # <<<<<<<<<<<<<< - */ - __Pyx_TraceLine(1049,1,__PYX_ERR(1, 1049, __pyx_L1_error)) - __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); - goto __pyx_L0; - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the unit part of the dtype for a numpy datetime64 object. - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = (NPY_DATETIMEUNIT) 0; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 - * T max[T](T a, T b) - * - * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< - * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method - * and implementation of Navarro & Fuss, 2009. - */ - -static double __pyx_f_4wfpt_ftt_01w(double __pyx_v_tt, double __pyx_v_w, double __pyx_v_err) { - double __pyx_v_kl; - double __pyx_v_ks; - double __pyx_v_p; - int __pyx_v_k; - int __pyx_v_K; - int __pyx_v_lower; - int __pyx_v_upper; - double __pyx_r; - __Pyx_TraceDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("ftt_01w", __pyx_f[2], 28, 1, __PYX_ERR(2, 28, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":36 - * - * # calculate number of terms needed for large t - * if M_PI*tt*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< - * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound - * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met - */ - __Pyx_TraceLine(36,1,__PYX_ERR(2, 36, __pyx_L1_error)) - __pyx_t_1 = (((M_PI * __pyx_v_tt) * __pyx_v_err) < 1.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":37 - * # calculate number of terms needed for large t - * if M_PI*tt*err<1: # if error threshold is set low enough - * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound # <<<<<<<<<<<<<< - * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met - * else: # if error threshold set too high - */ - __Pyx_TraceLine(37,1,__PYX_ERR(2, 37, __pyx_L1_error)) - __pyx_v_kl = sqrt(((-2.0 * log(((M_PI * __pyx_v_tt) * __pyx_v_err))) / (pow(M_PI, 2.0) * __pyx_v_tt))); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":38 - * if M_PI*tt*err<1: # if error threshold is set low enough - * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound - * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met # <<<<<<<<<<<<<< - * else: # if error threshold set too high - * kl=1./(M_PI*sqrt(tt)) # set to boundary condition - */ - __Pyx_TraceLine(38,1,__PYX_ERR(2, 38, __pyx_L1_error)) - __pyx_v_kl = std::max(__pyx_v_kl, (1. / (M_PI * sqrt(__pyx_v_tt)))); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":36 - * - * # calculate number of terms needed for large t - * if M_PI*tt*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< - * kl=sqrt(-2*log(M_PI*tt*err)/(M_PI**2*tt)) # bound - * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met - */ - goto __pyx_L3; - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":40 - * kl=max(kl,1./(M_PI*sqrt(tt))) # ensure boundary conditions met - * else: # if error threshold set too high - * kl=1./(M_PI*sqrt(tt)) # set to boundary condition # <<<<<<<<<<<<<< - * - * # calculate number of terms needed for small t - */ - __Pyx_TraceLine(40,1,__PYX_ERR(2, 40, __pyx_L1_error)) - /*else*/ { - __pyx_v_kl = (1. / (M_PI * sqrt(__pyx_v_tt))); - } - __pyx_L3:; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":43 - * - * # calculate number of terms needed for small t - * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< - * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound - * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met - */ - __Pyx_TraceLine(43,1,__PYX_ERR(2, 43, __pyx_L1_error)) - __pyx_t_1 = (((2.0 * sqrt(((2.0 * M_PI) * __pyx_v_tt))) * __pyx_v_err) < 1.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":44 - * # calculate number of terms needed for small t - * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough - * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound # <<<<<<<<<<<<<< - * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met - * else: # if error threshold was set too high - */ - __Pyx_TraceLine(44,1,__PYX_ERR(2, 44, __pyx_L1_error)) - __pyx_v_ks = (2.0 + sqrt(((-2.0 * __pyx_v_tt) * log(((2.0 * sqrt(((2.0 * M_PI) * __pyx_v_tt))) * __pyx_v_err))))); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":45 - * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough - * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound - * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met # <<<<<<<<<<<<<< - * else: # if error threshold was set too high - * ks=2 # minimal kappa for that case - */ - __Pyx_TraceLine(45,1,__PYX_ERR(2, 45, __pyx_L1_error)) - __pyx_v_ks = std::max(__pyx_v_ks, (sqrt(__pyx_v_tt) + 1.0)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":43 - * - * # calculate number of terms needed for small t - * if 2*sqrt(2*M_PI*tt)*err<1: # if error threshold is set low enough # <<<<<<<<<<<<<< - * ks=2+sqrt(-2*tt*log(2*sqrt(2*M_PI*tt)*err)) # bound - * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met - */ - goto __pyx_L4; - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":47 - * ks=max(ks,sqrt(tt)+1) # ensure boundary conditions are met - * else: # if error threshold was set too high - * ks=2 # minimal kappa for that case # <<<<<<<<<<<<<< - * - * # compute f(tt|0,1,w) - */ - __Pyx_TraceLine(47,1,__PYX_ERR(2, 47, __pyx_L1_error)) - /*else*/ { - __pyx_v_ks = 2.0; - } - __pyx_L4:; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":50 - * - * # compute f(tt|0,1,w) - * p=0 #initialize density # <<<<<<<<<<<<<< - * if ks(ceil(ks)) # round to smallest integer meeting error - */ - __Pyx_TraceLine(50,1,__PYX_ERR(2, 50, __pyx_L1_error)) - __pyx_v_p = 0.0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":51 - * # compute f(tt|0,1,w) - * p=0 #initialize density - * if ks(ceil(ks)) # round to smallest integer meeting error - * lower = (-floor((K-1)/2.)) - */ - __Pyx_TraceLine(51,1,__PYX_ERR(2, 51, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_ks < __pyx_v_kl); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":52 - * p=0 #initialize density - * if ks(ceil(ks)) # round to smallest integer meeting error # <<<<<<<<<<<<<< - * lower = (-floor((K-1)/2.)) - * upper = (ceil((K-1)/2.)) - */ - __Pyx_TraceLine(52,1,__PYX_ERR(2, 52, __pyx_L1_error)) - __pyx_v_K = ((int)ceil(__pyx_v_ks)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":53 - * if ks(ceil(ks)) # round to smallest integer meeting error - * lower = (-floor((K-1)/2.)) # <<<<<<<<<<<<<< - * upper = (ceil((K-1)/2.)) - * for k from lower <= k <= upper: # loop over k - */ - __Pyx_TraceLine(53,1,__PYX_ERR(2, 53, __pyx_L1_error)) - __pyx_v_lower = ((int)(-floor((((double)(__pyx_v_K - 1)) / 2.)))); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":54 - * K=(ceil(ks)) # round to smallest integer meeting error - * lower = (-floor((K-1)/2.)) - * upper = (ceil((K-1)/2.)) # <<<<<<<<<<<<<< - * for k from lower <= k <= upper: # loop over k - * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum - */ - __Pyx_TraceLine(54,1,__PYX_ERR(2, 54, __pyx_L1_error)) - __pyx_v_upper = ((int)ceil((((double)(__pyx_v_K - 1)) / 2.))); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":55 - * lower = (-floor((K-1)/2.)) - * upper = (ceil((K-1)/2.)) - * for k from lower <= k <= upper: # loop over k # <<<<<<<<<<<<<< - * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum - * p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term - */ - __Pyx_TraceLine(55,1,__PYX_ERR(2, 55, __pyx_L1_error)) - __pyx_t_2 = __pyx_v_upper; - for (__pyx_v_k = __pyx_v_lower; __pyx_v_k <= __pyx_t_2; __pyx_v_k++) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":56 - * upper = (ceil((K-1)/2.)) - * for k from lower <= k <= upper: # loop over k - * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum # <<<<<<<<<<<<<< - * p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term - * - */ - __Pyx_TraceLine(56,1,__PYX_ERR(2, 56, __pyx_L1_error)) - __pyx_v_p = (__pyx_v_p + ((__pyx_v_w + (2 * __pyx_v_k)) * exp((((-pow((__pyx_v_w + (2 * __pyx_v_k)), 2.0)) / 2.0) / __pyx_v_tt)))); - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":57 - * for k from lower <= k <= upper: # loop over k - * p+=(w+2*k)*exp(-(pow((w+2*k),2))/2/tt) # increment sum - * p/=sqrt(2*M_PI*pow(tt,3)) # add con_stant term # <<<<<<<<<<<<<< - * - * else: # if large t is better... - */ - __Pyx_TraceLine(57,1,__PYX_ERR(2, 57, __pyx_L1_error)) - __pyx_v_p = (__pyx_v_p / sqrt(((2.0 * M_PI) * pow(__pyx_v_tt, 3.0)))); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":51 - * # compute f(tt|0,1,w) - * p=0 #initialize density - * if ks(ceil(ks)) # round to smallest integer meeting error - * lower = (-floor((K-1)/2.)) - */ - goto __pyx_L5; - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":60 - * - * else: # if large t is better... - * K=(ceil(kl)) # round to smallest integer meeting error # <<<<<<<<<<<<<< - * for k from 1 <= k <= K: - * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum - */ - __Pyx_TraceLine(60,1,__PYX_ERR(2, 60, __pyx_L1_error)) - /*else*/ { - __pyx_v_K = ((int)ceil(__pyx_v_kl)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":61 - * else: # if large t is better... - * K=(ceil(kl)) # round to smallest integer meeting error - * for k from 1 <= k <= K: # <<<<<<<<<<<<<< - * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum - * p*=M_PI # add con_stant term - */ - __Pyx_TraceLine(61,1,__PYX_ERR(2, 61, __pyx_L1_error)) - __pyx_t_2 = __pyx_v_K; - for (__pyx_v_k = 1; __pyx_v_k <= __pyx_t_2; __pyx_v_k++) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":62 - * K=(ceil(kl)) # round to smallest integer meeting error - * for k from 1 <= k <= K: - * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum # <<<<<<<<<<<<<< - * p*=M_PI # add con_stant term - * - */ - __Pyx_TraceLine(62,1,__PYX_ERR(2, 62, __pyx_L1_error)) - __pyx_v_p = (__pyx_v_p + ((__pyx_v_k * exp(((((-pow(__pyx_v_k, 2.0)) * pow(M_PI, 2.0)) * __pyx_v_tt) / 2.0))) * sin(((__pyx_v_k * M_PI) * __pyx_v_w)))); - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":63 - * for k from 1 <= k <= K: - * p+=k*exp(-(pow(k,2))*(M_PI**2)*tt/2)*sin(k*M_PI*w) # increment sum - * p*=M_PI # add con_stant term # <<<<<<<<<<<<<< - * - * return p - */ - __Pyx_TraceLine(63,1,__PYX_ERR(2, 63, __pyx_L1_error)) - __pyx_v_p = (__pyx_v_p * M_PI); - } - __pyx_L5:; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":65 - * p*=M_PI # add con_stant term - * - * return p # <<<<<<<<<<<<<< - * - * cdef inline double prob_ub(double v, double a, double z) nogil: - */ - __Pyx_TraceLine(65,1,__PYX_ERR(2, 65, __pyx_L1_error)) - __pyx_r = __pyx_v_p; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 - * T max[T](T a, T b) - * - * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< - * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method - * and implementation of Navarro & Fuss, 2009. - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.ftt_01w", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 - * return p - * - * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< - * """Probability of hitting upper boundary.""" - * if v == 0: - */ - -static CYTHON_INLINE double __pyx_f_4wfpt_prob_ub(double __pyx_v_v, double __pyx_v_a, double __pyx_v_z) { - double __pyx_r; - __Pyx_TraceDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceCall("prob_ub", __pyx_f[2], 67, 1, __PYX_ERR(2, 67, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":69 - * cdef inline double prob_ub(double v, double a, double z) nogil: - * """Probability of hitting upper boundary.""" - * if v == 0: # <<<<<<<<<<<<<< - * return z - * else: - */ - __Pyx_TraceLine(69,1,__PYX_ERR(2, 69, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_v == 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":70 - * """Probability of hitting upper boundary.""" - * if v == 0: - * return z # <<<<<<<<<<<<<< - * else: - * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) - */ - __Pyx_TraceLine(70,1,__PYX_ERR(2, 70, __pyx_L1_error)) - __pyx_r = __pyx_v_z; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":69 - * cdef inline double prob_ub(double v, double a, double z) nogil: - * """Probability of hitting upper boundary.""" - * if v == 0: # <<<<<<<<<<<<<< - * return z - * else: - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":72 - * return z - * else: - * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) # <<<<<<<<<<<<<< - * - * cdef double pdf(double x, double v, double a, double w, double err) nogil: - */ - __Pyx_TraceLine(72,1,__PYX_ERR(2, 72, __pyx_L1_error)) - /*else*/ { - __pyx_r = ((exp((((-2.0 * __pyx_v_a) * __pyx_v_z) * __pyx_v_v)) - 1.0) / (exp(((-2.0 * __pyx_v_a) * __pyx_v_v)) - 1.0)); - goto __pyx_L0; - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 - * return p - * - * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< - * """Probability of hitting upper boundary.""" - * if v == 0: - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.prob_ub", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 - * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) - * - * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< - * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method - * and implementation of Navarro & Fuss, 2009. - */ - -static double __pyx_f_4wfpt_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_v_a, double __pyx_v_w, double __pyx_v_err) { - double __pyx_v_tt; - double __pyx_v_p; - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - double __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("pdf", 1); - __Pyx_TraceCall("pdf", __pyx_f[2], 74, 1, __PYX_ERR(2, 74, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":78 - * and implementation of Navarro & Fuss, 2009. - * """ - * if x <= 0: # <<<<<<<<<<<<<< - * return 0 - * - */ - __Pyx_TraceLine(78,1,__PYX_ERR(2, 78, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_x <= 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":79 - * """ - * if x <= 0: - * return 0 # <<<<<<<<<<<<<< - * - * cdef double tt = x/a**2 # use normalized time - */ - __Pyx_TraceLine(79,1,__PYX_ERR(2, 79, __pyx_L1_error)) - __pyx_r = 0.0; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":78 - * and implementation of Navarro & Fuss, 2009. - * """ - * if x <= 0: # <<<<<<<<<<<<<< - * return 0 - * - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":81 - * return 0 - * - * cdef double tt = x/a**2 # use normalized time # <<<<<<<<<<<<<< - * cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) - * - */ - __Pyx_TraceLine(81,1,__PYX_ERR(2, 81, __pyx_L1_error)) - __pyx_v_tt = (__pyx_v_x / pow(__pyx_v_a, 2.0)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":82 - * - * cdef double tt = x/a**2 # use normalized time - * cdef double p = ftt_01w(tt, w, err) #get f(t|0,1,w) # <<<<<<<<<<<<<< - * - * # convert to f(t|v,a,w) - */ - __Pyx_TraceLine(82,1,__PYX_ERR(2, 82, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_ftt_01w(__pyx_v_tt, __pyx_v_w, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 82, __pyx_L1_error) - __pyx_v_p = __pyx_t_2; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":85 - * - * # convert to f(t|v,a,w) - * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) # <<<<<<<<<<<<<< - * - * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: - */ - __Pyx_TraceLine(85,1,__PYX_ERR(2, 85, __pyx_L1_error)) - __pyx_r = ((__pyx_v_p * exp(((((-__pyx_v_v) * __pyx_v_a) * __pyx_v_w) - ((pow(__pyx_v_v, 2.0) * __pyx_v_x) / 2.)))) / pow(__pyx_v_a, 2.0)); - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 - * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) - * - * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< - * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method - * and implementation of Navarro & Fuss, 2009. - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 - * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) - * - * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< - * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method - * and implementation of Navarro & Fuss, 2009. - */ - -static double __pyx_f_4wfpt_pdf_sv(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_err) { - double __pyx_v_tt; - double __pyx_v_p; - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - double __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("pdf_sv", 1); - __Pyx_TraceCall("pdf_sv", __pyx_f[2], 87, 1, __PYX_ERR(2, 87, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":92 - * sv is the std of the drift rate - * """ - * if x <= 0: # <<<<<<<<<<<<<< - * return 0 - * - */ - __Pyx_TraceLine(92,1,__PYX_ERR(2, 92, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_x <= 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":93 - * """ - * if x <= 0: - * return 0 # <<<<<<<<<<<<<< - * - * if sv==0: - */ - __Pyx_TraceLine(93,1,__PYX_ERR(2, 93, __pyx_L1_error)) - __pyx_r = 0.0; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":92 - * sv is the std of the drift rate - * """ - * if x <= 0: # <<<<<<<<<<<<<< - * return 0 - * - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":95 - * return 0 - * - * if sv==0: # <<<<<<<<<<<<<< - * return pdf(x, v, a, z, err) - * - */ - __Pyx_TraceLine(95,1,__PYX_ERR(2, 95, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_sv == 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":96 - * - * if sv==0: - * return pdf(x, v, a, z, err) # <<<<<<<<<<<<<< - * - * cdef double tt = x/(pow(a,2)) # use normalized time - */ - __Pyx_TraceLine(96,1,__PYX_ERR(2, 96, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_pdf(__pyx_v_x, __pyx_v_v, __pyx_v_a, __pyx_v_z, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 96, __pyx_L1_error) - __pyx_r = __pyx_t_2; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":95 - * return 0 - * - * if sv==0: # <<<<<<<<<<<<<< - * return pdf(x, v, a, z, err) - * - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":98 - * return pdf(x, v, a, z, err) - * - * cdef double tt = x/(pow(a,2)) # use normalized time # <<<<<<<<<<<<<< - * cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) - * - */ - __Pyx_TraceLine(98,1,__PYX_ERR(2, 98, __pyx_L1_error)) - __pyx_v_tt = (__pyx_v_x / pow(__pyx_v_a, 2.0)); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":99 - * - * cdef double tt = x/(pow(a,2)) # use normalized time - * cdef double p = ftt_01w(tt, z, err) #get f(t|0,1,w) # <<<<<<<<<<<<<< - * - * # convert to f(t|v,a,w) - */ - __Pyx_TraceLine(99,1,__PYX_ERR(2, 99, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_ftt_01w(__pyx_v_tt, __pyx_v_z, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 99, __pyx_L1_error) - __pyx_v_p = __pyx_t_2; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":102 - * - * # convert to f(t|v,a,w) - * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) # <<<<<<<<<<<<<< - * - * cpdef double full_pdf(double x, double v, double sv, double a, double - */ - __Pyx_TraceLine(102,1,__PYX_ERR(2, 102, __pyx_L1_error)) - __pyx_r = ((exp((log(__pyx_v_p) + (((pow(((__pyx_v_a * __pyx_v_z) * __pyx_v_sv), 2.0) - (((2.0 * __pyx_v_a) * __pyx_v_v) * __pyx_v_z)) - (pow(__pyx_v_v, 2.0) * __pyx_v_x)) / (((2.0 * pow(__pyx_v_sv, 2.0)) * __pyx_v_x) + 2.0)))) / sqrt(((pow(__pyx_v_sv, 2.0) * __pyx_v_x) + 1.0))) / pow(__pyx_v_a, 2.0)); - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 - * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) - * - * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< - * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method - * and implementation of Navarro & Fuss, 2009. - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.pdf_sv", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 - * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * - * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< - * z, double sz, double t, double st, double err, int - * n_st=2, int n_sz=2, bint use_adaptive=1, double - */ - -static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static double __pyx_f_4wfpt_full_pdf(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_4wfpt_full_pdf *__pyx_optional_args) { - int __pyx_v_n_st = ((int)2); - int __pyx_v_n_sz = ((int)2); - int __pyx_v_use_adaptive = ((int)1); - double __pyx_v_simps_err = ((double)1e-3); - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - double __pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_TraceFrameInit(__pyx_codeobj__3) - __Pyx_RefNannySetupContext("full_pdf", 1); - __Pyx_TraceCall("full_pdf", __pyx_f[2], 104, 1, __PYX_ERR(2, 104, __pyx_L1_error)); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_n_st = __pyx_optional_args->n_st; - if (__pyx_optional_args->__pyx_n > 1) { - __pyx_v_n_sz = __pyx_optional_args->n_sz; - if (__pyx_optional_args->__pyx_n > 2) { - __pyx_v_use_adaptive = __pyx_optional_args->use_adaptive; - if (__pyx_optional_args->__pyx_n > 3) { - __pyx_v_simps_err = __pyx_optional_args->simps_err; - } - } - } - } - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 - * - * # Check if parpameters are valid - * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< - * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): - * return 0 - */ - __Pyx_TraceLine(111,1,__PYX_ERR(2, 111, __pyx_L1_error)) - __pyx_t_2 = (__pyx_v_z < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_z > 1.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_a < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_t < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_st < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_sv < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_sz < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_sz > 1.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":112 - * # Check if parpameters are valid - * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ - * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): # <<<<<<<<<<<<<< - * return 0 - * - */ - __Pyx_TraceLine(112,1,__PYX_ERR(2, 112, __pyx_L1_error)) - __pyx_t_2 = ((fabs(__pyx_v_x) - (__pyx_v_t - (__pyx_v_st / 2.))) < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_z + (__pyx_v_sz / 2.)) > 1.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_z - (__pyx_v_sz / 2.)) < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_t - (__pyx_v_st / 2.)) < 0.0); - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 - * - * # Check if parpameters are valid - * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< - * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): - * return 0 - */ - __Pyx_TraceLine(111,1,__PYX_ERR(2, 111, __pyx_L1_error)) - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":113 - * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ - * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): - * return 0 # <<<<<<<<<<<<<< - * - * # transform x,v,z if x is upper bound response - */ - __Pyx_TraceLine(113,1,__PYX_ERR(2, 113, __pyx_L1_error)) - __pyx_r = 0.0; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":111 - * - * # Check if parpameters are valid - * if (z<0) or (z>1) or (a<0) or (t<0) or (st<0) or (sv<0) or (sz<0) or (sz>1) or \ # <<<<<<<<<<<<<< - * ((fabs(x)-(t-st/2.))<0) or (z+sz/2.>1) or (z-sz/2.<0) or (t-st/2.<0): - * return 0 - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":116 - * - * # transform x,v,z if x is upper bound response - * if x > 0: # <<<<<<<<<<<<<< - * v = -v - * z = 1.-z - */ - __Pyx_TraceLine(116,1,__PYX_ERR(2, 116, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_x > 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":117 - * # transform x,v,z if x is upper bound response - * if x > 0: - * v = -v # <<<<<<<<<<<<<< - * z = 1.-z - * - */ - __Pyx_TraceLine(117,1,__PYX_ERR(2, 117, __pyx_L1_error)) - __pyx_v_v = (-__pyx_v_v); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":118 - * if x > 0: - * v = -v - * z = 1.-z # <<<<<<<<<<<<<< - * - * x = fabs(x) - */ - __Pyx_TraceLine(118,1,__PYX_ERR(2, 118, __pyx_L1_error)) - __pyx_v_z = (1. - __pyx_v_z); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":116 - * - * # transform x,v,z if x is upper bound response - * if x > 0: # <<<<<<<<<<<<<< - * v = -v - * z = 1.-z - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":120 - * z = 1.-z - * - * x = fabs(x) # <<<<<<<<<<<<<< - * - * if st<1e-3: - */ - __Pyx_TraceLine(120,1,__PYX_ERR(2, 120, __pyx_L1_error)) - __pyx_v_x = fabs(__pyx_v_x); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":122 - * x = fabs(x) - * - * if st<1e-3: # <<<<<<<<<<<<<< - * st = 0 - * if sz <1e-3: - */ - __Pyx_TraceLine(122,1,__PYX_ERR(2, 122, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_st < 1e-3); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":123 - * - * if st<1e-3: - * st = 0 # <<<<<<<<<<<<<< - * if sz <1e-3: - * sz = 0 - */ - __Pyx_TraceLine(123,1,__PYX_ERR(2, 123, __pyx_L1_error)) - __pyx_v_st = 0.0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":122 - * x = fabs(x) - * - * if st<1e-3: # <<<<<<<<<<<<<< - * st = 0 - * if sz <1e-3: - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":124 - * if st<1e-3: - * st = 0 - * if sz <1e-3: # <<<<<<<<<<<<<< - * sz = 0 - * - */ - __Pyx_TraceLine(124,1,__PYX_ERR(2, 124, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_sz < 1e-3); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":125 - * st = 0 - * if sz <1e-3: - * sz = 0 # <<<<<<<<<<<<<< - * - * if (sz==0): - */ - __Pyx_TraceLine(125,1,__PYX_ERR(2, 125, __pyx_L1_error)) - __pyx_v_sz = 0.0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":124 - * if st<1e-3: - * st = 0 - * if sz <1e-3: # <<<<<<<<<<<<<< - * sz = 0 - * - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":127 - * sz = 0 - * - * if (sz==0): # <<<<<<<<<<<<<< - * if (st==0): #sv=0,sz=0,st=0 - * return pdf_sv(x - t, v, sv, a, z, err) - */ - __Pyx_TraceLine(127,1,__PYX_ERR(2, 127, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_sz == 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":128 - * - * if (sz==0): - * if (st==0): #sv=0,sz=0,st=0 # <<<<<<<<<<<<<< - * return pdf_sv(x - t, v, sv, a, z, err) - * else: #sv=0,sz=0,st=$ - */ - __Pyx_TraceLine(128,1,__PYX_ERR(2, 128, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_st == 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":129 - * if (sz==0): - * if (st==0): #sv=0,sz=0,st=0 - * return pdf_sv(x - t, v, sv, a, z, err) # <<<<<<<<<<<<<< - * else: #sv=0,sz=0,st=$ - * if use_adaptive>0: - */ - __Pyx_TraceLine(129,1,__PYX_ERR(2, 129, __pyx_L1_error)) - __pyx_t_3 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_err); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 129, __pyx_L1_error) - __pyx_r = __pyx_t_3; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":128 - * - * if (sz==0): - * if (st==0): #sv=0,sz=0,st=0 # <<<<<<<<<<<<<< - * return pdf_sv(x - t, v, sv, a, z, err) - * else: #sv=0,sz=0,st=$ - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":131 - * return pdf_sv(x - t, v, sv, a, z, err) - * else: #sv=0,sz=0,st=$ - * if use_adaptive>0: # <<<<<<<<<<<<<< - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) - * else: - */ - __Pyx_TraceLine(131,1,__PYX_ERR(2, 131, __pyx_L1_error)) - /*else*/ { - __pyx_t_1 = (__pyx_v_use_adaptive > 0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":132 - * else: #sv=0,sz=0,st=$ - * if use_adaptive>0: - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) # <<<<<<<<<<<<<< - * else: - * return simpson_1D(x, v, sv, a, z, t, err, z, z, 0, t-st/2., t+st/2., n_st) - */ - __Pyx_TraceLine(132,1,__PYX_ERR(2, 132, __pyx_L1_error)) - __pyx_t_3 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, __pyx_v_z, __pyx_v_z, (__pyx_v_t - (__pyx_v_st / 2.)), (__pyx_v_t + (__pyx_v_st / 2.)), __pyx_v_simps_err, __pyx_v_n_st); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 132, __pyx_L1_error) - __pyx_r = __pyx_t_3; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":131 - * return pdf_sv(x - t, v, sv, a, z, err) - * else: #sv=0,sz=0,st=$ - * if use_adaptive>0: # <<<<<<<<<<<<<< - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) - * else: - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":134 - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z, z, t-st/2., t+st/2., simps_err, n_st) - * else: - * return simpson_1D(x, v, sv, a, z, t, err, z, z, 0, t-st/2., t+st/2., n_st) # <<<<<<<<<<<<<< - * - * else: #sz=$ - */ - __Pyx_TraceLine(134,1,__PYX_ERR(2, 134, __pyx_L1_error)) - /*else*/ { - __pyx_t_3 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, __pyx_v_z, __pyx_v_z, 0, (__pyx_v_t - (__pyx_v_st / 2.)), (__pyx_v_t + (__pyx_v_st / 2.)), __pyx_v_n_st); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 134, __pyx_L1_error) - __pyx_r = __pyx_t_3; - goto __pyx_L0; - } - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":127 - * sz = 0 - * - * if (sz==0): # <<<<<<<<<<<<<< - * if (st==0): #sv=0,sz=0,st=0 - * return pdf_sv(x - t, v, sv, a, z, err) - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":137 - * - * else: #sz=$ - * if (st==0): #sv=0,sz=$,st=0 # <<<<<<<<<<<<<< - * if use_adaptive: - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) - */ - __Pyx_TraceLine(137,1,__PYX_ERR(2, 137, __pyx_L1_error)) - /*else*/ { - __pyx_t_1 = (__pyx_v_st == 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":138 - * else: #sz=$ - * if (st==0): #sv=0,sz=$,st=0 - * if use_adaptive: # <<<<<<<<<<<<<< - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) - * else: - */ - __Pyx_TraceLine(138,1,__PYX_ERR(2, 138, __pyx_L1_error)) - if (__pyx_v_use_adaptive) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":139 - * if (st==0): #sv=0,sz=$,st=0 - * if use_adaptive: - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) # <<<<<<<<<<<<<< - * else: - * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) - */ - __Pyx_TraceLine(139,1,__PYX_ERR(2, 139, __pyx_L1_error)) - __pyx_t_3 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, (__pyx_v_z - (__pyx_v_sz / 2.)), (__pyx_v_z + (__pyx_v_sz / 2.)), __pyx_v_t, __pyx_v_t, __pyx_v_simps_err, __pyx_v_n_sz); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 139, __pyx_L1_error) - __pyx_r = __pyx_t_3; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":138 - * else: #sz=$ - * if (st==0): #sv=0,sz=$,st=0 - * if use_adaptive: # <<<<<<<<<<<<<< - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) - * else: - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":141 - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) - * else: - * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) # <<<<<<<<<<<<<< - * else: #sv=0,sz=$,st=$ - * if use_adaptive: - */ - __Pyx_TraceLine(141,1,__PYX_ERR(2, 141, __pyx_L1_error)) - /*else*/ { - __pyx_t_3 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, (__pyx_v_z - (__pyx_v_sz / 2.)), (__pyx_v_z + (__pyx_v_sz / 2.)), __pyx_v_n_sz, __pyx_v_t, __pyx_v_t, 0); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 141, __pyx_L1_error) - __pyx_r = __pyx_t_3; - goto __pyx_L0; - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":137 - * - * else: #sz=$ - * if (st==0): #sv=0,sz=$,st=0 # <<<<<<<<<<<<<< - * if use_adaptive: - * return adaptiveSimpsons_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t, t, simps_err, n_sz) - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":143 - * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) - * else: #sv=0,sz=$,st=$ - * if use_adaptive: # <<<<<<<<<<<<<< - * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) - * else: - */ - __Pyx_TraceLine(143,1,__PYX_ERR(2, 143, __pyx_L1_error)) - /*else*/ { - if (__pyx_v_use_adaptive) { - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":144 - * else: #sv=0,sz=$,st=$ - * if use_adaptive: - * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) # <<<<<<<<<<<<<< - * else: - * return simpson_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t-st/2., t+st/2., n_st) - */ - __Pyx_TraceLine(144,1,__PYX_ERR(2, 144, __pyx_L1_error)) - __pyx_t_3 = __pyx_f_4wfpt_adaptiveSimpsons_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, (__pyx_v_z - (__pyx_v_sz / 2.)), (__pyx_v_z + (__pyx_v_sz / 2.)), (__pyx_v_t - (__pyx_v_st / 2.)), (__pyx_v_t + (__pyx_v_st / 2.)), __pyx_v_simps_err, __pyx_v_n_sz, __pyx_v_n_st); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 144, __pyx_L1_error) - __pyx_r = __pyx_t_3; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":143 - * return simpson_1D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t, t , 0) - * else: #sv=0,sz=$,st=$ - * if use_adaptive: # <<<<<<<<<<<<<< - * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) - * else: - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":146 - * return adaptiveSimpsons_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., t-st/2., t+st/2., simps_err, n_sz, n_st) - * else: - * return simpson_2D(x, v, sv, a, z, t, err, z-sz/2., z+sz/2., n_sz, t-st/2., t+st/2., n_st) # <<<<<<<<<<<<<< - */ - __Pyx_TraceLine(146,1,__PYX_ERR(2, 146, __pyx_L1_error)) - /*else*/ { - __pyx_t_3 = __pyx_f_4wfpt_simpson_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_err, (__pyx_v_z - (__pyx_v_sz / 2.)), (__pyx_v_z + (__pyx_v_sz / 2.)), __pyx_v_n_sz, (__pyx_v_t - (__pyx_v_st / 2.)), (__pyx_v_t + (__pyx_v_st / 2.)), __pyx_v_n_st); if (unlikely(__pyx_t_3 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(2, 146, __pyx_L1_error) - __pyx_r = __pyx_t_3; - goto __pyx_L0; - } - } - } - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 - * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * - * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< - * z, double sz, double t, double st, double err, int - * n_st=2, int n_sz=2, bint use_adaptive=1, double - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.full_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_full_pdf, "full_pdf(double x, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3) -> double\nfull pdf"); -static PyMethodDef __pyx_mdef_4wfpt_1full_pdf = {"full_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_1full_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_full_pdf}; -static PyObject *__pyx_pw_4wfpt_1full_pdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - double __pyx_v_x; - double __pyx_v_v; - double __pyx_v_sv; - double __pyx_v_a; - double __pyx_v_z; - double __pyx_v_sz; - double __pyx_v_t; - double __pyx_v_st; - double __pyx_v_err; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("full_pdf (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(2, 104, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 1); __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 2); __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 3); __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 4); __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 5); __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 6); __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 7); __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, 8); __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "full_pdf") < 0)) __PYX_ERR(2, 104, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - __pyx_v_v = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) - if (values[9]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 105, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)2); - } - if (values[10]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 106, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)2); - } - if (values[11]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 106, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)1); - } - if (values[12]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 106, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)1e-3); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("full_pdf", 0, 9, 13, __pyx_nargs); __PYX_ERR(2, 104, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.full_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4wfpt_full_pdf(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_full_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - double __pyx_t_1; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__3) - __Pyx_RefNannySetupContext("full_pdf", 0); - __Pyx_TraceCall("full_pdf (wrapper)", __pyx_f[2], 104, 0, __PYX_ERR(2, 104, __pyx_L1_error)); - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 4; - __pyx_t_2.n_st = __pyx_v_n_st; - __pyx_t_2.n_sz = __pyx_v_n_sz; - __pyx_t_2.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_2.simps_err = __pyx_v_simps_err; - __pyx_t_1 = __pyx_f_4wfpt_full_pdf(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(2, 104, __pyx_L1_error) - __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("wfpt.full_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 - * include 'pdf.pxi' - * - * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< - * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: - * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" - */ - -static double __pyx_f_4wfpt_simpson_1D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_err, double __pyx_v_lb_z, double __pyx_v_ub_z, int __pyx_v_n_sz, double __pyx_v_lb_t, double __pyx_v_ub_t, int __pyx_v_n_st) { - double __pyx_v_ht; - double __pyx_v_hz; - int __pyx_v_n; - double __pyx_v_S; - double __pyx_v_z_tag; - double __pyx_v_t_tag; - double __pyx_v_y; - int __pyx_v_i; - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - double __pyx_t_2; - int __pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("simpson_1D", 1); - __Pyx_TraceCall("simpson_1D", __pyx_f[3], 12, 1, __PYX_ERR(3, 12, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":18 - * - * cdef double ht, hz - * cdef int n = max(n_st, n_sz) # <<<<<<<<<<<<<< - * if n_st==0: #integration over z - * hz = (ub_z-lb_z)/n - */ - __Pyx_TraceLine(18,1,__PYX_ERR(3, 18, __pyx_L1_error)) - __pyx_v_n = std::max(__pyx_v_n_st, __pyx_v_n_sz); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":19 - * cdef double ht, hz - * cdef int n = max(n_st, n_sz) - * if n_st==0: #integration over z # <<<<<<<<<<<<<< - * hz = (ub_z-lb_z)/n - * ht = 0 - */ - __Pyx_TraceLine(19,1,__PYX_ERR(3, 19, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_n_st == 0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":20 - * cdef int n = max(n_st, n_sz) - * if n_st==0: #integration over z - * hz = (ub_z-lb_z)/n # <<<<<<<<<<<<<< - * ht = 0 - * lb_t = t - */ - __Pyx_TraceLine(20,1,__PYX_ERR(3, 20, __pyx_L1_error)) - __pyx_v_hz = ((__pyx_v_ub_z - __pyx_v_lb_z) / ((double)__pyx_v_n)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":21 - * if n_st==0: #integration over z - * hz = (ub_z-lb_z)/n - * ht = 0 # <<<<<<<<<<<<<< - * lb_t = t - * ub_t = t - */ - __Pyx_TraceLine(21,1,__PYX_ERR(3, 21, __pyx_L1_error)) - __pyx_v_ht = 0.0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":22 - * hz = (ub_z-lb_z)/n - * ht = 0 - * lb_t = t # <<<<<<<<<<<<<< - * ub_t = t - * else: #integration over t - */ - __Pyx_TraceLine(22,1,__PYX_ERR(3, 22, __pyx_L1_error)) - __pyx_v_lb_t = __pyx_v_t; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":23 - * ht = 0 - * lb_t = t - * ub_t = t # <<<<<<<<<<<<<< - * else: #integration over t - * hz = 0 - */ - __Pyx_TraceLine(23,1,__PYX_ERR(3, 23, __pyx_L1_error)) - __pyx_v_ub_t = __pyx_v_t; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":19 - * cdef double ht, hz - * cdef int n = max(n_st, n_sz) - * if n_st==0: #integration over z # <<<<<<<<<<<<<< - * hz = (ub_z-lb_z)/n - * ht = 0 - */ - goto __pyx_L3; - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":25 - * ub_t = t - * else: #integration over t - * hz = 0 # <<<<<<<<<<<<<< - * ht = (ub_t-lb_t)/n - * lb_z = z - */ - __Pyx_TraceLine(25,1,__PYX_ERR(3, 25, __pyx_L1_error)) - /*else*/ { - __pyx_v_hz = 0.0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":26 - * else: #integration over t - * hz = 0 - * ht = (ub_t-lb_t)/n # <<<<<<<<<<<<<< - * lb_z = z - * ub_z = z - */ - __Pyx_TraceLine(26,1,__PYX_ERR(3, 26, __pyx_L1_error)) - __pyx_v_ht = ((__pyx_v_ub_t - __pyx_v_lb_t) / ((double)__pyx_v_n)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":27 - * hz = 0 - * ht = (ub_t-lb_t)/n - * lb_z = z # <<<<<<<<<<<<<< - * ub_z = z - * - */ - __Pyx_TraceLine(27,1,__PYX_ERR(3, 27, __pyx_L1_error)) - __pyx_v_lb_z = __pyx_v_z; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":28 - * ht = (ub_t-lb_t)/n - * lb_z = z - * ub_z = z # <<<<<<<<<<<<<< - * - * cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) - */ - __Pyx_TraceLine(28,1,__PYX_ERR(3, 28, __pyx_L1_error)) - __pyx_v_ub_z = __pyx_v_z; - } - __pyx_L3:; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":30 - * ub_z = z - * - * cdef double S = pdf_sv(x - lb_t, v, sv, a, lb_z, err) # <<<<<<<<<<<<<< - * cdef double z_tag, t_tag, y - * cdef int i - */ - __Pyx_TraceLine(30,1,__PYX_ERR(3, 30, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_lb_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_lb_z, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 30, __pyx_L1_error) - __pyx_v_S = __pyx_t_2; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":34 - * cdef int i - * - * for i from 1 <= i <= n: # <<<<<<<<<<<<<< - * z_tag = lb_z + hz * i - * t_tag = lb_t + ht * i - */ - __Pyx_TraceLine(34,1,__PYX_ERR(3, 34, __pyx_L1_error)) - __pyx_t_3 = __pyx_v_n; - for (__pyx_v_i = 1; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":35 - * - * for i from 1 <= i <= n: - * z_tag = lb_z + hz * i # <<<<<<<<<<<<<< - * t_tag = lb_t + ht * i - * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) - */ - __Pyx_TraceLine(35,1,__PYX_ERR(3, 35, __pyx_L1_error)) - __pyx_v_z_tag = (__pyx_v_lb_z + (__pyx_v_hz * __pyx_v_i)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":36 - * for i from 1 <= i <= n: - * z_tag = lb_z + hz * i - * t_tag = lb_t + ht * i # <<<<<<<<<<<<<< - * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) - * if i&1: #check if i is odd - */ - __Pyx_TraceLine(36,1,__PYX_ERR(3, 36, __pyx_L1_error)) - __pyx_v_t_tag = (__pyx_v_lb_t + (__pyx_v_ht * __pyx_v_i)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":37 - * z_tag = lb_z + hz * i - * t_tag = lb_t + ht * i - * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) # <<<<<<<<<<<<<< - * if i&1: #check if i is odd - * S += (4 * y) - */ - __Pyx_TraceLine(37,1,__PYX_ERR(3, 37, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_tag), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_tag, __pyx_v_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 37, __pyx_L1_error) - __pyx_v_y = __pyx_t_2; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":38 - * t_tag = lb_t + ht * i - * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) - * if i&1: #check if i is odd # <<<<<<<<<<<<<< - * S += (4 * y) - * else: - */ - __Pyx_TraceLine(38,1,__PYX_ERR(3, 38, __pyx_L1_error)) - __pyx_t_1 = ((__pyx_v_i & 1) != 0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":39 - * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) - * if i&1: #check if i is odd - * S += (4 * y) # <<<<<<<<<<<<<< - * else: - * S += (2 * y) - */ - __Pyx_TraceLine(39,1,__PYX_ERR(3, 39, __pyx_L1_error)) - __pyx_v_S = (__pyx_v_S + (4.0 * __pyx_v_y)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":38 - * t_tag = lb_t + ht * i - * y = pdf_sv(x - t_tag, v, sv, a, z_tag, err) - * if i&1: #check if i is odd # <<<<<<<<<<<<<< - * S += (4 * y) - * else: - */ - goto __pyx_L6; - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":41 - * S += (4 * y) - * else: - * S += (2 * y) # <<<<<<<<<<<<<< - * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y - * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st - */ - __Pyx_TraceLine(41,1,__PYX_ERR(3, 41, __pyx_L1_error)) - /*else*/ { - __pyx_v_S = (__pyx_v_S + (2.0 * __pyx_v_y)); - } - __pyx_L6:; - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":42 - * else: - * S += (2 * y) - * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y # <<<<<<<<<<<<<< - * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st - * - */ - __Pyx_TraceLine(42,1,__PYX_ERR(3, 42, __pyx_L1_error)) - __pyx_v_S = (__pyx_v_S - __pyx_v_y); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":43 - * S += (2 * y) - * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y - * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st # <<<<<<<<<<<<<< - * - * return ((ht+hz) * S / 3) - */ - __Pyx_TraceLine(43,1,__PYX_ERR(3, 43, __pyx_L1_error)) - __pyx_v_S = (__pyx_v_S / ((__pyx_v_ub_t - __pyx_v_lb_t) + (__pyx_v_ub_z - __pyx_v_lb_z))); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":45 - * S = S / ((ub_t-lb_t)+(ub_z-lb_z)) #the right function if pdf_sv()/sz or pdf_sv()/st - * - * return ((ht+hz) * S / 3) # <<<<<<<<<<<<<< - * - * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: - */ - __Pyx_TraceLine(45,1,__PYX_ERR(3, 45, __pyx_L1_error)) - __pyx_r = (((__pyx_v_ht + __pyx_v_hz) * __pyx_v_S) / 3.0); - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 - * include 'pdf.pxi' - * - * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< - * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: - * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.simpson_1D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 - * return ((ht+hz) * S / 3) - * - * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< - * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" - * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) - */ - -static double __pyx_f_4wfpt_simpson_2D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_t, double __pyx_v_err, double __pyx_v_lb_z, double __pyx_v_ub_z, int __pyx_v_n_sz, double __pyx_v_lb_t, double __pyx_v_ub_t, int __pyx_v_n_st) { - double __pyx_v_ht; - double __pyx_v_S; - double __pyx_v_t_tag; - double __pyx_v_y; - int __pyx_v_i_t; - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - double __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("simpson_2D", 1); - __Pyx_TraceCall("simpson_2D", __pyx_f[3], 47, 1, __PYX_ERR(3, 47, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":56 - * cdef int i_t - * - * ht = (ub_t-lb_t)/n_st # <<<<<<<<<<<<<< - * - * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) - */ - __Pyx_TraceLine(56,1,__PYX_ERR(3, 56, __pyx_L1_error)) - __pyx_v_ht = ((__pyx_v_ub_t - __pyx_v_lb_t) / ((double)__pyx_v_n_st)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":58 - * ht = (ub_t-lb_t)/n_st - * - * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) # <<<<<<<<<<<<<< - * - * for i_t from 1 <= i_t <= n_st: - */ - __Pyx_TraceLine(58,1,__PYX_ERR(3, 58, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_lb_t, __pyx_v_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_n_sz, 0.0, 0.0, 0); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 58, __pyx_L1_error) - __pyx_v_S = __pyx_t_1; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":60 - * S = simpson_1D(x, v, sv, a, z, lb_t, err, lb_z, ub_z, n_sz, 0, 0, 0) - * - * for i_t from 1 <= i_t <= n_st: # <<<<<<<<<<<<<< - * t_tag = lb_t + ht * i_t - * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) - */ - __Pyx_TraceLine(60,1,__PYX_ERR(3, 60, __pyx_L1_error)) - __pyx_t_2 = __pyx_v_n_st; - for (__pyx_v_i_t = 1; __pyx_v_i_t <= __pyx_t_2; __pyx_v_i_t++) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":61 - * - * for i_t from 1 <= i_t <= n_st: - * t_tag = lb_t + ht * i_t # <<<<<<<<<<<<<< - * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) - * if i_t&1: #check if i is odd - */ - __Pyx_TraceLine(61,1,__PYX_ERR(3, 61, __pyx_L1_error)) - __pyx_v_t_tag = (__pyx_v_lb_t + (__pyx_v_ht * __pyx_v_i_t)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":62 - * for i_t from 1 <= i_t <= n_st: - * t_tag = lb_t + ht * i_t - * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) # <<<<<<<<<<<<<< - * if i_t&1: #check if i is odd - * S += (4 * y) - */ - __Pyx_TraceLine(62,1,__PYX_ERR(3, 62, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_simpson_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_tag, __pyx_v_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_n_sz, 0.0, 0.0, 0); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 62, __pyx_L1_error) - __pyx_v_y = __pyx_t_1; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":63 - * t_tag = lb_t + ht * i_t - * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) - * if i_t&1: #check if i is odd # <<<<<<<<<<<<<< - * S += (4 * y) - * else: - */ - __Pyx_TraceLine(63,1,__PYX_ERR(3, 63, __pyx_L1_error)) - __pyx_t_3 = ((__pyx_v_i_t & 1) != 0); - if (__pyx_t_3) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":64 - * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) - * if i_t&1: #check if i is odd - * S += (4 * y) # <<<<<<<<<<<<<< - * else: - * S += (2 * y) - */ - __Pyx_TraceLine(64,1,__PYX_ERR(3, 64, __pyx_L1_error)) - __pyx_v_S = (__pyx_v_S + (4.0 * __pyx_v_y)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":63 - * t_tag = lb_t + ht * i_t - * y = simpson_1D(x, v, sv, a, z, t_tag, err, lb_z, ub_z, n_sz, 0, 0, 0) - * if i_t&1: #check if i is odd # <<<<<<<<<<<<<< - * S += (4 * y) - * else: - */ - goto __pyx_L5; - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":66 - * S += (4 * y) - * else: - * S += (2 * y) # <<<<<<<<<<<<<< - * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y - * S = S/ (ub_t-lb_t) - */ - __Pyx_TraceLine(66,1,__PYX_ERR(3, 66, __pyx_L1_error)) - /*else*/ { - __pyx_v_S = (__pyx_v_S + (2.0 * __pyx_v_y)); - } - __pyx_L5:; - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":67 - * else: - * S += (2 * y) - * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y # <<<<<<<<<<<<<< - * S = S/ (ub_t-lb_t) - * - */ - __Pyx_TraceLine(67,1,__PYX_ERR(3, 67, __pyx_L1_error)) - __pyx_v_S = (__pyx_v_S - __pyx_v_y); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":68 - * S += (2 * y) - * S = S - y #the last term should be f(b) and not 2*f(b) so we subtract y - * S = S/ (ub_t-lb_t) # <<<<<<<<<<<<<< - * - * return (ht * S / 3) - */ - __Pyx_TraceLine(68,1,__PYX_ERR(3, 68, __pyx_L1_error)) - __pyx_v_S = (__pyx_v_S / (__pyx_v_ub_t - __pyx_v_lb_t)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":70 - * S = S/ (ub_t-lb_t) - * - * return (ht * S / 3) # <<<<<<<<<<<<<< - * - * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, - */ - __Pyx_TraceLine(70,1,__PYX_ERR(3, 70, __pyx_L1_error)) - __pyx_r = ((__pyx_v_ht * __pyx_v_S) / 3.0); - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 - * return ((ht+hz) * S / 3) - * - * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< - * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" - * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.simpson_2D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 - * return (ht * S / 3) - * - * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< - * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, - * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: - */ - -static double __pyx_f_4wfpt_adaptiveSimpsonsAux(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_pdf_err, double __pyx_v_lb_z, double __pyx_v_ub_z, double __pyx_v_lb_t, double __pyx_v_ub_t, double __pyx_v_ZT, double __pyx_v_simps_err, double __pyx_v_S, double __pyx_v_f_beg, double __pyx_v_f_end, double __pyx_v_f_mid, int __pyx_v_bottom) { - double __pyx_v_z_c; - double __pyx_v_z_d; - double __pyx_v_z_e; - double __pyx_v_t_c; - double __pyx_v_t_d; - double __pyx_v_t_e; - double __pyx_v_h; - double __pyx_v_fd; - double __pyx_v_fe; - double __pyx_v_Sleft; - double __pyx_v_Sright; - double __pyx_v_S2; - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - double __pyx_t_2; - int __pyx_t_3; - double __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("adaptiveSimpsonsAux", 1); - __Pyx_TraceCall("adaptiveSimpsonsAux", __pyx_f[3], 72, 1, __PYX_ERR(3, 72, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":81 - * #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) - * - * if (ub_t-lb_t) == 0: #integration over sz # <<<<<<<<<<<<<< - * h = ub_z - lb_z - * z_c = (ub_z + lb_z)/2. - */ - __Pyx_TraceLine(81,1,__PYX_ERR(3, 81, __pyx_L1_error)) - __pyx_t_1 = ((__pyx_v_ub_t - __pyx_v_lb_t) == 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":82 - * - * if (ub_t-lb_t) == 0: #integration over sz - * h = ub_z - lb_z # <<<<<<<<<<<<<< - * z_c = (ub_z + lb_z)/2. - * z_d = (lb_z + z_c)/2. - */ - __Pyx_TraceLine(82,1,__PYX_ERR(3, 82, __pyx_L1_error)) - __pyx_v_h = (__pyx_v_ub_z - __pyx_v_lb_z); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":83 - * if (ub_t-lb_t) == 0: #integration over sz - * h = ub_z - lb_z - * z_c = (ub_z + lb_z)/2. # <<<<<<<<<<<<<< - * z_d = (lb_z + z_c)/2. - * z_e = (z_c + ub_z)/2. - */ - __Pyx_TraceLine(83,1,__PYX_ERR(3, 83, __pyx_L1_error)) - __pyx_v_z_c = ((__pyx_v_ub_z + __pyx_v_lb_z) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":84 - * h = ub_z - lb_z - * z_c = (ub_z + lb_z)/2. - * z_d = (lb_z + z_c)/2. # <<<<<<<<<<<<<< - * z_e = (z_c + ub_z)/2. - * t_c = t - */ - __Pyx_TraceLine(84,1,__PYX_ERR(3, 84, __pyx_L1_error)) - __pyx_v_z_d = ((__pyx_v_lb_z + __pyx_v_z_c) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":85 - * z_c = (ub_z + lb_z)/2. - * z_d = (lb_z + z_c)/2. - * z_e = (z_c + ub_z)/2. # <<<<<<<<<<<<<< - * t_c = t - * t_d = t - */ - __Pyx_TraceLine(85,1,__PYX_ERR(3, 85, __pyx_L1_error)) - __pyx_v_z_e = ((__pyx_v_z_c + __pyx_v_ub_z) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":86 - * z_d = (lb_z + z_c)/2. - * z_e = (z_c + ub_z)/2. - * t_c = t # <<<<<<<<<<<<<< - * t_d = t - * t_e = t - */ - __Pyx_TraceLine(86,1,__PYX_ERR(3, 86, __pyx_L1_error)) - __pyx_v_t_c = __pyx_v_t; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":87 - * z_e = (z_c + ub_z)/2. - * t_c = t - * t_d = t # <<<<<<<<<<<<<< - * t_e = t - * - */ - __Pyx_TraceLine(87,1,__PYX_ERR(3, 87, __pyx_L1_error)) - __pyx_v_t_d = __pyx_v_t; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":88 - * t_c = t - * t_d = t - * t_e = t # <<<<<<<<<<<<<< - * - * else: #integration over t - */ - __Pyx_TraceLine(88,1,__PYX_ERR(3, 88, __pyx_L1_error)) - __pyx_v_t_e = __pyx_v_t; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":81 - * #print "in AdaptiveSimpsAux: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) - * - * if (ub_t-lb_t) == 0: #integration over sz # <<<<<<<<<<<<<< - * h = ub_z - lb_z - * z_c = (ub_z + lb_z)/2. - */ - goto __pyx_L3; - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":91 - * - * else: #integration over t - * h = ub_t - lb_t # <<<<<<<<<<<<<< - * t_c = (ub_t + lb_t)/2. - * t_d = (lb_t + t_c)/2. - */ - __Pyx_TraceLine(91,1,__PYX_ERR(3, 91, __pyx_L1_error)) - /*else*/ { - __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":92 - * else: #integration over t - * h = ub_t - lb_t - * t_c = (ub_t + lb_t)/2. # <<<<<<<<<<<<<< - * t_d = (lb_t + t_c)/2. - * t_e = (t_c + ub_t)/2. - */ - __Pyx_TraceLine(92,1,__PYX_ERR(3, 92, __pyx_L1_error)) - __pyx_v_t_c = ((__pyx_v_ub_t + __pyx_v_lb_t) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":93 - * h = ub_t - lb_t - * t_c = (ub_t + lb_t)/2. - * t_d = (lb_t + t_c)/2. # <<<<<<<<<<<<<< - * t_e = (t_c + ub_t)/2. - * z_c = z - */ - __Pyx_TraceLine(93,1,__PYX_ERR(3, 93, __pyx_L1_error)) - __pyx_v_t_d = ((__pyx_v_lb_t + __pyx_v_t_c) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":94 - * t_c = (ub_t + lb_t)/2. - * t_d = (lb_t + t_c)/2. - * t_e = (t_c + ub_t)/2. # <<<<<<<<<<<<<< - * z_c = z - * z_d = z - */ - __Pyx_TraceLine(94,1,__PYX_ERR(3, 94, __pyx_L1_error)) - __pyx_v_t_e = ((__pyx_v_t_c + __pyx_v_ub_t) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":95 - * t_d = (lb_t + t_c)/2. - * t_e = (t_c + ub_t)/2. - * z_c = z # <<<<<<<<<<<<<< - * z_d = z - * z_e = z - */ - __Pyx_TraceLine(95,1,__PYX_ERR(3, 95, __pyx_L1_error)) - __pyx_v_z_c = __pyx_v_z; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":96 - * t_e = (t_c + ub_t)/2. - * z_c = z - * z_d = z # <<<<<<<<<<<<<< - * z_e = z - * - */ - __Pyx_TraceLine(96,1,__PYX_ERR(3, 96, __pyx_L1_error)) - __pyx_v_z_d = __pyx_v_z; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":97 - * z_c = z - * z_d = z - * z_e = z # <<<<<<<<<<<<<< - * - * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT - */ - __Pyx_TraceLine(97,1,__PYX_ERR(3, 97, __pyx_L1_error)) - __pyx_v_z_e = __pyx_v_z; - } - __pyx_L3:; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":99 - * z_e = z - * - * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT # <<<<<<<<<<<<<< - * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT - * - */ - __Pyx_TraceLine(99,1,__PYX_ERR(3, 99, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_d), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_d, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 99, __pyx_L1_error) - __pyx_v_fd = (__pyx_t_2 / __pyx_v_ZT); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":100 - * - * fd = pdf_sv(x - t_d, v, sv, a, z_d, pdf_err)/ZT - * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT # <<<<<<<<<<<<<< - * - * Sleft = (h/12)*(f_beg + 4*fd + f_mid) - */ - __Pyx_TraceLine(100,1,__PYX_ERR(3, 100, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_t_e), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z_e, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 100, __pyx_L1_error) - __pyx_v_fe = (__pyx_t_2 / __pyx_v_ZT); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":102 - * fe = pdf_sv(x - t_e, v, sv, a, z_e, pdf_err)/ZT - * - * Sleft = (h/12)*(f_beg + 4*fd + f_mid) # <<<<<<<<<<<<<< - * Sright = (h/12)*(f_mid + 4*fe + f_end) - * S2 = Sleft + Sright - */ - __Pyx_TraceLine(102,1,__PYX_ERR(3, 102, __pyx_L1_error)) - __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_fd)) + __pyx_v_f_mid)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":103 - * - * Sleft = (h/12)*(f_beg + 4*fd + f_mid) - * Sright = (h/12)*(f_mid + 4*fe + f_end) # <<<<<<<<<<<<<< - * S2 = Sleft + Sright - * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): - */ - __Pyx_TraceLine(103,1,__PYX_ERR(3, 103, __pyx_L1_error)) - __pyx_v_Sright = ((__pyx_v_h / 12.0) * ((__pyx_v_f_mid + (4.0 * __pyx_v_fe)) + __pyx_v_f_end)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":104 - * Sleft = (h/12)*(f_beg + 4*fd + f_mid) - * Sright = (h/12)*(f_mid + 4*fe + f_end) - * S2 = Sleft + Sright # <<<<<<<<<<<<<< - * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): - * return S2 + (S2 - S)/15 - */ - __Pyx_TraceLine(104,1,__PYX_ERR(3, 104, __pyx_L1_error)) - __pyx_v_S2 = (__pyx_v_Sleft + __pyx_v_Sright); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":105 - * Sright = (h/12)*(f_mid + 4*fe + f_end) - * S2 = Sleft + Sright - * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): # <<<<<<<<<<<<<< - * return S2 + (S2 - S)/15 - * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - */ - __Pyx_TraceLine(105,1,__PYX_ERR(3, 105, __pyx_L1_error)) - __pyx_t_3 = (__pyx_v_bottom <= 0); - if (!__pyx_t_3) { - } else { - __pyx_t_1 = __pyx_t_3; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_3 = (fabs((__pyx_v_S2 - __pyx_v_S)) <= (15.0 * __pyx_v_simps_err)); - __pyx_t_1 = __pyx_t_3; - __pyx_L5_bool_binop_done:; - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":106 - * S2 = Sleft + Sright - * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): - * return S2 + (S2 - S)/15 # <<<<<<<<<<<<<< - * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, - */ - __Pyx_TraceLine(106,1,__PYX_ERR(3, 106, __pyx_L1_error)) - __pyx_r = (__pyx_v_S2 + ((__pyx_v_S2 - __pyx_v_S) / 15.0)); - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":105 - * Sright = (h/12)*(f_mid + 4*fe + f_end) - * S2 = Sleft + Sright - * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): # <<<<<<<<<<<<<< - * return S2 + (S2 - S)/15 - * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":107 - * if (bottom <= 0 or fabs(S2 - S) <= 15*simps_err): - * return S2 + (S2 - S)/15 - * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< - * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, - * Sleft, f_beg, f_mid, fd, bottom-1) + \ - */ - __Pyx_TraceLine(107,1,__PYX_ERR(3, 107, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_z_c, __pyx_v_lb_t, __pyx_v_t_c, __pyx_v_ZT, (__pyx_v_simps_err / 2.0), __pyx_v_Sleft, __pyx_v_f_beg, __pyx_v_f_mid, __pyx_v_fd, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 107, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":110 - * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, - * Sleft, f_beg, f_mid, fd, bottom-1) + \ - * adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< - * z_c, ub_z, t_c, ub_t, ZT, simps_err/2, - * Sright, f_mid, f_end, fe, bottom-1) - */ - __Pyx_TraceLine(110,1,__PYX_ERR(3, 110, __pyx_L1_error)) - __pyx_t_4 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_z_c, __pyx_v_ub_z, __pyx_v_t_c, __pyx_v_ub_t, __pyx_v_ZT, (__pyx_v_simps_err / 2.0), __pyx_v_Sright, __pyx_v_f_mid, __pyx_v_f_end, __pyx_v_fe, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_4 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 110, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":109 - * return adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - * lb_z, z_c, lb_t, t_c, ZT, simps_err/2, - * Sleft, f_beg, f_mid, fd, bottom-1) + \ # <<<<<<<<<<<<<< - * adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - * z_c, ub_z, t_c, ub_t, ZT, simps_err/2, - */ - __Pyx_TraceLine(109,1,__PYX_ERR(3, 109, __pyx_L1_error)) - __pyx_r = (__pyx_t_2 + __pyx_t_4); - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 - * return (ht * S / 3) - * - * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< - * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, - * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.adaptiveSimpsonsAux", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 - * Sright, f_mid, f_end, fe, bottom-1) - * - * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< - * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, - * double simps_err, int maxRecursionDepth) nogil: - */ - -static double __pyx_f_4wfpt_adaptiveSimpsons_1D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_pdf_err, double __pyx_v_lb_z, double __pyx_v_ub_z, double __pyx_v_lb_t, double __pyx_v_ub_t, double __pyx_v_simps_err, int __pyx_v_maxRecursionDepth) { - double __pyx_v_h; - double __pyx_v_ZT; - double __pyx_v_c_t; - double __pyx_v_c_z; - double __pyx_v_f_beg; - double __pyx_v_f_end; - double __pyx_v_f_mid; - double __pyx_v_S; - double __pyx_v_res; - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - double __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("adaptiveSimpsons_1D", 1); - __Pyx_TraceCall("adaptiveSimpsons_1D", __pyx_f[3], 114, 1, __PYX_ERR(3, 114, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":120 - * cdef double h - * - * if (ub_t - lb_t) == 0: #integration over z # <<<<<<<<<<<<<< - * lb_t = t - * ub_t = t - */ - __Pyx_TraceLine(120,1,__PYX_ERR(3, 120, __pyx_L1_error)) - __pyx_t_1 = ((__pyx_v_ub_t - __pyx_v_lb_t) == 0.0); - if (__pyx_t_1) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":121 - * - * if (ub_t - lb_t) == 0: #integration over z - * lb_t = t # <<<<<<<<<<<<<< - * ub_t = t - * h = ub_z - lb_z - */ - __Pyx_TraceLine(121,1,__PYX_ERR(3, 121, __pyx_L1_error)) - __pyx_v_lb_t = __pyx_v_t; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":122 - * if (ub_t - lb_t) == 0: #integration over z - * lb_t = t - * ub_t = t # <<<<<<<<<<<<<< - * h = ub_z - lb_z - * else: #integration over t - */ - __Pyx_TraceLine(122,1,__PYX_ERR(3, 122, __pyx_L1_error)) - __pyx_v_ub_t = __pyx_v_t; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":123 - * lb_t = t - * ub_t = t - * h = ub_z - lb_z # <<<<<<<<<<<<<< - * else: #integration over t - * h = (ub_t-lb_t) - */ - __Pyx_TraceLine(123,1,__PYX_ERR(3, 123, __pyx_L1_error)) - __pyx_v_h = (__pyx_v_ub_z - __pyx_v_lb_z); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":120 - * cdef double h - * - * if (ub_t - lb_t) == 0: #integration over z # <<<<<<<<<<<<<< - * lb_t = t - * ub_t = t - */ - goto __pyx_L3; - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":125 - * h = ub_z - lb_z - * else: #integration over t - * h = (ub_t-lb_t) # <<<<<<<<<<<<<< - * lb_z = z - * ub_z = z - */ - __Pyx_TraceLine(125,1,__PYX_ERR(3, 125, __pyx_L1_error)) - /*else*/ { - __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":126 - * else: #integration over t - * h = (ub_t-lb_t) - * lb_z = z # <<<<<<<<<<<<<< - * ub_z = z - * - */ - __Pyx_TraceLine(126,1,__PYX_ERR(3, 126, __pyx_L1_error)) - __pyx_v_lb_z = __pyx_v_z; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":127 - * h = (ub_t-lb_t) - * lb_z = z - * ub_z = z # <<<<<<<<<<<<<< - * - * cdef double ZT = h - */ - __Pyx_TraceLine(127,1,__PYX_ERR(3, 127, __pyx_L1_error)) - __pyx_v_ub_z = __pyx_v_z; - } - __pyx_L3:; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":129 - * ub_z = z - * - * cdef double ZT = h # <<<<<<<<<<<<<< - * cdef double c_t = (lb_t + ub_t)/2. - * cdef double c_z = (lb_z + ub_z)/2. - */ - __Pyx_TraceLine(129,1,__PYX_ERR(3, 129, __pyx_L1_error)) - __pyx_v_ZT = __pyx_v_h; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":130 - * - * cdef double ZT = h - * cdef double c_t = (lb_t + ub_t)/2. # <<<<<<<<<<<<<< - * cdef double c_z = (lb_z + ub_z)/2. - * - */ - __Pyx_TraceLine(130,1,__PYX_ERR(3, 130, __pyx_L1_error)) - __pyx_v_c_t = ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":131 - * cdef double ZT = h - * cdef double c_t = (lb_t + ub_t)/2. - * cdef double c_z = (lb_z + ub_z)/2. # <<<<<<<<<<<<<< - * - * cdef double f_beg, f_end, f_mid, S - */ - __Pyx_TraceLine(131,1,__PYX_ERR(3, 131, __pyx_L1_error)) - __pyx_v_c_z = ((__pyx_v_lb_z + __pyx_v_ub_z) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":134 - * - * cdef double f_beg, f_end, f_mid, S - * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT # <<<<<<<<<<<<<< - * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT - * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT - */ - __Pyx_TraceLine(134,1,__PYX_ERR(3, 134, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_lb_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_lb_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 134, __pyx_L1_error) - __pyx_v_f_beg = (__pyx_t_2 / __pyx_v_ZT); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":135 - * cdef double f_beg, f_end, f_mid, S - * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT - * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT # <<<<<<<<<<<<<< - * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT - * S = (h/6)*(f_beg + 4*f_mid + f_end) - */ - __Pyx_TraceLine(135,1,__PYX_ERR(3, 135, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_ub_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_ub_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 135, __pyx_L1_error) - __pyx_v_f_end = (__pyx_t_2 / __pyx_v_ZT); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":136 - * f_beg = pdf_sv(x - lb_t, v, sv, a, lb_z, pdf_err)/ZT - * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT - * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT # <<<<<<<<<<<<<< - * S = (h/6)*(f_beg + 4*f_mid + f_end) - * cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - */ - __Pyx_TraceLine(136,1,__PYX_ERR(3, 136, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_pdf_sv((__pyx_v_x - __pyx_v_c_t), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_c_z, __pyx_v_pdf_err); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 136, __pyx_L1_error) - __pyx_v_f_mid = (__pyx_t_2 / __pyx_v_ZT); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":137 - * f_end = pdf_sv(x - ub_t, v, sv, a, ub_z, pdf_err)/ZT - * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT - * S = (h/6)*(f_beg + 4*f_mid + f_end) # <<<<<<<<<<<<<< - * cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, - * lb_z, ub_z, lb_t, ub_t, ZT, simps_err, - */ - __Pyx_TraceLine(137,1,__PYX_ERR(3, 137, __pyx_L1_error)) - __pyx_v_S = ((__pyx_v_h / 6.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_f_mid)) + __pyx_v_f_end)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":138 - * f_mid = pdf_sv(x - c_t, v, sv, a, c_z, pdf_err)/ZT - * S = (h/6)*(f_beg + 4*f_mid + f_end) - * cdef double res = adaptiveSimpsonsAux(x, v, sv, a, z, t, pdf_err, # <<<<<<<<<<<<<< - * lb_z, ub_z, lb_t, ub_t, ZT, simps_err, - * S, f_beg, f_end, f_mid, maxRecursionDepth) - */ - __Pyx_TraceLine(138,1,__PYX_ERR(3, 138, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_adaptiveSimpsonsAux(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_ub_t, __pyx_v_ZT, __pyx_v_simps_err, __pyx_v_S, __pyx_v_f_beg, __pyx_v_f_end, __pyx_v_f_mid, __pyx_v_maxRecursionDepth); if (unlikely(__pyx_t_2 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 138, __pyx_L1_error) - __pyx_v_res = __pyx_t_2; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":141 - * lb_z, ub_z, lb_t, ub_t, ZT, simps_err, - * S, f_beg, f_end, f_mid, maxRecursionDepth) - * return res # <<<<<<<<<<<<<< - * - * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, - */ - __Pyx_TraceLine(141,1,__PYX_ERR(3, 141, __pyx_L1_error)) - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 - * Sright, f_mid, f_end, fe, bottom-1) - * - * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< - * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, - * double simps_err, int maxRecursionDepth) nogil: - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.adaptiveSimpsons_1D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 - * return res - * - * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< - * double a, double z, double t, double - * pdf_err, double err_1d, double lb_z, - */ - -static double __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_pdf_err, double __pyx_v_err_1d, double __pyx_v_lb_z, double __pyx_v_ub_z, double __pyx_v_lb_t, double __pyx_v_ub_t, double __pyx_v_st, double __pyx_v_err_2d, double __pyx_v_S, double __pyx_v_f_beg, double __pyx_v_f_end, double __pyx_v_f_mid, int __pyx_v_maxRecursionDepth_sz, int __pyx_v_bottom) { - double __pyx_v_fd; - double __pyx_v_fe; - double __pyx_v_Sleft; - double __pyx_v_Sright; - double __pyx_v_S2; - double __pyx_v_t_c; - double __pyx_v_t_d; - double __pyx_v_t_e; - double __pyx_v_h; - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - double __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - double __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("adaptiveSimpsonsAux_2D", 1); - __Pyx_TraceCall("adaptiveSimpsonsAux_2D", __pyx_f[3], 143, 1, __PYX_ERR(3, 143, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":156 - * #print "in AdaptiveSimpsAux_2D: lb_z: %f, ub_z: %f, lb_t %f, ub_t %f, f_beg: %f, f_end: %f, bottom: %d" % (lb_z, ub_z, lb_t, ub_t, f_beg, f_end, bottom) - * - * cdef double t_c = (ub_t + lb_t)/2. # <<<<<<<<<<<<<< - * cdef double t_d = (lb_t + t_c)/2. - * cdef double t_e = (t_c + ub_t)/2. - */ - __Pyx_TraceLine(156,1,__PYX_ERR(3, 156, __pyx_L1_error)) - __pyx_v_t_c = ((__pyx_v_ub_t + __pyx_v_lb_t) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":157 - * - * cdef double t_c = (ub_t + lb_t)/2. - * cdef double t_d = (lb_t + t_c)/2. # <<<<<<<<<<<<<< - * cdef double t_e = (t_c + ub_t)/2. - * cdef double h = ub_t - lb_t - */ - __Pyx_TraceLine(157,1,__PYX_ERR(3, 157, __pyx_L1_error)) - __pyx_v_t_d = ((__pyx_v_lb_t + __pyx_v_t_c) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":158 - * cdef double t_c = (ub_t + lb_t)/2. - * cdef double t_d = (lb_t + t_c)/2. - * cdef double t_e = (t_c + ub_t)/2. # <<<<<<<<<<<<<< - * cdef double h = ub_t - lb_t - * - */ - __Pyx_TraceLine(158,1,__PYX_ERR(3, 158, __pyx_L1_error)) - __pyx_v_t_e = ((__pyx_v_t_c + __pyx_v_ub_t) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":159 - * cdef double t_d = (lb_t + t_c)/2. - * cdef double t_e = (t_c + ub_t)/2. - * cdef double h = ub_t - lb_t # <<<<<<<<<<<<<< - * - * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, - */ - __Pyx_TraceLine(159,1,__PYX_ERR(3, 159, __pyx_L1_error)) - __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":161 - * cdef double h = ub_t - lb_t - * - * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, - */ - __Pyx_TraceLine(161,1,__PYX_ERR(3, 161, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_d, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 161, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":162 - * - * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< - * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st - */ - __Pyx_TraceLine(162,1,__PYX_ERR(3, 162, __pyx_L1_error)) - __pyx_v_fd = (__pyx_t_1 / __pyx_v_st); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":163 - * fd = adaptiveSimpsons_1D(x, v, sv, a, z, t_d, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * - */ - __Pyx_TraceLine(163,1,__PYX_ERR(3, 163, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t_e, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 163, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":164 - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * fe = adaptiveSimpsons_1D(x, v, sv, a, z, t_e, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< - * - * Sleft = (h/12)*(f_beg + 4*fd + f_mid) - */ - __Pyx_TraceLine(164,1,__PYX_ERR(3, 164, __pyx_L1_error)) - __pyx_v_fe = (__pyx_t_1 / __pyx_v_st); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":166 - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * - * Sleft = (h/12)*(f_beg + 4*fd + f_mid) # <<<<<<<<<<<<<< - * Sright = (h/12)*(f_mid + 4*fe + f_end) - * S2 = Sleft + Sright - */ - __Pyx_TraceLine(166,1,__PYX_ERR(3, 166, __pyx_L1_error)) - __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_fd)) + __pyx_v_f_mid)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":167 - * - * Sleft = (h/12)*(f_beg + 4*fd + f_mid) - * Sright = (h/12)*(f_mid + 4*fe + f_end) # <<<<<<<<<<<<<< - * S2 = Sleft + Sright - * - */ - __Pyx_TraceLine(167,1,__PYX_ERR(3, 167, __pyx_L1_error)) - __pyx_v_Sright = ((__pyx_v_h / 12.0) * ((__pyx_v_f_mid + (4.0 * __pyx_v_fe)) + __pyx_v_f_end)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":168 - * Sleft = (h/12)*(f_beg + 4*fd + f_mid) - * Sright = (h/12)*(f_mid + 4*fe + f_end) - * S2 = Sleft + Sright # <<<<<<<<<<<<<< - * - * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): - */ - __Pyx_TraceLine(168,1,__PYX_ERR(3, 168, __pyx_L1_error)) - __pyx_v_S2 = (__pyx_v_Sleft + __pyx_v_Sright); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":170 - * S2 = Sleft + Sright - * - * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): # <<<<<<<<<<<<<< - * return S2 + (S2 - S)/15; - * - */ - __Pyx_TraceLine(170,1,__PYX_ERR(3, 170, __pyx_L1_error)) - __pyx_t_3 = (__pyx_v_bottom <= 0); - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_3 = (fabs((__pyx_v_S2 - __pyx_v_S)) <= (15.0 * __pyx_v_err_2d)); - __pyx_t_2 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":171 - * - * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): - * return S2 + (S2 - S)/15; # <<<<<<<<<<<<<< - * - * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, - */ - __Pyx_TraceLine(171,1,__PYX_ERR(3, 171, __pyx_L1_error)) - __pyx_r = (__pyx_v_S2 + ((__pyx_v_S2 - __pyx_v_S) / 15.0)); - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":170 - * S2 = Sleft + Sright - * - * if (bottom <= 0 or fabs(S2 - S) <= 15*err_2d): # <<<<<<<<<<<<<< - * return S2 + (S2 - S)/15; - * - */ - } - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":173 - * return S2 + (S2 - S)/15; - * - * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< - * lb_z, ub_z, lb_t, t_c, st, err_2d/2, - * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ - */ - __Pyx_TraceLine(173,1,__PYX_ERR(3, 173, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_t_c, __pyx_v_st, (__pyx_v_err_2d / 2.0), __pyx_v_Sleft, __pyx_v_f_beg, __pyx_v_f_mid, __pyx_v_fd, __pyx_v_maxRecursionDepth_sz, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 173, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":176 - * lb_z, ub_z, lb_t, t_c, st, err_2d/2, - * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ - * adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< - * lb_z, ub_z, t_c, ub_t, st, err_2d/2, - * Sright, f_mid, f_end, fe, maxRecursionDepth_sz, bottom-1) - */ - __Pyx_TraceLine(176,1,__PYX_ERR(3, 176, __pyx_L1_error)) - __pyx_t_4 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_t_c, __pyx_v_ub_t, __pyx_v_st, (__pyx_v_err_2d / 2.0), __pyx_v_Sright, __pyx_v_f_mid, __pyx_v_f_end, __pyx_v_fe, __pyx_v_maxRecursionDepth_sz, (__pyx_v_bottom - 1)); if (unlikely(__pyx_t_4 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 176, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":175 - * return adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, - * lb_z, ub_z, lb_t, t_c, st, err_2d/2, - * Sleft, f_beg, f_mid, fd, maxRecursionDepth_sz, bottom-1) + \ # <<<<<<<<<<<<<< - * adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, - * lb_z, ub_z, t_c, ub_t, st, err_2d/2, - */ - __Pyx_TraceLine(175,1,__PYX_ERR(3, 175, __pyx_L1_error)) - __pyx_r = (__pyx_t_1 + __pyx_t_4); - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 - * return res - * - * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< - * double a, double z, double t, double - * pdf_err, double err_1d, double lb_z, - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.adaptiveSimpsonsAux_2D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 - * - * - * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< - * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, - * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: - */ - -static double __pyx_f_4wfpt_adaptiveSimpsons_2D(double __pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_t, double __pyx_v_pdf_err, double __pyx_v_lb_z, double __pyx_v_ub_z, double __pyx_v_lb_t, double __pyx_v_ub_t, double __pyx_v_simps_err, int __pyx_v_maxRecursionDepth_sz, int __pyx_v_maxRecursionDepth_st) { - double __pyx_v_h; - double __pyx_v_st; - CYTHON_UNUSED double __pyx_v_c_t; - CYTHON_UNUSED double __pyx_v_c_z; - double __pyx_v_f_beg; - double __pyx_v_f_end; - double __pyx_v_f_mid; - double __pyx_v_S; - double __pyx_v_err_1d; - double __pyx_v_err_2d; - double __pyx_v_res; - double __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - double __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("adaptiveSimpsons_2D", 1); - __Pyx_TraceCall("adaptiveSimpsons_2D", __pyx_f[3], 181, 1, __PYX_ERR(3, 181, __pyx_L1_error)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":185 - * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: - * - * cdef double h = (ub_t-lb_t) # <<<<<<<<<<<<<< - * - * cdef double st = (ub_t - lb_t) - */ - __Pyx_TraceLine(185,1,__PYX_ERR(3, 185, __pyx_L1_error)) - __pyx_v_h = (__pyx_v_ub_t - __pyx_v_lb_t); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":187 - * cdef double h = (ub_t-lb_t) - * - * cdef double st = (ub_t - lb_t) # <<<<<<<<<<<<<< - * cdef double c_t = (lb_t + ub_t)/2. - * cdef double c_z = (lb_z + ub_z)/2. - */ - __Pyx_TraceLine(187,1,__PYX_ERR(3, 187, __pyx_L1_error)) - __pyx_v_st = (__pyx_v_ub_t - __pyx_v_lb_t); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":188 - * - * cdef double st = (ub_t - lb_t) - * cdef double c_t = (lb_t + ub_t)/2. # <<<<<<<<<<<<<< - * cdef double c_z = (lb_z + ub_z)/2. - * - */ - __Pyx_TraceLine(188,1,__PYX_ERR(3, 188, __pyx_L1_error)) - __pyx_v_c_t = ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":189 - * cdef double st = (ub_t - lb_t) - * cdef double c_t = (lb_t + ub_t)/2. - * cdef double c_z = (lb_z + ub_z)/2. # <<<<<<<<<<<<<< - * - * cdef double f_beg, f_end, f_mid, S - */ - __Pyx_TraceLine(189,1,__PYX_ERR(3, 189, __pyx_L1_error)) - __pyx_v_c_z = ((__pyx_v_lb_z + __pyx_v_ub_z) / 2.); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":192 - * - * cdef double f_beg, f_end, f_mid, S - * cdef double err_1d = simps_err # <<<<<<<<<<<<<< - * cdef double err_2d = simps_err - * - */ - __Pyx_TraceLine(192,1,__PYX_ERR(3, 192, __pyx_L1_error)) - __pyx_v_err_1d = __pyx_v_simps_err; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":193 - * cdef double f_beg, f_end, f_mid, S - * cdef double err_1d = simps_err - * cdef double err_2d = simps_err # <<<<<<<<<<<<<< - * - * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, - */ - __Pyx_TraceLine(193,1,__PYX_ERR(3, 193, __pyx_L1_error)) - __pyx_v_err_2d = __pyx_v_simps_err; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":195 - * cdef double err_2d = simps_err - * - * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * - */ - __Pyx_TraceLine(195,1,__PYX_ERR(3, 195, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_lb_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 195, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":196 - * - * f_beg = adaptiveSimpsons_1D(x, v, sv, a, z, lb_t, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< - * - * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, - */ - __Pyx_TraceLine(196,1,__PYX_ERR(3, 196, __pyx_L1_error)) - __pyx_v_f_beg = (__pyx_t_1 / __pyx_v_st); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":198 - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * - * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, - */ - __Pyx_TraceLine(198,1,__PYX_ERR(3, 198, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_ub_t, __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 198, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":199 - * - * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< - * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st - */ - __Pyx_TraceLine(199,1,__PYX_ERR(3, 199, __pyx_L1_error)) - __pyx_v_f_end = (__pyx_t_1 / __pyx_v_st); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":200 - * f_end = adaptiveSimpsons_1D(x, v, sv, a, z, ub_t, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, # <<<<<<<<<<<<<< - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * S = (h/6)*(f_beg + 4*f_mid + f_end) - */ - __Pyx_TraceLine(200,1,__PYX_ERR(3, 200, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsons_1D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, ((__pyx_v_lb_t + __pyx_v_ub_t) / 2.0), __pyx_v_pdf_err, __pyx_v_lb_z, __pyx_v_ub_z, 0.0, 0.0, __pyx_v_err_1d, __pyx_v_maxRecursionDepth_sz); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 200, __pyx_L1_error) - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":201 - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st # <<<<<<<<<<<<<< - * S = (h/6)*(f_beg + 4*f_mid + f_end) - * cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, - */ - __Pyx_TraceLine(201,1,__PYX_ERR(3, 201, __pyx_L1_error)) - __pyx_v_f_mid = (__pyx_t_1 / __pyx_v_st); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":202 - * f_mid = adaptiveSimpsons_1D(x, v, sv, a, z, (lb_t+ub_t)/2, pdf_err, lb_z, ub_z, - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * S = (h/6)*(f_beg + 4*f_mid + f_end) # <<<<<<<<<<<<<< - * cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, - * lb_z, ub_z, lb_t, ub_t, st, err_2d, - */ - __Pyx_TraceLine(202,1,__PYX_ERR(3, 202, __pyx_L1_error)) - __pyx_v_S = ((__pyx_v_h / 6.0) * ((__pyx_v_f_beg + (4.0 * __pyx_v_f_mid)) + __pyx_v_f_end)); - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":203 - * 0, 0, err_1d, maxRecursionDepth_sz)/st - * S = (h/6)*(f_beg + 4*f_mid + f_end) - * cdef double res = adaptiveSimpsonsAux_2D(x, v, sv, a, z, t, pdf_err, err_1d, # <<<<<<<<<<<<<< - * lb_z, ub_z, lb_t, ub_t, st, err_2d, - * S, f_beg, f_end, f_mid, maxRecursionDepth_sz, maxRecursionDepth_st) - */ - __Pyx_TraceLine(203,1,__PYX_ERR(3, 203, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_4wfpt_adaptiveSimpsonsAux_2D(__pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_t, __pyx_v_pdf_err, __pyx_v_err_1d, __pyx_v_lb_z, __pyx_v_ub_z, __pyx_v_lb_t, __pyx_v_ub_t, __pyx_v_st, __pyx_v_err_2d, __pyx_v_S, __pyx_v_f_beg, __pyx_v_f_end, __pyx_v_f_mid, __pyx_v_maxRecursionDepth_sz, __pyx_v_maxRecursionDepth_st); if (unlikely(__pyx_t_1 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(3, 203, __pyx_L1_error) - __pyx_v_res = __pyx_t_1; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":206 - * lb_z, ub_z, lb_t, ub_t, st, err_2d, - * S, f_beg, f_end, f_mid, maxRecursionDepth_sz, maxRecursionDepth_st) - * return res # <<<<<<<<<<<<<< - */ - __Pyx_TraceLine(206,1,__PYX_ERR(3, 206, __pyx_L1_error)) - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 - * - * - * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< - * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, - * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: - */ - - /* function exit code */ - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_AddTraceback("wfpt.adaptiveSimpsons_2D", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 1); - __Pyx_RefNannyFinishContextNogil() - return __pyx_r; -} - -/* "wfpt.pyx":32 - * include 'integrate.pxi' - * - * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< - * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, - * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_3pdf_array(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_2pdf_array, "pdf_array(ndarray x, double v, double sv, double a, double z, double sz, double t, double st, double err=1e-4, bool logp=0, int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_3pdf_array = {"pdf_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_3pdf_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_2pdf_array}; -static PyObject *__pyx_pw_4wfpt_3pdf_array(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - double __pyx_v_v; - double __pyx_v_sv; - double __pyx_v_a; - double __pyx_v_z; - double __pyx_v_sz; - double __pyx_v_t; - double __pyx_v_st; - double __pyx_v_err; - int __pyx_v_logp; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pdf_array (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 32, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_logp,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 1); __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 2); __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 3); __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 4); __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 5); __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 6); __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, 7); __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err); - if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_logp); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pdf_array") < 0)) __PYX_ERR(0, 32, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_v = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) - if (values[8]) { - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) - } else { - __pyx_v_err = ((double)((double)1e-4)); - } - if (values[9]) { - __pyx_v_logp = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_logp == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) - } else { - __pyx_v_logp = ((int)((int)0)); - } - if (values[10]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)2)); - } - if (values[11]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)2)); - } - if (values[12]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[13]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-3)); - } - if (values[14]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[15]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pdf_array", 0, 8, 16, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.pdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 32, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_2pdf_array(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_logp, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_2pdf_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_logp, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - PyArrayObject *__pyx_v_y = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_y; - __Pyx_Buffer __pyx_pybuffer_y; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyArrayObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - double __pyx_t_12; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_13; - int __pyx_t_14; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - int __pyx_t_18; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__4) - __Pyx_RefNannySetupContext("pdf_array", 0); - __Pyx_TraceCall("pdf_array", __pyx_f[0], 32, 0, __PYX_ERR(0, 32, __pyx_L1_error)); - __pyx_pybuffer_y.pybuffer.buf = NULL; - __pyx_pybuffer_y.refcount = 0; - __pyx_pybuffernd_y.data = NULL; - __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 32, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":36 - * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - * - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) - */ - __Pyx_TraceLine(36,0,__PYX_ERR(0, 36, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":38 - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t i - * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< - * - * for i in prange(size, nogil=True): - */ - __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 38, __pyx_L1_error) - __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 38, __pyx_L1_error) - } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_7 = 0; - __pyx_v_y = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; - - /* "wfpt.pyx":40 - * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) - * - * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< - * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error)) - { - #ifdef WITH_THREAD - PyThreadState *_save; - _save = NULL; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { - __pyx_t_8 = __pyx_v_size; - { - Py_ssize_t __pyx_parallel_temp0 = ((Py_ssize_t)0xbad0bad0); - const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0; - PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL; - int __pyx_parallel_why; - __pyx_parallel_why = 0; - #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) - #undef likely - #undef unlikely - #define likely(x) (x) - #define unlikely(x) (x) - #endif - __pyx_t_10 = (__pyx_t_8 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_10 > 0) - { - #ifdef _OPENMP - #pragma omp parallel private(__pyx_t_11, __pyx_t_12, __pyx_t_13) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) - #endif /* _OPENMP */ - { - #ifdef _OPENMP - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - Py_BEGIN_ALLOW_THREADS - #endif /* _OPENMP */ - #ifdef _OPENMP - #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) - #endif /* _OPENMP */ - for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_10; __pyx_t_9++){ - if (__pyx_parallel_why < 2) - { - __pyx_v_i = (Py_ssize_t)(0 + 1 * __pyx_t_9); - - /* "wfpt.pyx":41 - * - * for i in prange(size, nogil=True): - * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< - * n_st, n_sz, use_adaptive, simps_err) - * - */ - __Pyx_TraceLine(41,1,__PYX_ERR(0, 41, __pyx_L8_error)) - __pyx_t_11 = __pyx_v_i; - - /* "wfpt.pyx":42 - * for i in prange(size, nogil=True): - * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< - * - * y = y * (1 - p_outlier) + (w_outlier * p_outlier) - */ - __Pyx_TraceLine(42,1,__PYX_ERR(0, 42, __pyx_L8_error)) - __pyx_t_13.__pyx_n = 4; - __pyx_t_13.n_st = __pyx_v_n_st; - __pyx_t_13.n_sz = __pyx_v_n_sz; - __pyx_t_13.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_13.simps_err = __pyx_v_simps_err; - __pyx_t_12 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_13); if (unlikely(__pyx_t_12 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 41, __pyx_L8_error) - - /* "wfpt.pyx":41 - * - * for i in prange(size, nogil=True): - * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< - * n_st, n_sz, use_adaptive, simps_err) - * - */ - __Pyx_TraceLine(41,1,__PYX_ERR(0, 41, __pyx_L8_error)) - __pyx_t_11 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_12; - goto __pyx_L11; - __pyx_L8_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - #ifdef _OPENMP - #pragma omp flush(__pyx_parallel_exc_type) - #endif /* _OPENMP */ - if (!__pyx_parallel_exc_type) { - __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb); - __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno; - __Pyx_GOTREF(__pyx_parallel_exc_type); - } - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_parallel_why = 4; - goto __pyx_L10; - __pyx_L10:; - #ifdef _OPENMP - #pragma omp critical(__pyx_parallel_lastprivates0) - #endif /* _OPENMP */ - { - __pyx_parallel_temp0 = __pyx_v_i; - } - __pyx_L11:; - #ifdef _OPENMP - #pragma omp flush(__pyx_parallel_why) - #endif /* _OPENMP */ - } - } - #ifdef _OPENMP - Py_END_ALLOW_THREADS - #else -{ -#ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - #endif /* _OPENMP */ - /* Clean up any temporaries */ - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - #ifndef _OPENMP -} -#endif /* _OPENMP */ - } - } - if (__pyx_parallel_exc_type) { - /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */ - __pyx_parallel_why = 4; - } - if (__pyx_parallel_why) { - __pyx_v_i = __pyx_parallel_temp0; - switch (__pyx_parallel_why) { - case 4: - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_GIVEREF(__pyx_parallel_exc_type); - __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); - __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - } - goto __pyx_L4_error; - } - } - } - #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) - #undef likely - #undef unlikely - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #endif - } - - /* "wfpt.pyx":40 - * cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) - * - * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< - * y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(40,1,__PYX_ERR(0, 40, __pyx_L4_error)) - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L4_error: { - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L1_error; - } - __pyx_L5:; - } - } - - /* "wfpt.pyx":44 - * n_st, n_sz, use_adaptive, simps_err) - * - * y = y * (1 - p_outlier) + (w_outlier * p_outlier) # <<<<<<<<<<<<<< - * if logp == 1: - * return np.log(y) - */ - __Pyx_TraceLine(44,0,__PYX_ERR(0, 44, __pyx_L1_error)) - __pyx_t_6 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_y), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 44, __pyx_L1_error) - __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); - __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_14 < 0)) { - PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); - } - __pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0; - } - __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 44, __pyx_L1_error) - } - __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "wfpt.pyx":45 - * - * y = y * (1 - p_outlier) + (w_outlier * p_outlier) - * if logp == 1: # <<<<<<<<<<<<<< - * return np.log(y) - * else: - */ - __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error)) - __pyx_t_18 = (__pyx_v_logp == 1); - if (__pyx_t_18) { - - /* "wfpt.pyx":46 - * y = y * (1 - p_outlier) + (w_outlier * p_outlier) - * if logp == 1: - * return np.log(y) # <<<<<<<<<<<<<< - * else: - * return y - */ - __Pyx_TraceLine(46,0,__PYX_ERR(0, 46, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_14 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_14 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_y)}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":45 - * - * y = y * (1 - p_outlier) + (w_outlier * p_outlier) - * if logp == 1: # <<<<<<<<<<<<<< - * return np.log(y) - * else: - */ - } - - /* "wfpt.pyx":48 - * return np.log(y) - * else: - * return y # <<<<<<<<<<<<<< - * - * cdef inline bint p_outlier_in_range(double p_outlier): - */ - __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error)) - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF((PyObject *)__pyx_v_y); - __pyx_r = ((PyObject *)__pyx_v_y); - goto __pyx_L0; - } - - /* "wfpt.pyx":32 - * include 'integrate.pxi' - * - * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< - * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, - * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.pdf_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_y); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":50 - * return y - * - * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< - * return (p_outlier >= 0) & (p_outlier <= 1) - * - */ - -static CYTHON_INLINE int __pyx_f_4wfpt_p_outlier_in_range(double __pyx_v_p_outlier) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("p_outlier_in_range", 0); - __Pyx_TraceCall("p_outlier_in_range", __pyx_f[0], 50, 0, __PYX_ERR(0, 50, __pyx_L1_error)); - - /* "wfpt.pyx":51 - * - * cdef inline bint p_outlier_in_range(double p_outlier): - * return (p_outlier >= 0) & (p_outlier <= 1) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error)) - __pyx_r = ((__pyx_v_p_outlier >= 0.0) & (__pyx_v_p_outlier <= 1.0)); - goto __pyx_L0; - - /* "wfpt.pyx":50 - * return y - * - * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< - * return (p_outlier >= 0) & (p_outlier <= 1) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("wfpt.p_outlier_in_range", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":54 - * - * - * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0.1): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_5wiener_like(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_4wiener_like, "wiener_like(ndarray x, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0.1)"); -static PyMethodDef __pyx_mdef_4wfpt_5wiener_like = {"wiener_like", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_5wiener_like, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_4wiener_like}; -static PyObject *__pyx_pw_4wfpt_5wiener_like(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - double __pyx_v_v; - double __pyx_v_sv; - double __pyx_v_a; - double __pyx_v_z; - double __pyx_v_sz; - double __pyx_v_t; - double __pyx_v_st; - double __pyx_v_err; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 54, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 1); __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 2); __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 3); __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 4); __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 5); __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 6); __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 7); __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, 8); __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like") < 0)) __PYX_ERR(0, 54, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_v = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) - if (values[9]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)10)); - } - if (values[10]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)10)); - } - if (values[11]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[12]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-8)); - } - if (values[13]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[14]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.1)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like", 0, 9, 15, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_4wiener_like(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_4wiener_like(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - double __pyx_v_p; - double __pyx_v_sum_logp; - double __pyx_v_wp_outlier; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - Py_ssize_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - double __pyx_t_10; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__5) - __Pyx_RefNannySetupContext("wiener_like", 0); - __Pyx_TraceCall("wiener_like", __pyx_f[0], 54, 0, __PYX_ERR(0, 54, __pyx_L1_error)); - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":57 - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0.1): - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef double p - */ - __Pyx_TraceLine(57,0,__PYX_ERR(0, 57, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":60 - * cdef Py_ssize_t i - * cdef double p - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef double wp_outlier = w_outlier * p_outlier - * - */ - __Pyx_TraceLine(60,0,__PYX_ERR(0, 60, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":61 - * cdef double p - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * - * if not p_outlier_in_range(p_outlier): - */ - __Pyx_TraceLine(61,0,__PYX_ERR(0, 61, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":63 - * cdef double wp_outlier = w_outlier * p_outlier - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(63,0,__PYX_ERR(0, 63, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) - __pyx_t_3 = (!__pyx_t_2); - if (__pyx_t_3) { - - /* "wfpt.pyx":64 - * - * if not p_outlier_in_range(p_outlier): - * return -np.inf # <<<<<<<<<<<<<< - * - * for i in range(size): - */ - __Pyx_TraceLine(64,0,__PYX_ERR(0, 64, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":63 - * cdef double wp_outlier = w_outlier * p_outlier - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":66 - * return -np.inf - * - * for i in range(size): # <<<<<<<<<<<<<< - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(66,0,__PYX_ERR(0, 66, __pyx_L1_error)) - __pyx_t_6 = __pyx_v_size; - __pyx_t_7 = __pyx_t_6; - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; - - /* "wfpt.pyx":67 - * - * for i in range(size): - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< - * n_st, n_sz, use_adaptive, simps_err) - * # If one probability = 0, the log sum will be -Inf - */ - __Pyx_TraceLine(67,0,__PYX_ERR(0, 67, __pyx_L1_error)) - __pyx_t_9 = __pyx_v_i; - - /* "wfpt.pyx":68 - * for i in range(size): - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier - */ - __Pyx_TraceLine(68,0,__PYX_ERR(0, 68, __pyx_L1_error)) - __pyx_t_11.__pyx_n = 4; - __pyx_t_11.n_st = __pyx_v_n_st; - __pyx_t_11.n_sz = __pyx_v_n_sz; - __pyx_t_11.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_11.simps_err = __pyx_v_simps_err; - __pyx_t_10 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_11); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) - __pyx_v_p = __pyx_t_10; - - /* "wfpt.pyx":70 - * n_st, n_sz, use_adaptive, simps_err) - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * if p == 0: - * return -np.inf - */ - __Pyx_TraceLine(70,0,__PYX_ERR(0, 70, __pyx_L1_error)) - __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - - /* "wfpt.pyx":71 - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(71,0,__PYX_ERR(0, 71, __pyx_L1_error)) - __pyx_t_3 = (__pyx_v_p == 0.0); - if (__pyx_t_3) { - - /* "wfpt.pyx":72 - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: - * return -np.inf # <<<<<<<<<<<<<< - * - * sum_logp += log(p) - */ - __Pyx_TraceLine(72,0,__PYX_ERR(0, 72, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":71 - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":74 - * return -np.inf - * - * sum_logp += log(p) # <<<<<<<<<<<<<< - * - * return sum_logp - */ - __Pyx_TraceLine(74,0,__PYX_ERR(0, 74, __pyx_L1_error)) - __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - } - - /* "wfpt.pyx":76 - * sum_logp += log(p) - * - * return sum_logp # <<<<<<<<<<<<<< - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, - */ - __Pyx_TraceLine(76,0,__PYX_ERR(0, 76, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":54 - * - * - * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0.1): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":78 - * return sum_logp - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_7wiener_like_multi(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_6wiener_like_multi, "wiener_like_multi(ndarray x, v, sv, a, z, sz, t, st, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_7wiener_like_multi = {"wiener_like_multi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_7wiener_like_multi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_6wiener_like_multi}; -static PyObject *__pyx_pw_4wfpt_7wiener_like_multi(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - PyObject *__pyx_v_v = 0; - PyObject *__pyx_v_sv = 0; - PyObject *__pyx_v_a = 0; - PyObject *__pyx_v_z = 0; - PyObject *__pyx_v_sz = 0; - PyObject *__pyx_v_t = 0; - PyObject *__pyx_v_st = 0; - double __pyx_v_err; - PyObject *__pyx_v_multi = 0; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_multi (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 78, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_multi,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 1); __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 2); __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 3); __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 4); __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 5); __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 6); __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 7); __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 8); __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_v = values[1]; - __pyx_v_sv = values[2]; - __pyx_v_a = values[3]; - __pyx_v_z = values[4]; - __pyx_v_sz = values[5]; - __pyx_v_t = values[6]; - __pyx_v_st = values[7]; - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) - __pyx_v_multi = values[9]; - if (values[10]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)10)); - } - if (values[11]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)10)); - } - if (values[12]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[13]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-3)); - } - if (values[14]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[15]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 78, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_6wiener_like_multi(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_6wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - double __pyx_v_p; - double __pyx_v_sum_logp; - double __pyx_v_wp_outlier; - PyObject *__pyx_v_params = NULL; - PyObject *__pyx_v_params_iter = NULL; - PyObject *__pyx_v_param = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - int __pyx_t_2; - double __pyx_t_3; - double __pyx_t_4; - double __pyx_t_5; - double __pyx_t_6; - double __pyx_t_7; - double __pyx_t_8; - double __pyx_t_9; - double __pyx_t_10; - double __pyx_t_11; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - int __pyx_t_15; - Py_ssize_t __pyx_t_16; - Py_ssize_t __pyx_t_17; - Py_ssize_t __pyx_t_18; - Py_ssize_t __pyx_t_19; - PyObject *(*__pyx_t_20)(PyObject *); - Py_ssize_t __pyx_t_21; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_22; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__6) - __Pyx_RefNannySetupContext("wiener_like_multi", 0); - __Pyx_TraceCall("wiener_like_multi", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error)); - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":81 - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef double p = 0 - */ - __Pyx_TraceLine(81,0,__PYX_ERR(0, 81, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":83 - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t i - * cdef double p = 0 # <<<<<<<<<<<<<< - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier - */ - __Pyx_TraceLine(83,0,__PYX_ERR(0, 83, __pyx_L1_error)) - __pyx_v_p = 0.0; - - /* "wfpt.pyx":84 - * cdef Py_ssize_t i - * cdef double p = 0 - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef double wp_outlier = w_outlier * p_outlier - * - */ - __Pyx_TraceLine(84,0,__PYX_ERR(0, 84, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":85 - * cdef double p = 0 - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * - * if multi is None: - */ - __Pyx_TraceLine(85,0,__PYX_ERR(0, 85, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":87 - * cdef double wp_outlier = w_outlier * p_outlier - * - * if multi is None: # <<<<<<<<<<<<<< - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - */ - __Pyx_TraceLine(87,0,__PYX_ERR(0, 87, __pyx_L1_error)) - __pyx_t_2 = (__pyx_v_multi == Py_None); - if (__pyx_t_2) { - - /* "wfpt.pyx":88 - * - * if multi is None: - * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} - */ - __Pyx_TraceLine(88,0,__PYX_ERR(0, 88, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_11 = __pyx_f_4wfpt_full_pdf(__pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_12 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_r = __pyx_t_12; - __pyx_t_12 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":87 - * cdef double wp_outlier = w_outlier * p_outlier - * - * if multi is None: # <<<<<<<<<<<<<< - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - */ - } - - /* "wfpt.pyx":90 - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} # <<<<<<<<<<<<<< - * params_iter = copy(params) - * for i in range(size): - */ - __Pyx_TraceLine(90,0,__PYX_ERR(0, 90, __pyx_L1_error)) - /*else*/ { - __pyx_t_12 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - __pyx_v_params = ((PyObject*)__pyx_t_12); - __pyx_t_12 = 0; - - /* "wfpt.pyx":91 - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} - * params_iter = copy(params) # <<<<<<<<<<<<<< - * for i in range(size): - * for param in multi: - */ - __Pyx_TraceLine(91,0,__PYX_ERR(0, 91, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = NULL; - __pyx_t_15 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_13))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_13, function); - __pyx_t_15 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_params}; - __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __pyx_v_params_iter = __pyx_t_12; - __pyx_t_12 = 0; - - /* "wfpt.pyx":92 - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} - * params_iter = copy(params) - * for i in range(size): # <<<<<<<<<<<<<< - * for param in multi: - * params_iter[param] = params[param][i] - */ - __Pyx_TraceLine(92,0,__PYX_ERR(0, 92, __pyx_L1_error)) - __pyx_t_16 = __pyx_v_size; - __pyx_t_17 = __pyx_t_16; - for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { - __pyx_v_i = __pyx_t_18; - - /* "wfpt.pyx":93 - * params_iter = copy(params) - * for i in range(size): - * for param in multi: # <<<<<<<<<<<<<< - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: - */ - __Pyx_TraceLine(93,0,__PYX_ERR(0, 93, __pyx_L1_error)) - if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { - __pyx_t_12 = __pyx_v_multi; __Pyx_INCREF(__pyx_t_12); __pyx_t_19 = 0; - __pyx_t_20 = NULL; - } else { - __pyx_t_19 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 93, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 93, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_20)) { - if (likely(PyList_CheckExact(__pyx_t_12))) { - if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_12)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 93, __pyx_L1_error) - #else - __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 93, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - #endif - } else { - if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_12)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 93, __pyx_L1_error) - #else - __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 93, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - #endif - } - } else { - __pyx_t_13 = __pyx_t_20(__pyx_t_12); - if (unlikely(!__pyx_t_13)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 93, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_13); - } - __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_13); - __pyx_t_13 = 0; - - /* "wfpt.pyx":94 - * for i in range(size): - * for param in multi: - * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< - * if abs(x[i]) != 999.: - * p = full_pdf(x[i], params_iter['v'], - */ - __Pyx_TraceLine(94,0,__PYX_ERR(0, 94, __pyx_L1_error)) - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_14) < 0))) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - - /* "wfpt.pyx":93 - * params_iter = copy(params) - * for i in range(size): - * for param in multi: # <<<<<<<<<<<<<< - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: - */ - __Pyx_TraceLine(93,0,__PYX_ERR(0, 93, __pyx_L1_error)) - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "wfpt.pyx":95 - * for param in multi: - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< - * p = full_pdf(x[i], params_iter['v'], - * params_iter['sv'], params_iter['a'], params_iter['z'], - */ - __Pyx_TraceLine(95,0,__PYX_ERR(0, 95, __pyx_L1_error)) - __pyx_t_21 = __pyx_v_i; - __pyx_t_2 = (fabs((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides))) != 999.); - if (__pyx_t_2) { - - /* "wfpt.pyx":96 - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: - * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter['t'], params_iter['st'], - */ - __Pyx_TraceLine(96,0,__PYX_ERR(0, 96, __pyx_L1_error)) - __pyx_t_21 = __pyx_v_i; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "wfpt.pyx":97 - * if abs(x[i]) != 999.: - * p = full_pdf(x[i], params_iter['v'], - * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< - * params_iter['sz'], params_iter['t'], params_iter['st'], - * err, n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(97,0,__PYX_ERR(0, 97, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "wfpt.pyx":98 - * p = full_pdf(x[i], params_iter['v'], - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter['t'], params_iter['st'], # <<<<<<<<<<<<<< - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier - */ - __Pyx_TraceLine(98,0,__PYX_ERR(0, 98, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "wfpt.pyx":96 - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: - * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter['t'], params_iter['st'], - */ - __Pyx_TraceLine(96,0,__PYX_ERR(0, 96, __pyx_L1_error)) - __pyx_t_22.__pyx_n = 4; - __pyx_t_22.n_st = __pyx_v_n_st; - __pyx_t_22.n_sz = __pyx_v_n_sz; - __pyx_t_22.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_22.simps_err = __pyx_v_simps_err; - __pyx_t_4 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5, __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) - __pyx_v_p = __pyx_t_4; - - /* "wfpt.pyx":100 - * params_iter['sz'], params_iter['t'], params_iter['st'], - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * elif x[i] == 999.: - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - */ - __Pyx_TraceLine(100,0,__PYX_ERR(0, 100, __pyx_L1_error)) - __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - - /* "wfpt.pyx":95 - * for param in multi: - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< - * p = full_pdf(x[i], params_iter['v'], - * params_iter['sv'], params_iter['a'], params_iter['z'], - */ - goto __pyx_L9; - } - - /* "wfpt.pyx":101 - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier - * elif x[i] == 999.: # <<<<<<<<<<<<<< - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * else: # x[i] == -999. - */ - __Pyx_TraceLine(101,0,__PYX_ERR(0, 101, __pyx_L1_error)) - __pyx_t_21 = __pyx_v_i; - __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)) == 999.); - if (__pyx_t_2) { - - /* "wfpt.pyx":102 - * p = p * (1 - p_outlier) + wp_outlier - * elif x[i] == 999.: - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< - * else: # x[i] == -999. - * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - */ - __Pyx_TraceLine(102,0,__PYX_ERR(0, 102, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_7 = __pyx_f_4wfpt_prob_ub(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) - __pyx_v_p = __pyx_t_7; - - /* "wfpt.pyx":101 - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier - * elif x[i] == 999.: # <<<<<<<<<<<<<< - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * else: # x[i] == -999. - */ - goto __pyx_L9; - } - - /* "wfpt.pyx":104 - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * else: # x[i] == -999. - * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< - * - * sum_logp += log(p) - */ - __Pyx_TraceLine(104,0,__PYX_ERR(0, 104, __pyx_L1_error)) - /*else*/ { - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_4 = __pyx_f_4wfpt_prob_ub(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) - __pyx_v_p = (1.0 - __pyx_t_4); - } - __pyx_L9:; - - /* "wfpt.pyx":106 - * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * - * sum_logp += log(p) # <<<<<<<<<<<<<< - * - * return sum_logp - */ - __Pyx_TraceLine(106,0,__PYX_ERR(0, 106, __pyx_L1_error)) - __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - } - - /* "wfpt.pyx":108 - * sum_logp += log(p) - * - * return sum_logp # <<<<<<<<<<<<<< - * - * def wiener_logp_array(np.ndarray[double, ndim=1] x, - */ - __Pyx_TraceLine(108,0,__PYX_ERR(0, 108, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_r = __pyx_t_12; - __pyx_t_12 = 0; - goto __pyx_L0; - } - - /* "wfpt.pyx":78 - * return sum_logp - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_14); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF(__pyx_v_params); - __Pyx_XDECREF(__pyx_v_params_iter); - __Pyx_XDECREF(__pyx_v_param); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":110 - * return sum_logp - * - * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] v, - * np.ndarray[double, ndim=1] sv, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_9wiener_logp_array(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_8wiener_logp_array, "wiener_logp_array(ndarray x, ndarray v, ndarray sv, ndarray a, ndarray z, ndarray sz, ndarray t, ndarray st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0.1)"); -static PyMethodDef __pyx_mdef_4wfpt_9wiener_logp_array = {"wiener_logp_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_9wiener_logp_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_8wiener_logp_array}; -static PyObject *__pyx_pw_4wfpt_9wiener_logp_array(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_v = 0; - PyArrayObject *__pyx_v_sv = 0; - PyArrayObject *__pyx_v_a = 0; - PyArrayObject *__pyx_v_z = 0; - PyArrayObject *__pyx_v_sz = 0; - PyArrayObject *__pyx_v_t = 0; - PyArrayObject *__pyx_v_st = 0; - double __pyx_v_err; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_logp_array (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 110, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 1); __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 2); __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 3); __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 4); __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 5); __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 6); __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 7); __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, 8); __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_logp_array") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_v = ((PyArrayObject *)values[1]); - __pyx_v_sv = ((PyArrayObject *)values[2]); - __pyx_v_a = ((PyArrayObject *)values[3]); - __pyx_v_z = ((PyArrayObject *)values[4]); - __pyx_v_sz = ((PyArrayObject *)values[5]); - __pyx_v_t = ((PyArrayObject *)values[6]); - __pyx_v_st = ((PyArrayObject *)values[7]); - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) - if (values[9]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)10)); - } - if (values[10]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)10)); - } - if (values[11]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[12]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-8)); - } - if (values[13]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[14]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.1)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_logp_array", 0, 9, 15, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_logp_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 110, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 111, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv), __pyx_ptype_5numpy_ndarray, 1, "sv", 0))) __PYX_ERR(0, 112, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 113, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 114, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sz), __pyx_ptype_5numpy_ndarray, 1, "sz", 0))) __PYX_ERR(0, 115, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_t), __pyx_ptype_5numpy_ndarray, 1, "t", 0))) __PYX_ERR(0, 116, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_st), __pyx_ptype_5numpy_ndarray, 1, "st", 0))) __PYX_ERR(0, 117, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_8wiener_logp_array(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_8wiener_logp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_sv, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_z, PyArrayObject *__pyx_v_sz, PyArrayObject *__pyx_v_t, PyArrayObject *__pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - PyArrayObject *__pyx_v_logp = 0; - double __pyx_v_p; - double __pyx_v_wp_outlier; - __Pyx_LocalBuf_ND __pyx_pybuffernd_a; - __Pyx_Buffer __pyx_pybuffer_a; - __Pyx_LocalBuf_ND __pyx_pybuffernd_logp; - __Pyx_Buffer __pyx_pybuffer_logp; - __Pyx_LocalBuf_ND __pyx_pybuffernd_st; - __Pyx_Buffer __pyx_pybuffer_st; - __Pyx_LocalBuf_ND __pyx_pybuffernd_sv; - __Pyx_Buffer __pyx_pybuffer_sv; - __Pyx_LocalBuf_ND __pyx_pybuffernd_sz; - __Pyx_Buffer __pyx_pybuffer_sz; - __Pyx_LocalBuf_ND __pyx_pybuffernd_t; - __Pyx_Buffer __pyx_pybuffer_t; - __Pyx_LocalBuf_ND __pyx_pybuffernd_v; - __Pyx_Buffer __pyx_pybuffer_v; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_z; - __Pyx_Buffer __pyx_pybuffer_z; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyArrayObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - Py_ssize_t __pyx_t_12; - Py_ssize_t __pyx_t_13; - Py_ssize_t __pyx_t_14; - Py_ssize_t __pyx_t_15; - Py_ssize_t __pyx_t_16; - Py_ssize_t __pyx_t_17; - Py_ssize_t __pyx_t_18; - Py_ssize_t __pyx_t_19; - Py_ssize_t __pyx_t_20; - double __pyx_t_21; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_22; - int __pyx_t_23; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__7) - __Pyx_RefNannySetupContext("wiener_logp_array", 0); - __Pyx_TraceCall("wiener_logp_array", __pyx_f[0], 110, 0, __PYX_ERR(0, 110, __pyx_L1_error)); - __pyx_pybuffer_logp.pybuffer.buf = NULL; - __pyx_pybuffer_logp.refcount = 0; - __pyx_pybuffernd_logp.data = NULL; - __pyx_pybuffernd_logp.rcbuffer = &__pyx_pybuffer_logp; - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - __pyx_pybuffer_v.pybuffer.buf = NULL; - __pyx_pybuffer_v.refcount = 0; - __pyx_pybuffernd_v.data = NULL; - __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v; - __pyx_pybuffer_sv.pybuffer.buf = NULL; - __pyx_pybuffer_sv.refcount = 0; - __pyx_pybuffernd_sv.data = NULL; - __pyx_pybuffernd_sv.rcbuffer = &__pyx_pybuffer_sv; - __pyx_pybuffer_a.pybuffer.buf = NULL; - __pyx_pybuffer_a.refcount = 0; - __pyx_pybuffernd_a.data = NULL; - __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a; - __pyx_pybuffer_z.pybuffer.buf = NULL; - __pyx_pybuffer_z.refcount = 0; - __pyx_pybuffernd_z.data = NULL; - __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z; - __pyx_pybuffer_sz.pybuffer.buf = NULL; - __pyx_pybuffer_sz.refcount = 0; - __pyx_pybuffernd_sz.data = NULL; - __pyx_pybuffernd_sz.rcbuffer = &__pyx_pybuffer_sz; - __pyx_pybuffer_t.pybuffer.buf = NULL; - __pyx_pybuffer_t.refcount = 0; - __pyx_pybuffernd_t.data = NULL; - __pyx_pybuffernd_t.rcbuffer = &__pyx_pybuffer_t; - __pyx_pybuffer_st.pybuffer.buf = NULL; - __pyx_pybuffer_st.refcount = 0; - __pyx_pybuffernd_st.data = NULL; - __pyx_pybuffernd_st.rcbuffer = &__pyx_pybuffer_st; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - } - __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_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - } - __pyx_pybuffernd_sv.diminfo[0].strides = __pyx_pybuffernd_sv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv.diminfo[0].shape = __pyx_pybuffernd_sv.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - } - __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_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - } - __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sz.rcbuffer->pybuffer, (PyObject*)__pyx_v_sz, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - } - __pyx_pybuffernd_sz.diminfo[0].strides = __pyx_pybuffernd_sz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sz.diminfo[0].shape = __pyx_pybuffernd_sz.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t.rcbuffer->pybuffer, (PyObject*)__pyx_v_t, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - } - __pyx_pybuffernd_t.diminfo[0].strides = __pyx_pybuffernd_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t.diminfo[0].shape = __pyx_pybuffernd_t.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_st.rcbuffer->pybuffer, (PyObject*)__pyx_v_st, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - } - __pyx_pybuffernd_st.diminfo[0].strides = __pyx_pybuffernd_st.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_st.diminfo[0].shape = __pyx_pybuffernd_st.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":126 - * double w_outlier=0.1): - * - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) - */ - __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":128 - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t i - * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) # <<<<<<<<<<<<<< - * cdef double p - * cdef double wp_outlier = w_outlier * p_outlier - */ - __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 128, __pyx_L1_error) - __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_logp.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_logp = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 128, __pyx_L1_error) - } else {__pyx_pybuffernd_logp.diminfo[0].strides = __pyx_pybuffernd_logp.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_logp.diminfo[0].shape = __pyx_pybuffernd_logp.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_7 = 0; - __pyx_v_logp = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; - - /* "wfpt.pyx":130 - * cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) - * cdef double p - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * - * if not p_outlier_in_range(p_outlier): - */ - __Pyx_TraceLine(130,0,__PYX_ERR(0, 130, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":132 - * cdef double wp_outlier = w_outlier * p_outlier - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * logp[:] = -np.inf - * return logp - */ - __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error)) - __pyx_t_8 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) - __pyx_t_9 = (!__pyx_t_8); - if (__pyx_t_9) { - - /* "wfpt.pyx":133 - * - * if not p_outlier_in_range(p_outlier): - * logp[:] = -np.inf # <<<<<<<<<<<<<< - * return logp - * - */ - __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_logp), __pyx_slice__8, __pyx_t_6) < 0))) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "wfpt.pyx":134 - * if not p_outlier_in_range(p_outlier): - * logp[:] = -np.inf - * return logp # <<<<<<<<<<<<<< - * - * for i in range(size): - */ - __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF((PyObject *)__pyx_v_logp); - __pyx_r = ((PyObject *)__pyx_v_logp); - goto __pyx_L0; - - /* "wfpt.pyx":132 - * cdef double wp_outlier = w_outlier * p_outlier - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * logp[:] = -np.inf - * return logp - */ - } - - /* "wfpt.pyx":136 - * return logp - * - * for i in range(size): # <<<<<<<<<<<<<< - * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, - * n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error)) - __pyx_t_10 = __pyx_v_size; - __pyx_t_11 = __pyx_t_10; - for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { - __pyx_v_i = __pyx_t_12; - - /* "wfpt.pyx":137 - * - * for i in range(size): - * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, # <<<<<<<<<<<<<< - * n_st, n_sz, use_adaptive, simps_err) - * - */ - __Pyx_TraceLine(137,0,__PYX_ERR(0, 137, __pyx_L1_error)) - __pyx_t_13 = __pyx_v_i; - __pyx_t_14 = __pyx_v_i; - __pyx_t_15 = __pyx_v_i; - __pyx_t_16 = __pyx_v_i; - __pyx_t_17 = __pyx_v_i; - __pyx_t_18 = __pyx_v_i; - __pyx_t_19 = __pyx_v_i; - __pyx_t_20 = __pyx_v_i; - - /* "wfpt.pyx":138 - * for i in range(size): - * p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, - * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< - * - * # If one probability = 0, the log sum will be -Inf - */ - __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error)) - __pyx_t_22.__pyx_n = 4; - __pyx_t_22.n_st = __pyx_v_n_st; - __pyx_t_22.n_sz = __pyx_v_n_sz; - __pyx_t_22.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_22.simps_err = __pyx_v_simps_err; - __pyx_t_21 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sv.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_sv.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_z.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sz.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_sz.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_t.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_t.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_st.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_st.diminfo[0].strides)), __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_v_p = __pyx_t_21; - - /* "wfpt.pyx":141 - * - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * - * if p == 0: - */ - __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error)) - __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - - /* "wfpt.pyx":143 - * p = p * (1 - p_outlier) + wp_outlier - * - * if p == 0: # <<<<<<<<<<<<<< - * logp[i] = -np.inf - * else: - */ - __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error)) - __pyx_t_9 = (__pyx_v_p == 0.0); - if (__pyx_t_9) { - - /* "wfpt.pyx":144 - * - * if p == 0: - * logp[i] = -np.inf # <<<<<<<<<<<<<< - * else: - * logp[i] = np.log(p) - */ - __Pyx_TraceLine(144,0,__PYX_ERR(0, 144, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_20 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_logp.diminfo[0].strides) = __pyx_t_21; - - /* "wfpt.pyx":143 - * p = p * (1 - p_outlier) + wp_outlier - * - * if p == 0: # <<<<<<<<<<<<<< - * logp[i] = -np.inf - * else: - */ - goto __pyx_L6; - } - - /* "wfpt.pyx":146 - * logp[i] = -np.inf - * else: - * logp[i] = np.log(p) # <<<<<<<<<<<<<< - * - * return logp - */ - __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error)) - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_23 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_23 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_23, 1+__pyx_t_23); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_20 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_logp.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_logp.diminfo[0].strides) = __pyx_t_21; - } - __pyx_L6:; - } - - /* "wfpt.pyx":148 - * logp[i] = np.log(p) - * - * return logp # <<<<<<<<<<<<<< - * - * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, - */ - __Pyx_TraceLine(148,0,__PYX_ERR(0, 148, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF((PyObject *)__pyx_v_logp); - __pyx_r = ((PyObject *)__pyx_v_logp); - goto __pyx_L0; - - /* "wfpt.pyx":110 - * return sum_logp - * - * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] v, - * np.ndarray[double, ndim=1] sv, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_logp.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_st.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sv.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sz.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_logp_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_logp.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_st.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sv.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sz.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_logp); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":150 - * return logp - * - * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_11wiener_like_rlddm(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_10wiener_like_rlddm, "wiener_like_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double sv, double a, double z, double sz, double t, double st, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_11wiener_like_rlddm = {"wiener_like_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_11wiener_like_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_10wiener_like_rlddm}; -static PyObject *__pyx_pw_4wfpt_11wiener_like_rlddm(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_response = 0; - PyArrayObject *__pyx_v_feedback = 0; - PyArrayObject *__pyx_v_split_by = 0; - double __pyx_v_q; - double __pyx_v_alpha; - double __pyx_v_pos_alpha; - double __pyx_v_v; - double __pyx_v_sv; - double __pyx_v_a; - double __pyx_v_z; - double __pyx_v_sz; - double __pyx_v_t; - double __pyx_v_st; - double __pyx_v_err; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_rlddm (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 150, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_alpha,&__pyx_n_s_pos_alpha,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 21: values[20] = __Pyx_Arg_FASTCALL(__pyx_args, 20); - CYTHON_FALLTHROUGH; - case 20: values[19] = __Pyx_Arg_FASTCALL(__pyx_args, 19); - CYTHON_FALLTHROUGH; - case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18); - CYTHON_FALLTHROUGH; - case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); - CYTHON_FALLTHROUGH; - case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); - CYTHON_FALLTHROUGH; - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 1); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 2); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 3); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 4); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 5); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos_alpha)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 6); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 7); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 8); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 9); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[10]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 10); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[11]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 11); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[12]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 12); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[13]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 13); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (likely((values[14] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[14]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, 14); __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 16: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[16] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 17: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[17] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 18: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[18] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 19: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[19] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 20: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[20] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlddm") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 21: values[20] = __Pyx_Arg_FASTCALL(__pyx_args, 20); - CYTHON_FALLTHROUGH; - case 20: values[19] = __Pyx_Arg_FASTCALL(__pyx_args, 19); - CYTHON_FALLTHROUGH; - case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18); - CYTHON_FALLTHROUGH; - case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); - CYTHON_FALLTHROUGH; - case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); - CYTHON_FALLTHROUGH; - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_response = ((PyArrayObject *)values[1]); - __pyx_v_feedback = ((PyArrayObject *)values[2]); - __pyx_v_split_by = ((PyArrayObject *)values[3]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) - __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) - __pyx_v_pos_alpha = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_pos_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) - __pyx_v_v = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) - __pyx_v_err = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) - if (values[15]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)10)); - } - if (values[16]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)10)); - } - if (values[17]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[18]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[18]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-8)); - } - if (values[19]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[19]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[20]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[20]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_rlddm", 0, 15, 21, __pyx_nargs); __PYX_ERR(0, 150, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 150, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 151, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 152, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 153, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_10wiener_like_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_alpha, __pyx_v_pos_alpha, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_10wiener_like_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - CYTHON_UNUSED Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - Py_ssize_t __pyx_v_j; - Py_ssize_t __pyx_v_s_size; - int __pyx_v_s; - double __pyx_v_p; - double __pyx_v_sum_logp; - double __pyx_v_wp_outlier; - double __pyx_v_alfa; - double __pyx_v_pos_alfa; - PyArrayObject *__pyx_v_qs = 0; - PyArrayObject *__pyx_v_xs = 0; - PyArrayObject *__pyx_v_feedbacks = 0; - PyArrayObject *__pyx_v_responses = 0; - PyArrayObject *__pyx_v_unique = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; - __Pyx_Buffer __pyx_pybuffer_feedback; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedbacks; - __Pyx_Buffer __pyx_pybuffer_feedbacks; - __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; - __Pyx_Buffer __pyx_pybuffer_qs; - __Pyx_LocalBuf_ND __pyx_pybuffernd_response; - __Pyx_Buffer __pyx_pybuffer_response; - __Pyx_LocalBuf_ND __pyx_pybuffernd_responses; - __Pyx_Buffer __pyx_pybuffer_responses; - __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; - __Pyx_Buffer __pyx_pybuffer_split_by; - __Pyx_LocalBuf_ND __pyx_pybuffernd_unique; - __Pyx_Buffer __pyx_pybuffer_unique; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_xs; - __Pyx_Buffer __pyx_pybuffer_xs; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyArrayObject *__pyx_t_8 = NULL; - PyArrayObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - npy_intp __pyx_t_12; - npy_intp __pyx_t_13; - Py_ssize_t __pyx_t_14; - Py_ssize_t __pyx_t_15; - PyArrayObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyArrayObject *__pyx_t_20 = NULL; - PyArrayObject *__pyx_t_21 = NULL; - Py_ssize_t __pyx_t_22; - Py_ssize_t __pyx_t_23; - Py_ssize_t __pyx_t_24; - Py_ssize_t __pyx_t_25; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; - Py_ssize_t __pyx_t_29; - Py_ssize_t __pyx_t_30; - double __pyx_t_31; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_32; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__9) - __Pyx_RefNannySetupContext("wiener_like_rlddm", 0); - __Pyx_TraceCall("wiener_like_rlddm", __pyx_f[0], 150, 0, __PYX_ERR(0, 150, __pyx_L1_error)); - __pyx_pybuffer_qs.pybuffer.buf = NULL; - __pyx_pybuffer_qs.refcount = 0; - __pyx_pybuffernd_qs.data = NULL; - __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; - __pyx_pybuffer_xs.pybuffer.buf = NULL; - __pyx_pybuffer_xs.refcount = 0; - __pyx_pybuffernd_xs.data = NULL; - __pyx_pybuffernd_xs.rcbuffer = &__pyx_pybuffer_xs; - __pyx_pybuffer_feedbacks.pybuffer.buf = NULL; - __pyx_pybuffer_feedbacks.refcount = 0; - __pyx_pybuffernd_feedbacks.data = NULL; - __pyx_pybuffernd_feedbacks.rcbuffer = &__pyx_pybuffer_feedbacks; - __pyx_pybuffer_responses.pybuffer.buf = NULL; - __pyx_pybuffer_responses.refcount = 0; - __pyx_pybuffernd_responses.data = NULL; - __pyx_pybuffernd_responses.rcbuffer = &__pyx_pybuffer_responses; - __pyx_pybuffer_unique.pybuffer.buf = NULL; - __pyx_pybuffer_unique.refcount = 0; - __pyx_pybuffernd_unique.data = NULL; - __pyx_pybuffernd_unique.rcbuffer = &__pyx_pybuffer_unique; - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - __pyx_pybuffer_response.pybuffer.buf = NULL; - __pyx_pybuffer_response.refcount = 0; - __pyx_pybuffernd_response.data = NULL; - __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; - __pyx_pybuffer_feedback.pybuffer.buf = NULL; - __pyx_pybuffer_feedback.refcount = 0; - __pyx_pybuffernd_feedback.data = NULL; - __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; - __pyx_pybuffer_split_by.pybuffer.buf = NULL; - __pyx_pybuffer_split_by.refcount = 0; - __pyx_pybuffernd_split_by.data = NULL; - __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) - } - __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) - } - __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) - } - __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":158 - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i, j - * cdef Py_ssize_t s_size - */ - __Pyx_TraceLine(158,0,__PYX_ERR(0, 158, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":163 - * cdef int s - * cdef double p - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef double wp_outlier = w_outlier * p_outlier - * cdef double alfa - */ - __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":164 - * cdef double p - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * cdef double alfa - * cdef double pos_alfa - */ - __Pyx_TraceLine(164,0,__PYX_ERR(0, 164, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":167 - * cdef double alfa - * cdef double pos_alfa - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim=1] xs - * cdef np.ndarray[double, ndim=1] feedbacks - */ - __Pyx_TraceLine(167,0,__PYX_ERR(0, 167, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 167, __pyx_L1_error) - __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 167, __pyx_L1_error) - } else {__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_t_8 = 0; - __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":171 - * cdef np.ndarray[double, ndim=1] feedbacks - * cdef np.ndarray[long, ndim=1] responses - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< - * - * if not p_outlier_in_range(p_outlier): - */ - __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 171, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 171, __pyx_L1_error) - } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_9 = 0; - __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":173 - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error)) - __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_10); - if (__pyx_t_11) { - - /* "wfpt.pyx":174 - * - * if not p_outlier_in_range(p_outlier): - * return -np.inf # <<<<<<<<<<<<<< - * - * if pos_alpha==100.00: - */ - __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":173 - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":176 - * return -np.inf - * - * if pos_alpha==100.00: # <<<<<<<<<<<<<< - * pos_alfa = alpha - * else: - */ - __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error)) - __pyx_t_11 = (__pyx_v_pos_alpha == 100.00); - if (__pyx_t_11) { - - /* "wfpt.pyx":177 - * - * if pos_alpha==100.00: - * pos_alfa = alpha # <<<<<<<<<<<<<< - * else: - * pos_alfa = pos_alpha - */ - __Pyx_TraceLine(177,0,__PYX_ERR(0, 177, __pyx_L1_error)) - __pyx_v_pos_alfa = __pyx_v_alpha; - - /* "wfpt.pyx":176 - * return -np.inf - * - * if pos_alpha==100.00: # <<<<<<<<<<<<<< - * pos_alfa = alpha - * else: - */ - goto __pyx_L4; - } - - /* "wfpt.pyx":179 - * pos_alfa = alpha - * else: - * pos_alfa = pos_alpha # <<<<<<<<<<<<<< - * - * # unique represent # of conditions - */ - __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error)) - /*else*/ { - __pyx_v_pos_alfa = __pyx_v_pos_alpha; - } - __pyx_L4:; - - /* "wfpt.pyx":182 - * - * # unique represent # of conditions - * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< - * s = unique[j] - * # select trials for current condition, identified by the split_by-array - */ - __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error) - __pyx_t_12 = (__pyx_t_1[0]); - __pyx_t_13 = __pyx_t_12; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_j = __pyx_t_14; - - /* "wfpt.pyx":183 - * # unique represent # of conditions - * for j in range(unique.shape[0]): - * s = unique[j] # <<<<<<<<<<<<<< - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] - */ - __Pyx_TraceLine(183,0,__PYX_ERR(0, 183, __pyx_L1_error)) - __pyx_t_15 = __pyx_v_j; - __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_unique.diminfo[0].strides)); - - /* "wfpt.pyx":185 - * s = unique[j] - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< - * responses = response[split_by == s] - * xs = x[split_by == s] - */ - __Pyx_TraceLine(185,0,__PYX_ERR(0, 185, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 185, __pyx_L1_error) - __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedbacks, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_17, __pyx_t_18, __pyx_t_19); - } - __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; - } - __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) - } - __pyx_t_16 = 0; - __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "wfpt.pyx":186 - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] - * responses = response[split_by == s] # <<<<<<<<<<<<<< - * xs = x[split_by == s] - * s_size = xs.shape[0] - */ - __Pyx_TraceLine(186,0,__PYX_ERR(0, 186, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 186, __pyx_L1_error) - __pyx_t_20 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_19, __pyx_t_18, __pyx_t_17); - } - __pyx_t_19 = __pyx_t_18 = __pyx_t_17 = 0; - } - __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) - } - __pyx_t_20 = 0; - __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "wfpt.pyx":187 - * feedbacks = feedback[split_by == s] - * responses = response[split_by == s] - * xs = x[split_by == s] # <<<<<<<<<<<<<< - * s_size = xs.shape[0] - * qs[0] = q - */ - __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 187, __pyx_L1_error) - __pyx_t_21 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_17, __pyx_t_18, __pyx_t_19); - } - __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; - } - __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) - } - __pyx_t_21 = 0; - __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "wfpt.pyx":188 - * responses = response[split_by == s] - * xs = x[split_by == s] - * s_size = xs.shape[0] # <<<<<<<<<<<<<< - * qs[0] = q - * qs[1] = q - */ - __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) - __pyx_v_s_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":189 - * xs = x[split_by == s] - * s_size = xs.shape[0] - * qs[0] = q # <<<<<<<<<<<<<< - * qs[1] = q - * - */ - __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error)) - __pyx_t_15 = 0; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":190 - * s_size = xs.shape[0] - * qs[0] = q - * qs[1] = q # <<<<<<<<<<<<<< - * - * # don't calculate pdf for first trial but still update q - */ - __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error)) - __pyx_t_15 = 1; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":193 - * - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - __Pyx_TraceLine(193,0,__PYX_ERR(0, 193, __pyx_L1_error)) - __pyx_t_15 = 0; - __pyx_t_22 = 0; - __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); - __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides))); - if (__pyx_t_11) { - - /* "wfpt.pyx":194 - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses[0]]: - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< - * else: - * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) - */ - __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error)) - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - - /* "wfpt.pyx":193 - * - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - goto __pyx_L7; - } - - /* "wfpt.pyx":196 - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< - * - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - */ - __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error)) - /*else*/ { - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); - } - __pyx_L7:; - - /* "wfpt.pyx":200 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[0] - qs[responses[0]]) - * - */ - __Pyx_TraceLine(200,0,__PYX_ERR(0, 200, __pyx_L1_error)) - __pyx_t_22 = 0; - __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); - - /* "wfpt.pyx":201 - * # received on current trial. - * qs[responses[0]] = qs[responses[0]] + \ - * alfa * (feedbacks[0] - qs[responses[0]]) # <<<<<<<<<<<<<< - * - * # loop through all trials in current condition - */ - __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error)) - __pyx_t_15 = 0; - __pyx_t_24 = 0; - __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_responses.diminfo[0].strides)); - - /* "wfpt.pyx":200 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[0] - qs[responses[0]]) - * - */ - __Pyx_TraceLine(200,0,__PYX_ERR(0, 200, __pyx_L1_error)) - __pyx_t_26 = 0; - __pyx_t_27 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_responses.diminfo[0].strides)); - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides))))); - - /* "wfpt.pyx":204 - * - * # loop through all trials in current condition - * for i in range(1, s_size): # <<<<<<<<<<<<<< - * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, - * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error)) - __pyx_t_28 = __pyx_v_s_size; - __pyx_t_29 = __pyx_t_28; - for (__pyx_t_30 = 1; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) { - __pyx_v_i = __pyx_t_30; - - /* "wfpt.pyx":205 - * # loop through all trials in current condition - * for i in range(1, s_size): - * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, # <<<<<<<<<<<<<< - * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) - * # If one probability = 0, the log sum will be -Inf - */ - __Pyx_TraceLine(205,0,__PYX_ERR(0, 205, __pyx_L1_error)) - __pyx_t_24 = __pyx_v_i; - __pyx_t_25 = 1; - __pyx_t_15 = 0; - - /* "wfpt.pyx":206 - * for i in range(1, s_size): - * p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, - * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier - */ - __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error)) - __pyx_t_32.__pyx_n = 4; - __pyx_t_32.n_st = __pyx_v_n_st; - __pyx_t_32.n_sz = __pyx_v_n_sz; - __pyx_t_32.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_32.simps_err = __pyx_v_simps_err; - __pyx_t_31 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_xs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_xs.diminfo[0].strides)), (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v), __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_32); if (unlikely(__pyx_t_31 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error) - __pyx_v_p = __pyx_t_31; - - /* "wfpt.pyx":208 - * sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * if p == 0: - * return -np.inf - */ - __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error)) - __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - - /* "wfpt.pyx":209 - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: # <<<<<<<<<<<<<< - * return -np.inf - * sum_logp += log(p) - */ - __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error)) - __pyx_t_11 = (__pyx_v_p == 0.0); - if (__pyx_t_11) { - - /* "wfpt.pyx":210 - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: - * return -np.inf # <<<<<<<<<<<<<< - * sum_logp += log(p) - * - */ - __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":209 - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: # <<<<<<<<<<<<<< - * return -np.inf - * sum_logp += log(p) - */ - } - - /* "wfpt.pyx":211 - * if p == 0: - * return -np.inf - * sum_logp += log(p) # <<<<<<<<<<<<<< - * - * # get learning rate for current trial. if pos_alpha is not in - */ - __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error)) - __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - - /* "wfpt.pyx":216 - * # include it will be same as alpha so can still use this - * # calculation: - * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error)) - __pyx_t_15 = __pyx_v_i; - __pyx_t_25 = __pyx_v_i; - __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); - __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))); - if (__pyx_t_11) { - - /* "wfpt.pyx":217 - * # calculation: - * if feedbacks[i] > qs[responses[i]]: - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< - * else: - * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) - */ - __Pyx_TraceLine(217,0,__PYX_ERR(0, 217, __pyx_L1_error)) - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - - /* "wfpt.pyx":216 - * # include it will be same as alpha so can still use this - * # calculation: - * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - goto __pyx_L11; - } - - /* "wfpt.pyx":219 - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< - * - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - */ - __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error)) - /*else*/ { - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); - } - __pyx_L11:; - - /* "wfpt.pyx":223 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[i] - qs[responses[i]]) - * return sum_logp - */ - __Pyx_TraceLine(223,0,__PYX_ERR(0, 223, __pyx_L1_error)) - __pyx_t_25 = __pyx_v_i; - __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); - - /* "wfpt.pyx":224 - * # received on current trial. - * qs[responses[i]] = qs[responses[i]] + \ - * alfa * (feedbacks[i] - qs[responses[i]]) # <<<<<<<<<<<<<< - * return sum_logp - * - */ - __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error)) - __pyx_t_15 = __pyx_v_i; - __pyx_t_22 = __pyx_v_i; - __pyx_t_23 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_responses.diminfo[0].strides)); - - /* "wfpt.pyx":223 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[i] - qs[responses[i]]) - * return sum_logp - */ - __Pyx_TraceLine(223,0,__PYX_ERR(0, 223, __pyx_L1_error)) - __pyx_t_26 = __pyx_v_i; - __pyx_t_27 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_responses.diminfo[0].strides)); - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides))))); - } - } - - /* "wfpt.pyx":225 - * qs[responses[i]] = qs[responses[i]] + \ - * alfa * (feedbacks[i] - qs[responses[i]]) - * return sum_logp # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":150 - * return logp - * - * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_qs); - __Pyx_XDECREF((PyObject *)__pyx_v_xs); - __Pyx_XDECREF((PyObject *)__pyx_v_feedbacks); - __Pyx_XDECREF((PyObject *)__pyx_v_responses); - __Pyx_XDECREF((PyObject *)__pyx_v_unique); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":228 - * - * - * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] x, - * np.ndarray[long, ndim=1] response, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_13wiener_like_rlssm_nn(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_12wiener_like_rlssm_nn, "wiener_like_rlssm_nn(unicode model, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_ssm, ndarray params_rl, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); -static PyMethodDef __pyx_mdef_4wfpt_13wiener_like_rlssm_nn = {"wiener_like_rlssm_nn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_13wiener_like_rlssm_nn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_12wiener_like_rlssm_nn}; -static PyObject *__pyx_pw_4wfpt_13wiener_like_rlssm_nn(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - CYTHON_UNUSED PyObject *__pyx_v_model = 0; - PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_response = 0; - PyArrayObject *__pyx_v_feedback = 0; - PyArrayObject *__pyx_v_split_by = 0; - double __pyx_v_q; - PyArrayObject *__pyx_v_params_ssm = 0; - PyArrayObject *__pyx_v_params_rl = 0; - PyArrayObject *__pyx_v_params_bnds = 0; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - PyObject *__pyx_v_network = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_rlssm_nn (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 228, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_model,&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_params_ssm,&__pyx_n_s_params_rl,&__pyx_n_s_params_bnds,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; - - /* "wfpt.pyx":237 - * np.ndarray[double, ndim=1] params_rl, - * np.ndarray[double, ndim=2] params_bnds, - * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< - * - * cdef double v = params_ssm[0] - */ - values[11] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_model)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 1); __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 2); __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 3); __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 4); __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 5); __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_ssm)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 6); __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_rl)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 7); __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_bnds)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, 8); __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlssm_nn") < 0)) __PYX_ERR(0, 228, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_model = ((PyObject*)values[0]); - __pyx_v_x = ((PyArrayObject *)values[1]); - __pyx_v_response = ((PyArrayObject *)values[2]); - __pyx_v_feedback = ((PyArrayObject *)values[3]); - __pyx_v_split_by = ((PyArrayObject *)values[4]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L3_error) - __pyx_v_params_ssm = ((PyArrayObject *)values[6]); - __pyx_v_params_rl = ((PyArrayObject *)values[7]); - __pyx_v_params_bnds = ((PyArrayObject *)values[8]); - if (values[9]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[10]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - __pyx_v_network = values[11]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn", 0, 9, 12, __pyx_nargs); __PYX_ERR(0, 228, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model), (&PyUnicode_Type), 1, "model", 1))) __PYX_ERR(0, 228, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 229, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 230, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 231, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 232, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_ssm), __pyx_ptype_5numpy_ndarray, 1, "params_ssm", 0))) __PYX_ERR(0, 234, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_rl), __pyx_ptype_5numpy_ndarray, 1, "params_rl", 0))) __PYX_ERR(0, 235, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_bnds), __pyx_ptype_5numpy_ndarray, 1, "params_bnds", 0))) __PYX_ERR(0, 236, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_12wiener_like_rlssm_nn(__pyx_self, __pyx_v_model, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_ssm, __pyx_v_params_rl, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); - - /* "wfpt.pyx":228 - * - * - * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] x, - * np.ndarray[long, ndim=1] response, - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_12wiener_like_rlssm_nn(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_model, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_ssm, PyArrayObject *__pyx_v_params_rl, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { - double __pyx_v_v; - double __pyx_v_rl_alpha; - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - Py_ssize_t __pyx_v_j; - Py_ssize_t __pyx_v_i_p; - Py_ssize_t __pyx_v_s_size; - int __pyx_v_s; - CYTHON_UNUSED double __pyx_v_log_p; - double __pyx_v_sum_logp; - CYTHON_UNUSED double __pyx_v_wp_outlier; - double __pyx_v_alfa; - double __pyx_v_pos_alfa; - PyArrayObject *__pyx_v_qs = 0; - PyArrayObject *__pyx_v_xs = 0; - PyArrayObject *__pyx_v_feedbacks = 0; - PyArrayObject *__pyx_v_responses = 0; - PyArrayObject *__pyx_v_responses_qs = 0; - PyArrayObject *__pyx_v_unique = 0; - Py_ssize_t __pyx_v_n_params; - PyArrayObject *__pyx_v_data = 0; - float __pyx_v_ll_min; - int __pyx_v_cumm_s_size; - PyObject *__pyx_v_lower_bnd = NULL; - PyObject *__pyx_v_upper_bnd = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; - __Pyx_Buffer __pyx_pybuffer_feedback; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedbacks; - __Pyx_Buffer __pyx_pybuffer_feedbacks; - __Pyx_LocalBuf_ND __pyx_pybuffernd_params_bnds; - __Pyx_Buffer __pyx_pybuffer_params_bnds; - __Pyx_LocalBuf_ND __pyx_pybuffernd_params_rl; - __Pyx_Buffer __pyx_pybuffer_params_rl; - __Pyx_LocalBuf_ND __pyx_pybuffernd_params_ssm; - __Pyx_Buffer __pyx_pybuffer_params_ssm; - __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; - __Pyx_Buffer __pyx_pybuffer_qs; - __Pyx_LocalBuf_ND __pyx_pybuffernd_response; - __Pyx_Buffer __pyx_pybuffer_response; - __Pyx_LocalBuf_ND __pyx_pybuffernd_responses; - __Pyx_Buffer __pyx_pybuffer_responses; - __Pyx_LocalBuf_ND __pyx_pybuffernd_responses_qs; - __Pyx_Buffer __pyx_pybuffer_responses_qs; - __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; - __Pyx_Buffer __pyx_pybuffer_split_by; - __Pyx_LocalBuf_ND __pyx_pybuffernd_unique; - __Pyx_Buffer __pyx_pybuffer_unique; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_xs; - __Pyx_Buffer __pyx_pybuffer_xs; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - npy_intp *__pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - PyArrayObject *__pyx_t_9 = NULL; - PyArrayObject *__pyx_t_10 = NULL; - PyArrayObject *__pyx_t_11 = NULL; - int __pyx_t_12; - int __pyx_t_13; - Py_ssize_t __pyx_t_14; - PyObject *(*__pyx_t_15)(PyObject *); - Py_ssize_t __pyx_t_16; - npy_intp __pyx_t_17; - npy_intp __pyx_t_18; - PyArrayObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - PyObject *__pyx_t_21 = NULL; - PyObject *__pyx_t_22 = NULL; - PyArrayObject *__pyx_t_23 = NULL; - PyArrayObject *__pyx_t_24 = NULL; - Py_ssize_t __pyx_t_25; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; - Py_ssize_t __pyx_t_29; - Py_ssize_t __pyx_t_30; - Py_ssize_t __pyx_t_31; - Py_ssize_t __pyx_t_32; - PyObject *__pyx_t_33 = NULL; - PyObject *__pyx_t_34 = NULL; - double __pyx_t_35; - PyObject *__pyx_t_36 = NULL; - PyObject *__pyx_t_37 = NULL; - PyObject *__pyx_t_38 = NULL; - PyObject *__pyx_t_39 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__10) - __Pyx_RefNannySetupContext("wiener_like_rlssm_nn", 0); - __Pyx_TraceCall("wiener_like_rlssm_nn", __pyx_f[0], 228, 0, __PYX_ERR(0, 228, __pyx_L1_error)); - __pyx_pybuffer_qs.pybuffer.buf = NULL; - __pyx_pybuffer_qs.refcount = 0; - __pyx_pybuffernd_qs.data = NULL; - __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; - __pyx_pybuffer_xs.pybuffer.buf = NULL; - __pyx_pybuffer_xs.refcount = 0; - __pyx_pybuffernd_xs.data = NULL; - __pyx_pybuffernd_xs.rcbuffer = &__pyx_pybuffer_xs; - __pyx_pybuffer_feedbacks.pybuffer.buf = NULL; - __pyx_pybuffer_feedbacks.refcount = 0; - __pyx_pybuffernd_feedbacks.data = NULL; - __pyx_pybuffernd_feedbacks.rcbuffer = &__pyx_pybuffer_feedbacks; - __pyx_pybuffer_responses.pybuffer.buf = NULL; - __pyx_pybuffer_responses.refcount = 0; - __pyx_pybuffernd_responses.data = NULL; - __pyx_pybuffernd_responses.rcbuffer = &__pyx_pybuffer_responses; - __pyx_pybuffer_responses_qs.pybuffer.buf = NULL; - __pyx_pybuffer_responses_qs.refcount = 0; - __pyx_pybuffernd_responses_qs.data = NULL; - __pyx_pybuffernd_responses_qs.rcbuffer = &__pyx_pybuffer_responses_qs; - __pyx_pybuffer_unique.pybuffer.buf = NULL; - __pyx_pybuffer_unique.refcount = 0; - __pyx_pybuffernd_unique.data = NULL; - __pyx_pybuffernd_unique.rcbuffer = &__pyx_pybuffer_unique; - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - __pyx_pybuffer_response.pybuffer.buf = NULL; - __pyx_pybuffer_response.refcount = 0; - __pyx_pybuffernd_response.data = NULL; - __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; - __pyx_pybuffer_feedback.pybuffer.buf = NULL; - __pyx_pybuffer_feedback.refcount = 0; - __pyx_pybuffernd_feedback.data = NULL; - __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; - __pyx_pybuffer_split_by.pybuffer.buf = NULL; - __pyx_pybuffer_split_by.refcount = 0; - __pyx_pybuffernd_split_by.data = NULL; - __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; - __pyx_pybuffer_params_ssm.pybuffer.buf = NULL; - __pyx_pybuffer_params_ssm.refcount = 0; - __pyx_pybuffernd_params_ssm.data = NULL; - __pyx_pybuffernd_params_ssm.rcbuffer = &__pyx_pybuffer_params_ssm; - __pyx_pybuffer_params_rl.pybuffer.buf = NULL; - __pyx_pybuffer_params_rl.refcount = 0; - __pyx_pybuffernd_params_rl.data = NULL; - __pyx_pybuffernd_params_rl.rcbuffer = &__pyx_pybuffer_params_rl; - __pyx_pybuffer_params_bnds.pybuffer.buf = NULL; - __pyx_pybuffer_params_bnds.refcount = 0; - __pyx_pybuffernd_params_bnds.data = NULL; - __pyx_pybuffernd_params_bnds.rcbuffer = &__pyx_pybuffer_params_bnds; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) - } - __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) - } - __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) - } - __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_ssm.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_ssm, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) - } - __pyx_pybuffernd_params_ssm.diminfo[0].strides = __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_ssm.diminfo[0].shape = __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_rl.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_rl, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) - } - __pyx_pybuffernd_params_rl.diminfo[0].strides = __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_rl.diminfo[0].shape = __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_bnds, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 228, __pyx_L1_error) - } - __pyx_pybuffernd_params_bnds.diminfo[0].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_bnds.diminfo[0].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_params_bnds.diminfo[1].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_params_bnds.diminfo[1].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[1]; - - /* "wfpt.pyx":239 - * double p_outlier=0, double w_outlier=0, network = None): - * - * cdef double v = params_ssm[0] # <<<<<<<<<<<<<< - * cdef double rl_alpha = params_rl[0] - * - */ - __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error)) - __pyx_t_1 = 0; - __pyx_v_v = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides)); - - /* "wfpt.pyx":240 - * - * cdef double v = params_ssm[0] - * cdef double rl_alpha = params_rl[0] # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(240,0,__PYX_ERR(0, 240, __pyx_L1_error)) - __pyx_t_1 = 0; - __pyx_v_rl_alpha = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); - - /* "wfpt.pyx":242 - * cdef double rl_alpha = params_rl[0] - * - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i, j, i_p - * cdef Py_ssize_t s_size - */ - __Pyx_TraceLine(242,0,__PYX_ERR(0, 242, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L1_error) - __pyx_v_size = (__pyx_t_2[0]); - - /* "wfpt.pyx":246 - * cdef Py_ssize_t s_size - * cdef int s - * cdef double log_p = 0 # <<<<<<<<<<<<<< - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier - */ - __Pyx_TraceLine(246,0,__PYX_ERR(0, 246, __pyx_L1_error)) - __pyx_v_log_p = 0.0; - - /* "wfpt.pyx":247 - * cdef int s - * cdef double log_p = 0 - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef double wp_outlier = w_outlier * p_outlier - * cdef double alfa - */ - __Pyx_TraceLine(247,0,__PYX_ERR(0, 247, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":248 - * cdef double log_p = 0 - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * cdef double alfa - * cdef double pos_alfa - */ - __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":251 - * cdef double alfa - * cdef double pos_alfa - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim=1] xs - * cdef np.ndarray[double, ndim=1] feedbacks - */ - __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 251, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 251, __pyx_L1_error) - } else {__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_t_9 = 0; - __pyx_v_qs = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "wfpt.pyx":256 - * cdef np.ndarray[long, ndim=1] responses - * cdef np.ndarray[long, ndim=1] responses_qs - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< - * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] - * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) - */ - __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_unique); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_split_by)}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 256, __pyx_L1_error) - __pyx_t_10 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 256, __pyx_L1_error) - } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_10 = 0; - __pyx_v_unique = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "wfpt.pyx":257 - * cdef np.ndarray[long, ndim=1] responses_qs - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] # <<<<<<<<<<<<<< - * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) - * cdef float ll_min = -16.11809 - */ - __Pyx_TraceLine(257,0,__PYX_ERR(0, 257, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_params_ssm)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L1_error) - __pyx_v_n_params = (__pyx_t_2[0]); - - /* "wfpt.pyx":258 - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] - * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) # <<<<<<<<<<<<<< - * cdef float ll_min = -16.11809 - * cdef int cumm_s_size = 0 - */ - __Pyx_TraceLine(258,0,__PYX_ERR(0, 258, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_n_params + 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 258, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - __pyx_v_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 258, __pyx_L1_error) - } else {__pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; - } - } - __pyx_t_11 = 0; - __pyx_v_data = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "wfpt.pyx":259 - * cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] - * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) - * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< - * cdef int cumm_s_size = 0 - * - */ - __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error)) - __pyx_v_ll_min = -16.11809; - - /* "wfpt.pyx":260 - * cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) - * cdef float ll_min = -16.11809 - * cdef int cumm_s_size = 0 # <<<<<<<<<<<<<< - * - * if not p_outlier_in_range(p_outlier): - */ - __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error)) - __pyx_v_cumm_s_size = 0; - - /* "wfpt.pyx":262 - * cdef int cumm_s_size = 0 - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error)) - __pyx_t_12 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error) - __pyx_t_13 = (!__pyx_t_12); - if (__pyx_t_13) { - - /* "wfpt.pyx":263 - * - * if not p_outlier_in_range(p_outlier): - * return -np.inf # <<<<<<<<<<<<<< - * - * # Check for boundary violations -- if true, return -np.inf - */ - __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":262 - * cdef int cumm_s_size = 0 - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":266 - * - * # Check for boundary violations -- if true, return -np.inf - * for i_p in np.arange(1, len(params_ssm)): # <<<<<<<<<<<<<< - * lower_bnd = params_bnds[0][i_p] - * upper_bnd = params_bnds[1][i_p] - */ - __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_params_ssm)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 266, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_int_1, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_14 = 0; - __pyx_t_15 = NULL; - } else { - __pyx_t_14 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 266, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_15)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_15(__pyx_t_5); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 266, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_i_p = __pyx_t_16; - - /* "wfpt.pyx":267 - * # Check for boundary violations -- if true, return -np.inf - * for i_p in np.arange(1, len(params_ssm)): - * lower_bnd = params_bnds[0][i_p] # <<<<<<<<<<<<<< - * upper_bnd = params_bnds[1][i_p] - * - */ - __Pyx_TraceLine(267,0,__PYX_ERR(0, 267, __pyx_L1_error)) - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_lower_bnd, __pyx_t_6); - __pyx_t_6 = 0; - - /* "wfpt.pyx":268 - * for i_p in np.arange(1, len(params_ssm)): - * lower_bnd = params_bnds[0][i_p] - * upper_bnd = params_bnds[1][i_p] # <<<<<<<<<<<<<< - * - * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: - */ - __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error)) - __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_v_upper_bnd, __pyx_t_4); - __pyx_t_4 = 0; - - /* "wfpt.pyx":270 - * upper_bnd = params_bnds[1][i_p] - * - * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(270,0,__PYX_ERR(0, 270, __pyx_L1_error)) - __pyx_t_1 = __pyx_v_i_p; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_lower_bnd, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_12) { - } else { - __pyx_t_13 = __pyx_t_12; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_1 = __pyx_v_i_p; - __pyx_t_6 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_ssm.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_ssm.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_upper_bnd, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_13 = __pyx_t_12; - __pyx_L7_bool_binop_done:; - if (__pyx_t_13) { - - /* "wfpt.pyx":271 - * - * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: - * return -np.inf # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":270 - * upper_bnd = params_bnds[1][i_p] - * - * if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":266 - * - * # Check for boundary violations -- if true, return -np.inf - * for i_p in np.arange(1, len(params_ssm)): # <<<<<<<<<<<<<< - * lower_bnd = params_bnds[0][i_p] - * upper_bnd = params_bnds[1][i_p] - */ - __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error)) - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "wfpt.pyx":274 - * - * - * if len(params_rl) == 2: # <<<<<<<<<<<<<< - * pos_alfa = params_rl[1] - * else: - */ - __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error)) - __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_params_rl)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 274, __pyx_L1_error) - __pyx_t_13 = (__pyx_t_14 == 2); - if (__pyx_t_13) { - - /* "wfpt.pyx":275 - * - * if len(params_rl) == 2: - * pos_alfa = params_rl[1] # <<<<<<<<<<<<<< - * else: - * pos_alfa = params_rl[0] - */ - __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error)) - __pyx_t_1 = 1; - __pyx_v_pos_alfa = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); - - /* "wfpt.pyx":274 - * - * - * if len(params_rl) == 2: # <<<<<<<<<<<<<< - * pos_alfa = params_rl[1] - * else: - */ - goto __pyx_L10; - } - - /* "wfpt.pyx":277 - * pos_alfa = params_rl[1] - * else: - * pos_alfa = params_rl[0] # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(277,0,__PYX_ERR(0, 277, __pyx_L1_error)) - /*else*/ { - __pyx_t_1 = 0; - __pyx_v_pos_alfa = (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_params_rl.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_params_rl.diminfo[0].strides)); - } - __pyx_L10:; - - /* "wfpt.pyx":281 - * - * # unique represent # of conditions - * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< - * s = unique[j] - * # select trials for current condition, identified by the split_by-array - */ - __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error) - __pyx_t_17 = (__pyx_t_2[0]); - __pyx_t_18 = __pyx_t_17; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_18; __pyx_t_14+=1) { - __pyx_v_j = __pyx_t_14; - - /* "wfpt.pyx":282 - * # unique represent # of conditions - * for j in range(unique.shape[0]): - * s = unique[j] # <<<<<<<<<<<<<< - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] - */ - __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error)) - __pyx_t_1 = __pyx_v_j; - __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_unique.diminfo[0].strides)); - - /* "wfpt.pyx":284 - * s = unique[j] - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< - * responses = response[split_by == s] - * xs = x[split_by == s] - */ - __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 284, __pyx_L1_error) - __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_8 < 0)) { - PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedbacks, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); - } - __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0; - } - __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 284, __pyx_L1_error) - } - __pyx_t_19 = 0; - __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_5)); - __pyx_t_5 = 0; - - /* "wfpt.pyx":285 - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] - * responses = response[split_by == s] # <<<<<<<<<<<<<< - * xs = x[split_by == s] - * s_size = xs.shape[0] - */ - __Pyx_TraceLine(285,0,__PYX_ERR(0, 285, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 285, __pyx_L1_error) - __pyx_t_23 = ((PyArrayObject *)__pyx_t_5); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_8 < 0)) { - PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20); - } - __pyx_t_22 = __pyx_t_21 = __pyx_t_20 = 0; - } - __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) - } - __pyx_t_23 = 0; - __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_5)); - __pyx_t_5 = 0; - - /* "wfpt.pyx":286 - * feedbacks = feedback[split_by == s] - * responses = response[split_by == s] - * xs = x[split_by == s] # <<<<<<<<<<<<<< - * s_size = xs.shape[0] - * qs[0] = q - */ - __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 286, __pyx_L1_error) - __pyx_t_24 = ((PyArrayObject *)__pyx_t_5); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_8 < 0)) { - PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); - } - __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0; - } - __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) - } - __pyx_t_24 = 0; - __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_5)); - __pyx_t_5 = 0; - - /* "wfpt.pyx":287 - * responses = response[split_by == s] - * xs = x[split_by == s] - * s_size = xs.shape[0] # <<<<<<<<<<<<<< - * qs[0] = q - * qs[1] = q - */ - __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error)) - __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error) - __pyx_v_s_size = (__pyx_t_2[0]); - - /* "wfpt.pyx":288 - * xs = x[split_by == s] - * s_size = xs.shape[0] - * qs[0] = q # <<<<<<<<<<<<<< - * qs[1] = q - * - */ - __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error)) - __pyx_t_1 = 0; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":289 - * s_size = xs.shape[0] - * qs[0] = q - * qs[1] = q # <<<<<<<<<<<<<< - * - * responses_qs = responses - */ - __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error)) - __pyx_t_1 = 1; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":291 - * qs[1] = q - * - * responses_qs = responses # <<<<<<<<<<<<<< - * responses_qs[responses_qs == -1] = 0 - * - */ - __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error)) - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); - __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_responses), &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_8 < 0)) { - PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses_qs, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20); - } - __pyx_t_22 = __pyx_t_21 = __pyx_t_20 = 0; - } - __pyx_pybuffernd_responses_qs.diminfo[0].strides = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses_qs.diminfo[0].shape = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 291, __pyx_L1_error) - } - __Pyx_INCREF((PyObject *)__pyx_v_responses); - __Pyx_XDECREF_SET(__pyx_v_responses_qs, ((PyArrayObject *)__pyx_v_responses)); - - /* "wfpt.pyx":292 - * - * responses_qs = responses - * responses_qs[responses_qs == -1] = 0 # <<<<<<<<<<<<<< - * - * # don't calculate pdf for first trial but still update q - */ - __Pyx_TraceLine(292,0,__PYX_ERR(0, 292, __pyx_L1_error)) - __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_responses_qs), __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error) - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_responses_qs), __pyx_t_5, __pyx_int_0) < 0))) __PYX_ERR(0, 292, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "wfpt.pyx":295 - * - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses_qs[0]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - __Pyx_TraceLine(295,0,__PYX_ERR(0, 295, __pyx_L1_error)) - __pyx_t_1 = 0; - __pyx_t_25 = 0; - __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides))); - if (__pyx_t_13) { - - /* "wfpt.pyx":296 - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses_qs[0]]: - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< - * else: - * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - */ - __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error)) - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - - /* "wfpt.pyx":295 - * - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses_qs[0]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - goto __pyx_L13; - } - - /* "wfpt.pyx":298 - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(298,0,__PYX_ERR(0, 298, __pyx_L1_error)) - /*else*/ { - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); - } - __pyx_L13:; - - /* "wfpt.pyx":303 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses_qs[0]] = qs[responses_qs[0]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[0] - qs[responses_qs[0]]) - * - */ - __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) - __pyx_t_25 = 0; - __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - - /* "wfpt.pyx":304 - * # received on current trial. - * qs[responses_qs[0]] = qs[responses_qs[0]] + \ - * alfa * (feedbacks[0] - qs[responses_qs[0]]) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error)) - __pyx_t_1 = 0; - __pyx_t_27 = 0; - __pyx_t_28 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - - /* "wfpt.pyx":303 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses_qs[0]] = qs[responses_qs[0]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[0] - qs[responses_qs[0]]) - * - */ - __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) - __pyx_t_29 = 0; - __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_qs.diminfo[0].strides))))); - - /* "wfpt.pyx":307 - * - * - * data[0, 0] = 0.0 # <<<<<<<<<<<<<< - * # loop through all trials in current condition - * for i in range(1, s_size): - */ - __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error)) - __pyx_t_27 = 0; - __pyx_t_28 = 0; - *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_data.diminfo[1].strides) = 0.0; - - /* "wfpt.pyx":309 - * data[0, 0] = 0.0 - * # loop through all trials in current condition - * for i in range(1, s_size): # <<<<<<<<<<<<<< - * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v - * # Check for boundary violations -- if true, return -np.inf - */ - __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error)) - __pyx_t_16 = __pyx_v_s_size; - __pyx_t_31 = __pyx_t_16; - for (__pyx_t_32 = 1; __pyx_t_32 < __pyx_t_31; __pyx_t_32+=1) { - __pyx_v_i = __pyx_t_32; - - /* "wfpt.pyx":310 - * # loop through all trials in current condition - * for i in range(1, s_size): - * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v # <<<<<<<<<<<<<< - * # Check for boundary violations -- if true, return -np.inf - * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: - */ - __Pyx_TraceLine(310,0,__PYX_ERR(0, 310, __pyx_L1_error)) - __pyx_t_28 = 1; - __pyx_t_27 = 0; - __pyx_t_1 = (__pyx_v_cumm_s_size + __pyx_v_i); - __pyx_t_25 = 0; - *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_data.diminfo[1].strides) = (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v); - - /* "wfpt.pyx":312 - * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v - * # Check for boundary violations -- if true, return -np.inf - * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error)) - __pyx_t_27 = (__pyx_v_cumm_s_size + __pyx_v_i); - __pyx_t_28 = 0; - __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_12) { - } else { - __pyx_t_13 = __pyx_t_12; - goto __pyx_L17_bool_binop_done; - } - __pyx_t_28 = (__pyx_v_cumm_s_size + __pyx_v_i); - __pyx_t_27 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_13 = __pyx_t_12; - __pyx_L17_bool_binop_done:; - if (__pyx_t_13) { - - /* "wfpt.pyx":313 - * # Check for boundary violations -- if true, return -np.inf - * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: - * return -np.inf # <<<<<<<<<<<<<< - * - * # get learning rate for current trial. if pos_alpha is not in - */ - __Pyx_TraceLine(313,0,__PYX_ERR(0, 313, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":312 - * data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v - * # Check for boundary violations -- if true, return -np.inf - * if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":318 - * # include it will be same as alpha so can still use this - * # calculation: - * if feedbacks[i] > qs[responses_qs[i]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error)) - __pyx_t_27 = __pyx_v_i; - __pyx_t_28 = __pyx_v_i; - __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides))); - if (__pyx_t_13) { - - /* "wfpt.pyx":319 - * # calculation: - * if feedbacks[i] > qs[responses_qs[i]]: - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< - * else: - * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - */ - __Pyx_TraceLine(319,0,__PYX_ERR(0, 319, __pyx_L1_error)) - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - - /* "wfpt.pyx":318 - * # include it will be same as alpha so can still use this - * # calculation: - * if feedbacks[i] > qs[responses_qs[i]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - goto __pyx_L19; - } - - /* "wfpt.pyx":321 - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< - * - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - */ - __Pyx_TraceLine(321,0,__PYX_ERR(0, 321, __pyx_L1_error)) - /*else*/ { - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); - } - __pyx_L19:; - - /* "wfpt.pyx":325 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[i] - qs[responses_qs[i]]) - * cumm_s_size += s_size - */ - __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error)) - __pyx_t_28 = __pyx_v_i; - __pyx_t_25 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - - /* "wfpt.pyx":326 - * # received on current trial. - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ - * alfa * (feedbacks[i] - qs[responses_qs[i]]) # <<<<<<<<<<<<<< - * cumm_s_size += s_size - * - */ - __Pyx_TraceLine(326,0,__PYX_ERR(0, 326, __pyx_L1_error)) - __pyx_t_27 = __pyx_v_i; - __pyx_t_1 = __pyx_v_i; - __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - - /* "wfpt.pyx":325 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[i] - qs[responses_qs[i]]) - * cumm_s_size += s_size - */ - __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error)) - __pyx_t_29 = __pyx_v_i; - __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides))))); - } - - /* "wfpt.pyx":327 - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ - * alfa * (feedbacks[i] - qs[responses_qs[i]]) - * cumm_s_size += s_size # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error)) - __pyx_v_cumm_s_size = (__pyx_v_cumm_s_size + __pyx_v_s_size); - } - - /* "wfpt.pyx":330 - * - * - * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) # <<<<<<<<<<<<<< - * data[:, n_params:] = np.stack([x, response], axis = 1) - * - */ - __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_params_ssm), __pyx_slice__11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_33 = PyTuple_New(2); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_int_1)) __PYX_ERR(0, 330, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_33}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_33}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_33 = PySlice_New(__pyx_int_1, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_slice__8); - __Pyx_GIVEREF(__pyx_slice__8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__8)) __PYX_ERR(0, 330, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_33); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_33)) __PYX_ERR(0, 330, __pyx_L1_error); - __pyx_t_33 = 0; - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_t_7, __pyx_t_6) < 0))) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "wfpt.pyx":331 - * - * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) - * data[:, n_params:] = np.stack([x, response], axis = 1) # <<<<<<<<<<<<<< - * - * # Call to network: - */ - __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_stack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF((PyObject *)__pyx_v_x); - __Pyx_GIVEREF((PyObject *)__pyx_v_x); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_x))) __PYX_ERR(0, 331, __pyx_L1_error); - __Pyx_INCREF((PyObject *)__pyx_v_response); - __Pyx_GIVEREF((PyObject *)__pyx_v_response); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_response))) __PYX_ERR(0, 331, __pyx_L1_error); - __pyx_t_33 = PyTuple_New(1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 331, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_33, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_33 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__8); - __Pyx_GIVEREF(__pyx_slice__8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__8)) __PYX_ERR(0, 331, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_33); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_33)) __PYX_ERR(0, 331, __pyx_L1_error); - __pyx_t_33 = 0; - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_t_6, __pyx_t_5) < 0))) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "wfpt.pyx":334 - * - * # Call to network: - * if p_outlier == 0: # <<<<<<<<<<<<<< - * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - */ - __Pyx_TraceLine(334,0,__PYX_ERR(0, 334, __pyx_L1_error)) - __pyx_t_13 = (__pyx_v_p_outlier == 0.0); - if (__pyx_t_13) { - - /* "wfpt.pyx":335 - * # Call to network: - * if p_outlier == 0: - * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< - * else: - * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - */ - __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_umath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_maximum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_34 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_34)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_34); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_34, ((PyObject *)__pyx_v_data)}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_34 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_34)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_34); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_34, __pyx_t_7, __pyx_t_3}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_4 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_33))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_33); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_33, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - } - __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_sum_logp = __pyx_t_35; - - /* "wfpt.pyx":334 - * - * # Call to network: - * if p_outlier == 0: # <<<<<<<<<<<<<< - * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - */ - goto __pyx_L20; - } - - /* "wfpt.pyx":337 - * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< - * - * return sum_logp - */ - __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error)) - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_34); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_core); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_umath); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_maximum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __pyx_t_39 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_38); - if (likely(__pyx_t_39)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); - __Pyx_INCREF(__pyx_t_39); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_39, ((PyObject *)__pyx_v_data)}; - __pyx_t_36 = __Pyx_PyObject_FastCall(__pyx_t_38, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; - if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - } - __pyx_t_38 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __pyx_t_39 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_37))) { - __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_37); - if (likely(__pyx_t_39)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); - __Pyx_INCREF(__pyx_t_39); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_37, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_39, __pyx_t_36, __pyx_t_38}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_37, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - } - __pyx_t_37 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_34))) { - __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_34); - if (likely(__pyx_t_37)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34); - __Pyx_INCREF(__pyx_t_37); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_34, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_37, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_34, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - } - __pyx_t_34 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_34); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_34); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __pyx_t_34 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_34); - __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_34); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __pyx_t_34 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_34)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_34); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_4}; - __pyx_t_33 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_3 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_33}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_sum_logp = __pyx_t_35; - } - __pyx_L20:; - - /* "wfpt.pyx":339 - * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - * - * return sum_logp # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":228 - * - * - * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] x, - * np.ndarray[long, ndim=1] response, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_33); - __Pyx_XDECREF(__pyx_t_34); - __Pyx_XDECREF(__pyx_t_36); - __Pyx_XDECREF(__pyx_t_37); - __Pyx_XDECREF(__pyx_t_38); - __Pyx_XDECREF(__pyx_t_39); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_rl.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_ssm.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_rl.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_ssm.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_qs); - __Pyx_XDECREF((PyObject *)__pyx_v_xs); - __Pyx_XDECREF((PyObject *)__pyx_v_feedbacks); - __Pyx_XDECREF((PyObject *)__pyx_v_responses); - __Pyx_XDECREF((PyObject *)__pyx_v_responses_qs); - __Pyx_XDECREF((PyObject *)__pyx_v_unique); - __Pyx_XDECREF((PyObject *)__pyx_v_data); - __Pyx_XDECREF(__pyx_v_lower_bnd); - __Pyx_XDECREF(__pyx_v_upper_bnd); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":342 - * - * - * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] feedback, - * np.ndarray[long, ndim=1] split_by, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_15wiener_like_rl(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_14wiener_like_rl, "wiener_like_rl(ndarray response, ndarray feedback, ndarray split_by, double q, double alpha, double pos_alpha, double v, double z, double err=1e-4, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_15wiener_like_rl = {"wiener_like_rl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_15wiener_like_rl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_14wiener_like_rl}; -static PyObject *__pyx_pw_4wfpt_15wiener_like_rl(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_response = 0; - PyArrayObject *__pyx_v_feedback = 0; - PyArrayObject *__pyx_v_split_by = 0; - double __pyx_v_q; - double __pyx_v_alpha; - double __pyx_v_pos_alpha; - double __pyx_v_v; - double __pyx_v_z; - CYTHON_UNUSED double __pyx_v_err; - CYTHON_UNUSED int __pyx_v_n_st; - CYTHON_UNUSED int __pyx_v_n_sz; - CYTHON_UNUSED int __pyx_v_use_adaptive; - CYTHON_UNUSED double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_rl (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 342, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_alpha,&__pyx_n_s_pos_alpha,&__pyx_n_s_v,&__pyx_n_s_z,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 1); __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 2); __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 3); __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 4); __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos_alpha)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 5); __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 6); __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, 7); __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err); - if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rl") < 0)) __PYX_ERR(0, 342, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_response = ((PyArrayObject *)values[0]); - __pyx_v_feedback = ((PyArrayObject *)values[1]); - __pyx_v_split_by = ((PyArrayObject *)values[2]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) - __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) - __pyx_v_pos_alpha = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_pos_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) - __pyx_v_v = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error) - if (values[8]) { - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) - } else { - __pyx_v_err = ((double)((double)1e-4)); - } - if (values[9]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)10)); - } - if (values[10]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)10)); - } - if (values[11]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[12]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-8)); - } - if (values[13]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[14]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_rl", 0, 8, 15, __pyx_nargs); __PYX_ERR(0, 342, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_rl", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 342, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 343, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 344, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_14wiener_like_rl(__pyx_self, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_alpha, __pyx_v_pos_alpha, __pyx_v_v, __pyx_v_z, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_14wiener_like_rl(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, double __pyx_v_alpha, double __pyx_v_pos_alpha, double __pyx_v_v, double __pyx_v_z, CYTHON_UNUSED double __pyx_v_err, CYTHON_UNUSED int __pyx_v_n_st, CYTHON_UNUSED int __pyx_v_n_sz, CYTHON_UNUSED int __pyx_v_use_adaptive, CYTHON_UNUSED double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - CYTHON_UNUSED Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - Py_ssize_t __pyx_v_j; - Py_ssize_t __pyx_v_s_size; - int __pyx_v_s; - double __pyx_v_drift; - double __pyx_v_p; - double __pyx_v_sum_logp; - double __pyx_v_wp_outlier; - double __pyx_v_alfa; - double __pyx_v_pos_alfa; - PyArrayObject *__pyx_v_qs = 0; - PyArrayObject *__pyx_v_feedbacks = 0; - PyArrayObject *__pyx_v_responses = 0; - PyArrayObject *__pyx_v_unique = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; - __Pyx_Buffer __pyx_pybuffer_feedback; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedbacks; - __Pyx_Buffer __pyx_pybuffer_feedbacks; - __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; - __Pyx_Buffer __pyx_pybuffer_qs; - __Pyx_LocalBuf_ND __pyx_pybuffernd_response; - __Pyx_Buffer __pyx_pybuffer_response; - __Pyx_LocalBuf_ND __pyx_pybuffernd_responses; - __Pyx_Buffer __pyx_pybuffer_responses; - __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; - __Pyx_Buffer __pyx_pybuffer_split_by; - __Pyx_LocalBuf_ND __pyx_pybuffernd_unique; - __Pyx_Buffer __pyx_pybuffer_unique; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyArrayObject *__pyx_t_8 = NULL; - PyArrayObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - npy_intp __pyx_t_12; - npy_intp __pyx_t_13; - Py_ssize_t __pyx_t_14; - Py_ssize_t __pyx_t_15; - PyArrayObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyArrayObject *__pyx_t_20 = NULL; - Py_ssize_t __pyx_t_21; - Py_ssize_t __pyx_t_22; - Py_ssize_t __pyx_t_23; - Py_ssize_t __pyx_t_24; - Py_ssize_t __pyx_t_25; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; - Py_ssize_t __pyx_t_29; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__12) - __Pyx_RefNannySetupContext("wiener_like_rl", 0); - __Pyx_TraceCall("wiener_like_rl", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error)); - __pyx_pybuffer_qs.pybuffer.buf = NULL; - __pyx_pybuffer_qs.refcount = 0; - __pyx_pybuffernd_qs.data = NULL; - __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; - __pyx_pybuffer_feedbacks.pybuffer.buf = NULL; - __pyx_pybuffer_feedbacks.refcount = 0; - __pyx_pybuffernd_feedbacks.data = NULL; - __pyx_pybuffernd_feedbacks.rcbuffer = &__pyx_pybuffer_feedbacks; - __pyx_pybuffer_responses.pybuffer.buf = NULL; - __pyx_pybuffer_responses.refcount = 0; - __pyx_pybuffernd_responses.data = NULL; - __pyx_pybuffernd_responses.rcbuffer = &__pyx_pybuffer_responses; - __pyx_pybuffer_unique.pybuffer.buf = NULL; - __pyx_pybuffer_unique.refcount = 0; - __pyx_pybuffernd_unique.data = NULL; - __pyx_pybuffernd_unique.rcbuffer = &__pyx_pybuffer_unique; - __pyx_pybuffer_response.pybuffer.buf = NULL; - __pyx_pybuffer_response.refcount = 0; - __pyx_pybuffernd_response.data = NULL; - __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; - __pyx_pybuffer_feedback.pybuffer.buf = NULL; - __pyx_pybuffer_feedback.refcount = 0; - __pyx_pybuffernd_feedback.data = NULL; - __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; - __pyx_pybuffer_split_by.pybuffer.buf = NULL; - __pyx_pybuffer_split_by.refcount = 0; - __pyx_pybuffernd_split_by.data = NULL; - __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 342, __pyx_L1_error) - } - __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 342, __pyx_L1_error) - } - __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 342, __pyx_L1_error) - } - __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":348 - * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = response.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i, j - * cdef Py_ssize_t s_size - */ - __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_response)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":354 - * cdef double drift - * cdef double p - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef double wp_outlier = w_outlier * p_outlier - * cdef double alfa - */ - __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":355 - * cdef double p - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * cdef double alfa - * cdef double pos_alfa - */ - __Pyx_TraceLine(355,0,__PYX_ERR(0, 355, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":358 - * cdef double alfa - * cdef double pos_alfa - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim=1] feedbacks - * cdef np.ndarray[long, ndim=1] responses - */ - __Pyx_TraceLine(358,0,__PYX_ERR(0, 358, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 358, __pyx_L1_error) - } else {__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_t_8 = 0; - __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":361 - * cdef np.ndarray[double, ndim=1] feedbacks - * cdef np.ndarray[long, ndim=1] responses - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< - * - * if not p_outlier_in_range(p_outlier): - */ - __Pyx_TraceLine(361,0,__PYX_ERR(0, 361, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 361, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 361, __pyx_L1_error) - } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_9 = 0; - __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":363 - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error)) - __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_10); - if (__pyx_t_11) { - - /* "wfpt.pyx":364 - * - * if not p_outlier_in_range(p_outlier): - * return -np.inf # <<<<<<<<<<<<<< - * - * if pos_alpha==100.00: - */ - __Pyx_TraceLine(364,0,__PYX_ERR(0, 364, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":363 - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":366 - * return -np.inf - * - * if pos_alpha==100.00: # <<<<<<<<<<<<<< - * pos_alfa = alpha - * else: - */ - __Pyx_TraceLine(366,0,__PYX_ERR(0, 366, __pyx_L1_error)) - __pyx_t_11 = (__pyx_v_pos_alpha == 100.00); - if (__pyx_t_11) { - - /* "wfpt.pyx":367 - * - * if pos_alpha==100.00: - * pos_alfa = alpha # <<<<<<<<<<<<<< - * else: - * pos_alfa = pos_alpha - */ - __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error)) - __pyx_v_pos_alfa = __pyx_v_alpha; - - /* "wfpt.pyx":366 - * return -np.inf - * - * if pos_alpha==100.00: # <<<<<<<<<<<<<< - * pos_alfa = alpha - * else: - */ - goto __pyx_L4; - } - - /* "wfpt.pyx":369 - * pos_alfa = alpha - * else: - * pos_alfa = pos_alpha # <<<<<<<<<<<<<< - * - * # unique represent # of conditions - */ - __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error)) - /*else*/ { - __pyx_v_pos_alfa = __pyx_v_pos_alpha; - } - __pyx_L4:; - - /* "wfpt.pyx":372 - * - * # unique represent # of conditions - * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< - * s = unique[j] - * # select trials for current condition, identified by the split_by-array - */ - __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L1_error) - __pyx_t_12 = (__pyx_t_1[0]); - __pyx_t_13 = __pyx_t_12; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_j = __pyx_t_14; - - /* "wfpt.pyx":373 - * # unique represent # of conditions - * for j in range(unique.shape[0]): - * s = unique[j] # <<<<<<<<<<<<<< - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] - */ - __Pyx_TraceLine(373,0,__PYX_ERR(0, 373, __pyx_L1_error)) - __pyx_t_15 = __pyx_v_j; - __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_unique.diminfo[0].strides)); - - /* "wfpt.pyx":375 - * s = unique[j] - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< - * responses = response[split_by == s] - * s_size = responses.shape[0] - */ - __Pyx_TraceLine(375,0,__PYX_ERR(0, 375, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 375, __pyx_L1_error) - __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedbacks, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_17, __pyx_t_18, __pyx_t_19); - } - __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0; - } - __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 375, __pyx_L1_error) - } - __pyx_t_16 = 0; - __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "wfpt.pyx":376 - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] - * responses = response[split_by == s] # <<<<<<<<<<<<<< - * s_size = responses.shape[0] - * qs[0] = q - */ - __Pyx_TraceLine(376,0,__PYX_ERR(0, 376, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 376, __pyx_L1_error) - __pyx_t_20 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_19, __pyx_t_18, __pyx_t_17); - } - __pyx_t_19 = __pyx_t_18 = __pyx_t_17 = 0; - } - __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) - } - __pyx_t_20 = 0; - __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "wfpt.pyx":377 - * feedbacks = feedback[split_by == s] - * responses = response[split_by == s] - * s_size = responses.shape[0] # <<<<<<<<<<<<<< - * qs[0] = q - * qs[1] = q - */ - __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_responses)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error) - __pyx_v_s_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":378 - * responses = response[split_by == s] - * s_size = responses.shape[0] - * qs[0] = q # <<<<<<<<<<<<<< - * qs[1] = q - * - */ - __Pyx_TraceLine(378,0,__PYX_ERR(0, 378, __pyx_L1_error)) - __pyx_t_15 = 0; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":379 - * s_size = responses.shape[0] - * qs[0] = q - * qs[1] = q # <<<<<<<<<<<<<< - * - * # don't calculate pdf for first trial but still update q - */ - __Pyx_TraceLine(379,0,__PYX_ERR(0, 379, __pyx_L1_error)) - __pyx_t_15 = 1; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":382 - * - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - __Pyx_TraceLine(382,0,__PYX_ERR(0, 382, __pyx_L1_error)) - __pyx_t_15 = 0; - __pyx_t_21 = 0; - __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); - __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides))); - if (__pyx_t_11) { - - /* "wfpt.pyx":383 - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses[0]]: - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< - * else: - * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) - */ - __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error)) - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - - /* "wfpt.pyx":382 - * - * # don't calculate pdf for first trial but still update q - * if feedbacks[0] > qs[responses[0]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - goto __pyx_L7; - } - - /* "wfpt.pyx":385 - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< - * - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - */ - __Pyx_TraceLine(385,0,__PYX_ERR(0, 385, __pyx_L1_error)) - /*else*/ { - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); - } - __pyx_L7:; - - /* "wfpt.pyx":389 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[0] - qs[responses[0]]) - * - */ - __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error)) - __pyx_t_21 = 0; - __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); - - /* "wfpt.pyx":390 - * # received on current trial. - * qs[responses[0]] = qs[responses[0]] + \ - * alfa * (feedbacks[0] - qs[responses[0]]) # <<<<<<<<<<<<<< - * - * # loop through all trials in current condition - */ - __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error)) - __pyx_t_15 = 0; - __pyx_t_23 = 0; - __pyx_t_24 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); - - /* "wfpt.pyx":389 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses[0]] = qs[responses[0]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[0] - qs[responses[0]]) - * - */ - __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error)) - __pyx_t_25 = 0; - __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))))); - - /* "wfpt.pyx":393 - * - * # loop through all trials in current condition - * for i in range(1, s_size): # <<<<<<<<<<<<<< - * - * drift = (qs[1] - qs[0]) * v - */ - __Pyx_TraceLine(393,0,__PYX_ERR(0, 393, __pyx_L1_error)) - __pyx_t_27 = __pyx_v_s_size; - __pyx_t_28 = __pyx_t_27; - for (__pyx_t_29 = 1; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { - __pyx_v_i = __pyx_t_29; - - /* "wfpt.pyx":395 - * for i in range(1, s_size): - * - * drift = (qs[1] - qs[0]) * v # <<<<<<<<<<<<<< - * - * if drift == 0: - */ - __Pyx_TraceLine(395,0,__PYX_ERR(0, 395, __pyx_L1_error)) - __pyx_t_23 = 1; - __pyx_t_24 = 0; - __pyx_v_drift = (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides))) * __pyx_v_v); - - /* "wfpt.pyx":397 - * drift = (qs[1] - qs[0]) * v - * - * if drift == 0: # <<<<<<<<<<<<<< - * p = 0.5 - * else: - */ - __Pyx_TraceLine(397,0,__PYX_ERR(0, 397, __pyx_L1_error)) - __pyx_t_11 = (__pyx_v_drift == 0.0); - if (__pyx_t_11) { - - /* "wfpt.pyx":398 - * - * if drift == 0: - * p = 0.5 # <<<<<<<<<<<<<< - * else: - * if responses[i] == 1: - */ - __Pyx_TraceLine(398,0,__PYX_ERR(0, 398, __pyx_L1_error)) - __pyx_v_p = 0.5; - - /* "wfpt.pyx":397 - * drift = (qs[1] - qs[0]) * v - * - * if drift == 0: # <<<<<<<<<<<<<< - * p = 0.5 - * else: - */ - goto __pyx_L10; - } - - /* "wfpt.pyx":400 - * p = 0.5 - * else: - * if responses[i] == 1: # <<<<<<<<<<<<<< - * p = (2.718281828459**(-2 * z * drift) - 1) / \ - * (2.718281828459**(-2 * drift) - 1) - */ - __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error)) - /*else*/ { - __pyx_t_24 = __pyx_v_i; - __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_responses.diminfo[0].strides)) == 1); - if (__pyx_t_11) { - - /* "wfpt.pyx":401 - * else: - * if responses[i] == 1: - * p = (2.718281828459**(-2 * z * drift) - 1) / \ # <<<<<<<<<<<<<< - * (2.718281828459**(-2 * drift) - 1) - * else: - */ - __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error)) - __pyx_v_p = ((pow(2.718281828459, ((-2.0 * __pyx_v_z) * __pyx_v_drift)) - 1.0) / (pow(2.718281828459, (-2.0 * __pyx_v_drift)) - 1.0)); - - /* "wfpt.pyx":400 - * p = 0.5 - * else: - * if responses[i] == 1: # <<<<<<<<<<<<<< - * p = (2.718281828459**(-2 * z * drift) - 1) / \ - * (2.718281828459**(-2 * drift) - 1) - */ - goto __pyx_L11; - } - - /* "wfpt.pyx":404 - * (2.718281828459**(-2 * drift) - 1) - * else: - * p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ # <<<<<<<<<<<<<< - * (2.718281828459**(-2 * drift) - 1) - * - */ - __Pyx_TraceLine(404,0,__PYX_ERR(0, 404, __pyx_L1_error)) - /*else*/ { - - /* "wfpt.pyx":405 - * else: - * p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ - * (2.718281828459**(-2 * drift) - 1) # <<<<<<<<<<<<<< - * - * # If one probability = 0, the log sum will be -Inf - */ - __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error)) - __pyx_v_p = (1.0 - ((pow(2.718281828459, ((-2.0 * __pyx_v_z) * __pyx_v_drift)) - 1.0) / (pow(2.718281828459, (-2.0 * __pyx_v_drift)) - 1.0))); - } - __pyx_L11:; - } - __pyx_L10:; - - /* "wfpt.pyx":408 - * - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * if p == 0: - * return -np.inf - */ - __Pyx_TraceLine(408,0,__PYX_ERR(0, 408, __pyx_L1_error)) - __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - - /* "wfpt.pyx":409 - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(409,0,__PYX_ERR(0, 409, __pyx_L1_error)) - __pyx_t_11 = (__pyx_v_p == 0.0); - if (__pyx_t_11) { - - /* "wfpt.pyx":410 - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: - * return -np.inf # <<<<<<<<<<<<<< - * - * sum_logp += log(p) - */ - __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":409 - * # If one probability = 0, the log sum will be -Inf - * p = p * (1 - p_outlier) + wp_outlier - * if p == 0: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":412 - * return -np.inf - * - * sum_logp += log(p) # <<<<<<<<<<<<<< - * - * # get learning rate for current trial. if pos_alpha is not in - */ - __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error)) - __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - - /* "wfpt.pyx":417 - * # include it will be same as alpha so can still use this - * # calculation: - * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error)) - __pyx_t_24 = __pyx_v_i; - __pyx_t_23 = __pyx_v_i; - __pyx_t_15 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); - __pyx_t_11 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides))); - if (__pyx_t_11) { - - /* "wfpt.pyx":418 - * # calculation: - * if feedbacks[i] > qs[responses[i]]: - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) # <<<<<<<<<<<<<< - * else: - * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) - */ - __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error)) - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_pos_alfa) / (1.0 + pow(2.718281828459, __pyx_v_pos_alfa))); - - /* "wfpt.pyx":417 - * # include it will be same as alpha so can still use this - * # calculation: - * if feedbacks[i] > qs[responses[i]]: # <<<<<<<<<<<<<< - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - */ - goto __pyx_L13; - } - - /* "wfpt.pyx":420 - * alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - * else: - * alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) # <<<<<<<<<<<<<< - * - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - */ - __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error)) - /*else*/ { - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_alpha) / (1.0 + pow(2.718281828459, __pyx_v_alpha))); - } - __pyx_L13:; - - /* "wfpt.pyx":424 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[i] - qs[responses[i]]) - * return sum_logp - */ - __Pyx_TraceLine(424,0,__PYX_ERR(0, 424, __pyx_L1_error)) - __pyx_t_23 = __pyx_v_i; - __pyx_t_15 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_responses.diminfo[0].strides)); - - /* "wfpt.pyx":425 - * # received on current trial. - * qs[responses[i]] = qs[responses[i]] + \ - * alfa * (feedbacks[i] - qs[responses[i]]) # <<<<<<<<<<<<<< - * return sum_logp - * - */ - __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) - __pyx_t_24 = __pyx_v_i; - __pyx_t_21 = __pyx_v_i; - __pyx_t_22 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_responses.diminfo[0].strides)); - - /* "wfpt.pyx":424 - * # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - * # received on current trial. - * qs[responses[i]] = qs[responses[i]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[i] - qs[responses[i]]) - * return sum_logp - */ - __Pyx_TraceLine(424,0,__PYX_ERR(0, 424, __pyx_L1_error)) - __pyx_t_25 = __pyx_v_i; - __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_responses.diminfo[0].strides)); - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_qs.diminfo[0].strides))))); - } - } - - /* "wfpt.pyx":426 - * qs[responses[i]] = qs[responses[i]] + \ - * alfa * (feedbacks[i] - qs[responses[i]]) - * return sum_logp # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":342 - * - * - * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] feedback, - * np.ndarray[long, ndim=1] split_by, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_rl", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_qs); - __Pyx_XDECREF((PyObject *)__pyx_v_feedbacks); - __Pyx_XDECREF((PyObject *)__pyx_v_responses); - __Pyx_XDECREF((PyObject *)__pyx_v_unique); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":429 - * - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_17wiener_like_multi(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_16wiener_like_multi, "wiener_like_multi(ndarray x, v, sv, a, z, sz, t, st, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_17wiener_like_multi = {"wiener_like_multi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_17wiener_like_multi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_16wiener_like_multi}; -static PyObject *__pyx_pw_4wfpt_17wiener_like_multi(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - PyObject *__pyx_v_v = 0; - PyObject *__pyx_v_sv = 0; - PyObject *__pyx_v_a = 0; - PyObject *__pyx_v_z = 0; - PyObject *__pyx_v_sz = 0; - PyObject *__pyx_v_t = 0; - PyObject *__pyx_v_st = 0; - double __pyx_v_err; - PyObject *__pyx_v_multi = 0; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_multi (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 429, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_multi,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 1); __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 2); __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 3); __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 4); __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 5); __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 6); __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 7); __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, 8); __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi") < 0)) __PYX_ERR(0, 429, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_v = values[1]; - __pyx_v_sv = values[2]; - __pyx_v_a = values[3]; - __pyx_v_z = values[4]; - __pyx_v_sz = values[5]; - __pyx_v_t = values[6]; - __pyx_v_st = values[7]; - __pyx_v_err = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) - __pyx_v_multi = values[9]; - if (values[10]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)10)); - } - if (values[11]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)10)); - } - if (values[12]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[13]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-3)); - } - if (values[14]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[15]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi", 0, 9, 16, __pyx_nargs); __PYX_ERR(0, 429, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 429, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_16wiener_like_multi(__pyx_self, __pyx_v_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_16wiener_like_multi(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - double __pyx_v_p; - double __pyx_v_sum_logp; - double __pyx_v_wp_outlier; - PyObject *__pyx_v_params = NULL; - PyObject *__pyx_v_params_iter = NULL; - PyObject *__pyx_v_param = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - int __pyx_t_2; - double __pyx_t_3; - double __pyx_t_4; - double __pyx_t_5; - double __pyx_t_6; - double __pyx_t_7; - double __pyx_t_8; - double __pyx_t_9; - double __pyx_t_10; - double __pyx_t_11; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - int __pyx_t_15; - Py_ssize_t __pyx_t_16; - Py_ssize_t __pyx_t_17; - Py_ssize_t __pyx_t_18; - Py_ssize_t __pyx_t_19; - PyObject *(*__pyx_t_20)(PyObject *); - Py_ssize_t __pyx_t_21; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_22; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__13) - __Pyx_RefNannySetupContext("wiener_like_multi", 0); - __Pyx_TraceCall("wiener_like_multi", __pyx_f[0], 429, 0, __PYX_ERR(0, 429, __pyx_L1_error)); - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 429, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":432 - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef double p = 0 - */ - __Pyx_TraceLine(432,0,__PYX_ERR(0, 432, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":434 - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t i - * cdef double p = 0 # <<<<<<<<<<<<<< - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier - */ - __Pyx_TraceLine(434,0,__PYX_ERR(0, 434, __pyx_L1_error)) - __pyx_v_p = 0.0; - - /* "wfpt.pyx":435 - * cdef Py_ssize_t i - * cdef double p = 0 - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef double wp_outlier = w_outlier * p_outlier - * - */ - __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":436 - * cdef double p = 0 - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * - * if multi is None: - */ - __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":438 - * cdef double wp_outlier = w_outlier * p_outlier - * - * if multi is None: # <<<<<<<<<<<<<< - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - */ - __Pyx_TraceLine(438,0,__PYX_ERR(0, 438, __pyx_L1_error)) - __pyx_t_2 = (__pyx_v_multi == Py_None); - if (__pyx_t_2) { - - /* "wfpt.pyx":439 - * - * if multi is None: - * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} - */ - __Pyx_TraceLine(439,0,__PYX_ERR(0, 439, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_11 = __pyx_f_4wfpt_full_pdf(__pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_12 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_r = __pyx_t_12; - __pyx_t_12 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":438 - * cdef double wp_outlier = w_outlier * p_outlier - * - * if multi is None: # <<<<<<<<<<<<<< - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - */ - } - - /* "wfpt.pyx":441 - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} # <<<<<<<<<<<<<< - * params_iter = copy(params) - * for i in range(size): - */ - __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error)) - /*else*/ { - __pyx_t_12 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - __pyx_v_params = ((PyObject*)__pyx_t_12); - __pyx_t_12 = 0; - - /* "wfpt.pyx":442 - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} - * params_iter = copy(params) # <<<<<<<<<<<<<< - * for i in range(size): - * for param in multi: - */ - __Pyx_TraceLine(442,0,__PYX_ERR(0, 442, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = NULL; - __pyx_t_15 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_13))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_13, function); - __pyx_t_15 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_params}; - __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __pyx_v_params_iter = __pyx_t_12; - __pyx_t_12 = 0; - - /* "wfpt.pyx":443 - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} - * params_iter = copy(params) - * for i in range(size): # <<<<<<<<<<<<<< - * for param in multi: - * params_iter[param] = params[param][i] - */ - __Pyx_TraceLine(443,0,__PYX_ERR(0, 443, __pyx_L1_error)) - __pyx_t_16 = __pyx_v_size; - __pyx_t_17 = __pyx_t_16; - for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { - __pyx_v_i = __pyx_t_18; - - /* "wfpt.pyx":444 - * params_iter = copy(params) - * for i in range(size): - * for param in multi: # <<<<<<<<<<<<<< - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: - */ - __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error)) - if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { - __pyx_t_12 = __pyx_v_multi; __Pyx_INCREF(__pyx_t_12); __pyx_t_19 = 0; - __pyx_t_20 = NULL; - } else { - __pyx_t_19 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 444, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_20)) { - if (likely(PyList_CheckExact(__pyx_t_12))) { - if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_12)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 444, __pyx_L1_error) - #else - __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - #endif - } else { - if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_12)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_19); __Pyx_INCREF(__pyx_t_13); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 444, __pyx_L1_error) - #else - __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - #endif - } - } else { - __pyx_t_13 = __pyx_t_20(__pyx_t_12); - if (unlikely(!__pyx_t_13)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 444, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_13); - } - __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_13); - __pyx_t_13 = 0; - - /* "wfpt.pyx":445 - * for i in range(size): - * for param in multi: - * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< - * if abs(x[i]) != 999.: - * p = full_pdf(x[i], params_iter['v'], - */ - __Pyx_TraceLine(445,0,__PYX_ERR(0, 445, __pyx_L1_error)) - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_14) < 0))) __PYX_ERR(0, 445, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - - /* "wfpt.pyx":444 - * params_iter = copy(params) - * for i in range(size): - * for param in multi: # <<<<<<<<<<<<<< - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: - */ - __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error)) - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "wfpt.pyx":446 - * for param in multi: - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< - * p = full_pdf(x[i], params_iter['v'], - * params_iter['sv'], params_iter['a'], params_iter['z'], - */ - __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error)) - __pyx_t_21 = __pyx_v_i; - __pyx_t_2 = (fabs((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides))) != 999.); - if (__pyx_t_2) { - - /* "wfpt.pyx":447 - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: - * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter['t'], params_iter['st'], - */ - __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error)) - __pyx_t_21 = __pyx_v_i; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "wfpt.pyx":448 - * if abs(x[i]) != 999.: - * p = full_pdf(x[i], params_iter['v'], - * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< - * params_iter['sz'], params_iter['t'], params_iter['st'], - * err, n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "wfpt.pyx":449 - * p = full_pdf(x[i], params_iter['v'], - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter['t'], params_iter['st'], # <<<<<<<<<<<<<< - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier - */ - __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "wfpt.pyx":447 - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: - * p = full_pdf(x[i], params_iter['v'], # <<<<<<<<<<<<<< - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter['t'], params_iter['st'], - */ - __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error)) - __pyx_t_22.__pyx_n = 4; - __pyx_t_22.n_st = __pyx_v_n_st; - __pyx_t_22.n_sz = __pyx_v_n_sz; - __pyx_t_22.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_22.simps_err = __pyx_v_simps_err; - __pyx_t_4 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5, __pyx_v_err, 0, &__pyx_t_22); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) - __pyx_v_p = __pyx_t_4; - - /* "wfpt.pyx":451 - * params_iter['sz'], params_iter['t'], params_iter['st'], - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * elif x[i] == 999.: - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - */ - __Pyx_TraceLine(451,0,__PYX_ERR(0, 451, __pyx_L1_error)) - __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - - /* "wfpt.pyx":446 - * for param in multi: - * params_iter[param] = params[param][i] - * if abs(x[i]) != 999.: # <<<<<<<<<<<<<< - * p = full_pdf(x[i], params_iter['v'], - * params_iter['sv'], params_iter['a'], params_iter['z'], - */ - goto __pyx_L9; - } - - /* "wfpt.pyx":452 - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier - * elif x[i] == 999.: # <<<<<<<<<<<<<< - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * else: # x[i] == -999. - */ - __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error)) - __pyx_t_21 = __pyx_v_i; - __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides)) == 999.); - if (__pyx_t_2) { - - /* "wfpt.pyx":453 - * p = p * (1 - p_outlier) + wp_outlier - * elif x[i] == 999.: - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< - * else: # x[i] == -999. - * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - */ - __Pyx_TraceLine(453,0,__PYX_ERR(0, 453, __pyx_L1_error)) - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_7 = __pyx_f_4wfpt_prob_ub(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) - __pyx_v_p = __pyx_t_7; - - /* "wfpt.pyx":452 - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier - * elif x[i] == 999.: # <<<<<<<<<<<<<< - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * else: # x[i] == -999. - */ - goto __pyx_L9; - } - - /* "wfpt.pyx":455 - * p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * else: # x[i] == -999. - * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) # <<<<<<<<<<<<<< - * - * sum_logp += log(p) - */ - __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error)) - /*else*/ { - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_4 = __pyx_f_4wfpt_prob_ub(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_v_p = (1.0 - __pyx_t_4); - } - __pyx_L9:; - - /* "wfpt.pyx":457 - * p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - * - * sum_logp += log(p) # <<<<<<<<<<<<<< - * - * return sum_logp - */ - __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error)) - __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - } - - /* "wfpt.pyx":459 - * sum_logp += log(p) - * - * return sum_logp # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_r = __pyx_t_12; - __pyx_t_12 = 0; - goto __pyx_L0; - } - - /* "wfpt.pyx":429 - * - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_14); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_multi", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF(__pyx_v_params); - __Pyx_XDECREF(__pyx_v_params_iter); - __Pyx_XDECREF(__pyx_v_param); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":462 - * - * - * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_19wiener_like_multi_rlddm(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_18wiener_like_multi_rlddm, "wiener_like_multi_rlddm(ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)"); -static PyMethodDef __pyx_mdef_4wfpt_19wiener_like_multi_rlddm = {"wiener_like_multi_rlddm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_19wiener_like_multi_rlddm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_18wiener_like_multi_rlddm}; -static PyObject *__pyx_pw_4wfpt_19wiener_like_multi_rlddm(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_response = 0; - PyArrayObject *__pyx_v_feedback = 0; - PyArrayObject *__pyx_v_split_by = 0; - double __pyx_v_q; - PyObject *__pyx_v_v = 0; - PyObject *__pyx_v_sv = 0; - PyObject *__pyx_v_a = 0; - PyObject *__pyx_v_z = 0; - PyObject *__pyx_v_sz = 0; - PyObject *__pyx_v_t = 0; - PyObject *__pyx_v_st = 0; - PyObject *__pyx_v_alpha = 0; - double __pyx_v_err; - PyObject *__pyx_v_multi = 0; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_multi_rlddm (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 462, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_alpha,&__pyx_n_s_err,&__pyx_n_s_multi,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - - /* "wfpt.pyx":466 - * np.ndarray[double, ndim=1] feedback, - * np.ndarray[long, ndim=1] split_by, - * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - values[14] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 21: values[20] = __Pyx_Arg_FASTCALL(__pyx_args, 20); - CYTHON_FALLTHROUGH; - case 20: values[19] = __Pyx_Arg_FASTCALL(__pyx_args, 19); - CYTHON_FALLTHROUGH; - case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18); - CYTHON_FALLTHROUGH; - case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); - CYTHON_FALLTHROUGH; - case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); - CYTHON_FALLTHROUGH; - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 1); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 2); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 3); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 4); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 5); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 6); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 7); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 8); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 9); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[10]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 10); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[11]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 11); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[12]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 12); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[13]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, 13); __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 16: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[16] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 17: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[17] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 18: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[18] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 19: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[19] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 20: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[20] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_rlddm") < 0)) __PYX_ERR(0, 462, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 21: values[20] = __Pyx_Arg_FASTCALL(__pyx_args, 20); - CYTHON_FALLTHROUGH; - case 20: values[19] = __Pyx_Arg_FASTCALL(__pyx_args, 19); - CYTHON_FALLTHROUGH; - case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18); - CYTHON_FALLTHROUGH; - case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); - CYTHON_FALLTHROUGH; - case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); - CYTHON_FALLTHROUGH; - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_response = ((PyArrayObject *)values[1]); - __pyx_v_feedback = ((PyArrayObject *)values[2]); - __pyx_v_split_by = ((PyArrayObject *)values[3]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) - __pyx_v_v = values[5]; - __pyx_v_sv = values[6]; - __pyx_v_a = values[7]; - __pyx_v_z = values[8]; - __pyx_v_sz = values[9]; - __pyx_v_t = values[10]; - __pyx_v_st = values[11]; - __pyx_v_alpha = values[12]; - __pyx_v_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) - __pyx_v_multi = values[14]; - if (values[15]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)10)); - } - if (values[16]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)10)); - } - if (values[17]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[18]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[18]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-3)); - } - if (values[19]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[19]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[20]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[20]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_rlddm", 0, 14, 21, __pyx_nargs); __PYX_ERR(0, 462, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_multi_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 462, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 463, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 464, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 465, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_18wiener_like_multi_rlddm(__pyx_self, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_alpha, __pyx_v_err, __pyx_v_multi, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* "wfpt.pyx":462 - * - * - * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_18wiener_like_multi_rlddm(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyObject *__pyx_v_v, PyObject *__pyx_v_sv, PyObject *__pyx_v_a, PyObject *__pyx_v_z, PyObject *__pyx_v_sz, PyObject *__pyx_v_t, PyObject *__pyx_v_st, PyObject *__pyx_v_alpha, double __pyx_v_err, PyObject *__pyx_v_multi, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - Py_ssize_t __pyx_v_size; - double __pyx_v_p; - double __pyx_v_sum_logp; - double __pyx_v_wp_outlier; - PyArrayObject *__pyx_v_qs = 0; - PyObject *__pyx_v_params = NULL; - PyObject *__pyx_v_params_iter = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_param = NULL; - PyObject *__pyx_v_alfa = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; - __Pyx_Buffer __pyx_pybuffer_feedback; - __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; - __Pyx_Buffer __pyx_pybuffer_qs; - __Pyx_LocalBuf_ND __pyx_pybuffernd_response; - __Pyx_Buffer __pyx_pybuffer_response; - __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; - __Pyx_Buffer __pyx_pybuffer_split_by; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyArrayObject *__pyx_t_8 = NULL; - int __pyx_t_9; - double __pyx_t_10; - double __pyx_t_11; - double __pyx_t_12; - double __pyx_t_13; - double __pyx_t_14; - double __pyx_t_15; - double __pyx_t_16; - double __pyx_t_17; - double __pyx_t_18; - Py_ssize_t __pyx_t_19; - Py_ssize_t __pyx_t_20; - PyObject *(*__pyx_t_21)(PyObject *); - Py_ssize_t __pyx_t_22; - PyObject *(*__pyx_t_23)(PyObject *); - Py_ssize_t __pyx_t_24; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_25; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__14) - __Pyx_RefNannySetupContext("wiener_like_multi_rlddm", 0); - __Pyx_TraceCall("wiener_like_multi_rlddm", __pyx_f[0], 462, 0, __PYX_ERR(0, 462, __pyx_L1_error)); - __pyx_pybuffer_qs.pybuffer.buf = NULL; - __pyx_pybuffer_qs.refcount = 0; - __pyx_pybuffernd_qs.data = NULL; - __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - __pyx_pybuffer_response.pybuffer.buf = NULL; - __pyx_pybuffer_response.refcount = 0; - __pyx_pybuffernd_response.data = NULL; - __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; - __pyx_pybuffer_feedback.pybuffer.buf = NULL; - __pyx_pybuffer_feedback.refcount = 0; - __pyx_pybuffernd_feedback.data = NULL; - __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; - __pyx_pybuffer_split_by.pybuffer.buf = NULL; - __pyx_pybuffer_split_by.refcount = 0; - __pyx_pybuffernd_split_by.data = NULL; - __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) - } - __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) - } - __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 462, __pyx_L1_error) - } - __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":469 - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t ij - * cdef Py_ssize_t s_size - */ - __Pyx_TraceLine(469,0,__PYX_ERR(0, 469, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":472 - * cdef Py_ssize_t ij - * cdef Py_ssize_t s_size - * cdef double p = 0 # <<<<<<<<<<<<<< - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier - */ - __Pyx_TraceLine(472,0,__PYX_ERR(0, 472, __pyx_L1_error)) - __pyx_v_p = 0.0; - - /* "wfpt.pyx":473 - * cdef Py_ssize_t s_size - * cdef double p = 0 - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef double wp_outlier = w_outlier * p_outlier - * cdef int s - */ - __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":474 - * cdef double p = 0 - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * cdef int s - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - */ - __Pyx_TraceLine(474,0,__PYX_ERR(0, 474, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":476 - * cdef double wp_outlier = w_outlier * p_outlier - * cdef int s - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< - * - * if multi is None: - */ - __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 476, __pyx_L1_error) - __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 476, __pyx_L1_error) - } else {__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_t_8 = 0; - __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":478 - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - * - * if multi is None: # <<<<<<<<<<<<<< - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - */ - __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error)) - __pyx_t_9 = (__pyx_v_multi == Py_None); - if (__pyx_t_9) { - - /* "wfpt.pyx":479 - * - * if multi is None: - * return full_pdf(x, v, sv, a, z, sz, t, st, err) # <<<<<<<<<<<<<< - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} - */ - __Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_10 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_sv); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_z); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_sz); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_18 = __pyx_f_4wfpt_full_pdf(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_v_err, 0, NULL); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":478 - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - * - * if multi is None: # <<<<<<<<<<<<<< - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - */ - } - - /* "wfpt.pyx":481 - * return full_pdf(x, v, sv, a, z, sz, t, st, err) - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} # <<<<<<<<<<<<<< - * params_iter = copy(params) - * qs[0] = q - */ - __Pyx_TraceLine(481,0,__PYX_ERR(0, 481, __pyx_L1_error)) - /*else*/ { - __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_v, __pyx_v_v) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_z, __pyx_v_z) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_t, __pyx_v_t) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_a, __pyx_v_a) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_sv, __pyx_v_sv) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_sz, __pyx_v_sz) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_st, __pyx_v_st) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_alpha, __pyx_v_alpha) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - __pyx_v_params = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":482 - * else: - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} - * params_iter = copy(params) # <<<<<<<<<<<<<< - * qs[0] = q - * qs[1] = q - */ - __Pyx_TraceLine(482,0,__PYX_ERR(0, 482, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_params}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_v_params_iter = __pyx_t_2; - __pyx_t_2 = 0; - - /* "wfpt.pyx":483 - * params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} - * params_iter = copy(params) - * qs[0] = q # <<<<<<<<<<<<<< - * qs[1] = q - * for i in range(size): - */ - __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error)) - __pyx_t_19 = 0; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":484 - * params_iter = copy(params) - * qs[0] = q - * qs[1] = q # <<<<<<<<<<<<<< - * for i in range(size): - * for param in multi: - */ - __Pyx_TraceLine(484,0,__PYX_ERR(0, 484, __pyx_L1_error)) - __pyx_t_19 = 1; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":485 - * qs[0] = q - * qs[1] = q - * for i in range(size): # <<<<<<<<<<<<<< - * for param in multi: - * params_iter[param] = params[param][i] - */ - __Pyx_TraceLine(485,0,__PYX_ERR(0, 485, __pyx_L1_error)) - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_20 = 0; - __pyx_t_21 = NULL; - } else { - __pyx_t_20 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_21 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 485, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_21)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_20 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_20); __Pyx_INCREF(__pyx_t_4); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 485, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_20 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_20); __Pyx_INCREF(__pyx_t_4); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 485, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_21(__pyx_t_2); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 485, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); - __pyx_t_4 = 0; - - /* "wfpt.pyx":486 - * qs[1] = q - * for i in range(size): - * for param in multi: # <<<<<<<<<<<<<< - * params_iter[param] = params[param][i] - * - */ - __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error)) - if (likely(PyList_CheckExact(__pyx_v_multi)) || PyTuple_CheckExact(__pyx_v_multi)) { - __pyx_t_4 = __pyx_v_multi; __Pyx_INCREF(__pyx_t_4); __pyx_t_22 = 0; - __pyx_t_23 = NULL; - } else { - __pyx_t_22 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_multi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_23 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 486, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_23)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_22); __Pyx_INCREF(__pyx_t_6); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } else { - if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_22); __Pyx_INCREF(__pyx_t_6); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } - } else { - __pyx_t_6 = __pyx_t_23(__pyx_t_4); - if (unlikely(!__pyx_t_6)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 486, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_6); - } - __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_6); - __pyx_t_6 = 0; - - /* "wfpt.pyx":487 - * for i in range(size): - * for param in multi: - * params_iter[param] = params[param][i] # <<<<<<<<<<<<<< - * - * if (i != 0): - */ - __Pyx_TraceLine(487,0,__PYX_ERR(0, 487, __pyx_L1_error)) - __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_params, __pyx_v_param); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_params_iter, __pyx_v_param, __pyx_t_5) < 0))) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "wfpt.pyx":486 - * qs[1] = q - * for i in range(size): - * for param in multi: # <<<<<<<<<<<<<< - * params_iter[param] = params[param][i] - * - */ - __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error)) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":489 - * params_iter[param] = params[param][i] - * - * if (i != 0): # <<<<<<<<<<<<<< - * if (split_by[i] != split_by[i-1]): - * qs[0] = q - */ - __Pyx_TraceLine(489,0,__PYX_ERR(0, 489, __pyx_L1_error)) - __pyx_t_9 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_i, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 489, __pyx_L1_error) - if (__pyx_t_9) { - - /* "wfpt.pyx":490 - * - * if (i != 0): - * if (split_by[i] != split_by[i-1]): # <<<<<<<<<<<<<< - * qs[0] = q - * qs[1] = q - */ - __Pyx_TraceLine(490,0,__PYX_ERR(0, 490, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_split_by), __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_split_by), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_9) { - - /* "wfpt.pyx":491 - * if (i != 0): - * if (split_by[i] != split_by[i-1]): - * qs[0] = q # <<<<<<<<<<<<<< - * qs[1] = q - * - */ - __Pyx_TraceLine(491,0,__PYX_ERR(0, 491, __pyx_L1_error)) - __pyx_t_19 = 0; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":492 - * if (split_by[i] != split_by[i-1]): - * qs[0] = q - * qs[1] = q # <<<<<<<<<<<<<< - * - * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), - */ - __Pyx_TraceLine(492,0,__PYX_ERR(0, 492, __pyx_L1_error)) - __pyx_t_19 = 1; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":490 - * - * if (i != 0): - * if (split_by[i] != split_by[i-1]): # <<<<<<<<<<<<<< - * qs[0] = q - * qs[1] = q - */ - } - - /* "wfpt.pyx":489 - * params_iter[param] = params[param][i] - * - * if (i != 0): # <<<<<<<<<<<<<< - * if (split_by[i] != split_by[i-1]): - * qs[0] = q - */ - } - - /* "wfpt.pyx":494 - * qs[1] = q - * - * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), # <<<<<<<<<<<<<< - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter[ - */ - __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_19 = 1; - __pyx_t_24 = 0; - __pyx_t_6 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qs.diminfo[0].strides)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":495 - * - * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), - * params_iter['sv'], params_iter['a'], params_iter['z'], # <<<<<<<<<<<<<< - * params_iter['sz'], params_iter[ - * 't'], params_iter['st'], - */ - __Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":496 - * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter[ # <<<<<<<<<<<<<< - * 't'], params_iter['st'], - * err, n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_sz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":497 - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter[ - * 't'], params_iter['st'], # <<<<<<<<<<<<<< - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier - */ - __Pyx_TraceLine(497,0,__PYX_ERR(0, 497, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_st); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":494 - * qs[1] = q - * - * p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), # <<<<<<<<<<<<<< - * params_iter['sv'], params_iter['a'], params_iter['z'], - * params_iter['sz'], params_iter[ - */ - __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error)) - __pyx_t_25.__pyx_n = 4; - __pyx_t_25.n_st = __pyx_v_n_st; - __pyx_t_25.n_sz = __pyx_v_n_sz; - __pyx_t_25.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_25.simps_err = __pyx_v_simps_err; - __pyx_t_10 = __pyx_f_4wfpt_full_pdf(__pyx_t_18, __pyx_t_17, __pyx_t_16, __pyx_t_15, __pyx_t_14, __pyx_t_13, __pyx_t_12, __pyx_t_11, __pyx_v_err, 0, &__pyx_t_25); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error) - __pyx_v_p = __pyx_t_10; - - /* "wfpt.pyx":499 - * 't'], params_iter['st'], - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier # <<<<<<<<<<<<<< - * sum_logp += log(p) - * - */ - __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error)) - __pyx_v_p = ((__pyx_v_p * (1.0 - __pyx_v_p_outlier)) + __pyx_v_wp_outlier); - - /* "wfpt.pyx":500 - * err, n_st, n_sz, use_adaptive, simps_err) - * p = p * (1 - p_outlier) + wp_outlier - * sum_logp += log(p) # <<<<<<<<<<<<<< - * - * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) - */ - __Pyx_TraceLine(500,0,__PYX_ERR(0, 500, __pyx_L1_error)) - __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - - /* "wfpt.pyx":502 - * sum_logp += log(p) - * - * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) # <<<<<<<<<<<<<< - * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) - * - */ - __Pyx_TraceLine(502,0,__PYX_ERR(0, 502, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Power(__pyx_float_2_718281828459, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_params_iter, __pyx_n_u_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Power(__pyx_float_2_718281828459, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_5, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_alfa, __pyx_t_5); - __pyx_t_5 = 0; - - /* "wfpt.pyx":503 - * - * alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) - * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) # <<<<<<<<<<<<<< - * - * return sum_logp - */ - __Pyx_TraceLine(503,0,__PYX_ERR(0, 503, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qs), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qs), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_v_alfa, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qs), __pyx_t_3, __pyx_t_6) < 0))) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "wfpt.pyx":485 - * qs[0] = q - * qs[1] = q - * for i in range(size): # <<<<<<<<<<<<<< - * for param in multi: - * params_iter[param] = params[param][i] - */ - __Pyx_TraceLine(485,0,__PYX_ERR(0, 485, __pyx_L1_error)) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "wfpt.pyx":505 - * qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) - * - * return sum_logp # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - } - - /* "wfpt.pyx":462 - * - * - * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_multi_rlddm", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_qs); - __Pyx_XDECREF(__pyx_v_params); - __Pyx_XDECREF(__pyx_v_params_iter); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_param); - __Pyx_XDECREF(__pyx_v_alfa); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":508 - * - * - * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< - * np.ndarray[float, ndim=2] rl_arr, - * np.ndarray[double, ndim=1] x, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_20wiener_like_rlssm_nn_reg, "wiener_like_rlssm_nn_reg(ndarray data, ndarray rl_arr, ndarray x, ndarray response, ndarray feedback, ndarray split_by, double q, ndarray params_bnds, double p_outlier=0, double w_outlier=0, network=None)"); -static PyMethodDef __pyx_mdef_4wfpt_21wiener_like_rlssm_nn_reg = {"wiener_like_rlssm_nn_reg", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_20wiener_like_rlssm_nn_reg}; -static PyObject *__pyx_pw_4wfpt_21wiener_like_rlssm_nn_reg(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_data = 0; - PyArrayObject *__pyx_v_rl_arr = 0; - PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_response = 0; - PyArrayObject *__pyx_v_feedback = 0; - PyArrayObject *__pyx_v_split_by = 0; - double __pyx_v_q; - PyArrayObject *__pyx_v_params_bnds = 0; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - PyObject *__pyx_v_network = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_rlssm_nn_reg (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 508, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_rl_arr,&__pyx_n_s_x,&__pyx_n_s_response,&__pyx_n_s_feedback,&__pyx_n_s_split_by,&__pyx_n_s_q,&__pyx_n_s_params_bnds,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; - - /* "wfpt.pyx":516 - * double q, - * np.ndarray[double, ndim=2] params_bnds, - * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< - * cdef double rl_alpha - * cdef Py_ssize_t size = x.shape[0] - */ - values[10] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rl_arr)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 1); __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 2); __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_response)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 3); __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 4); __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_split_by)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 5); __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_q)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 6); __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params_bnds)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, 7); __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_rlssm_nn_reg") < 0)) __PYX_ERR(0, 508, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_data = ((PyArrayObject *)values[0]); - __pyx_v_rl_arr = ((PyArrayObject *)values[1]); - __pyx_v_x = ((PyArrayObject *)values[2]); - __pyx_v_response = ((PyArrayObject *)values[3]); - __pyx_v_feedback = ((PyArrayObject *)values[4]); - __pyx_v_split_by = ((PyArrayObject *)values[5]); - __pyx_v_q = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_q == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L3_error) - __pyx_v_params_bnds = ((PyArrayObject *)values[7]); - if (values[8]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[9]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - __pyx_v_network = values[10]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_rlssm_nn_reg", 0, 8, 11, __pyx_nargs); __PYX_ERR(0, 508, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn_reg", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 508, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rl_arr), __pyx_ptype_5numpy_ndarray, 1, "rl_arr", 0))) __PYX_ERR(0, 509, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 510, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_response), __pyx_ptype_5numpy_ndarray, 1, "response", 0))) __PYX_ERR(0, 511, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_feedback), __pyx_ptype_5numpy_ndarray, 1, "feedback", 0))) __PYX_ERR(0, 512, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_split_by), __pyx_ptype_5numpy_ndarray, 1, "split_by", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params_bnds), __pyx_ptype_5numpy_ndarray, 1, "params_bnds", 0))) __PYX_ERR(0, 515, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(__pyx_self, __pyx_v_data, __pyx_v_rl_arr, __pyx_v_x, __pyx_v_response, __pyx_v_feedback, __pyx_v_split_by, __pyx_v_q, __pyx_v_params_bnds, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); - - /* "wfpt.pyx":508 - * - * - * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< - * np.ndarray[float, ndim=2] rl_arr, - * np.ndarray[double, ndim=1] x, - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_20wiener_like_rlssm_nn_reg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_rl_arr, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_response, PyArrayObject *__pyx_v_feedback, PyArrayObject *__pyx_v_split_by, double __pyx_v_q, PyArrayObject *__pyx_v_params_bnds, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { - double __pyx_v_rl_alpha; - CYTHON_UNUSED Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - Py_ssize_t __pyx_v_j; - Py_ssize_t __pyx_v_i_p; - Py_ssize_t __pyx_v_s_size; - int __pyx_v_s; - CYTHON_UNUSED double __pyx_v_log_p; - double __pyx_v_sum_logp; - CYTHON_UNUSED double __pyx_v_wp_outlier; - double __pyx_v_alfa; - PyArrayObject *__pyx_v_qs = 0; - PyArrayObject *__pyx_v_xs = 0; - PyArrayObject *__pyx_v_feedbacks = 0; - PyArrayObject *__pyx_v_responses = 0; - PyArrayObject *__pyx_v_responses_qs = 0; - PyArrayObject *__pyx_v_unique = 0; - PyArrayObject *__pyx_v_data_copy = 0; - float __pyx_v_ll_min; - int __pyx_v_cumm_s_size; - PyObject *__pyx_v_lower_bnd = NULL; - PyObject *__pyx_v_upper_bnd = NULL; - PyObject *__pyx_v_tp_scale = NULL; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data_copy; - __Pyx_Buffer __pyx_pybuffer_data_copy; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedback; - __Pyx_Buffer __pyx_pybuffer_feedback; - __Pyx_LocalBuf_ND __pyx_pybuffernd_feedbacks; - __Pyx_Buffer __pyx_pybuffer_feedbacks; - __Pyx_LocalBuf_ND __pyx_pybuffernd_params_bnds; - __Pyx_Buffer __pyx_pybuffer_params_bnds; - __Pyx_LocalBuf_ND __pyx_pybuffernd_qs; - __Pyx_Buffer __pyx_pybuffer_qs; - __Pyx_LocalBuf_ND __pyx_pybuffernd_response; - __Pyx_Buffer __pyx_pybuffer_response; - __Pyx_LocalBuf_ND __pyx_pybuffernd_responses; - __Pyx_Buffer __pyx_pybuffer_responses; - __Pyx_LocalBuf_ND __pyx_pybuffernd_responses_qs; - __Pyx_Buffer __pyx_pybuffer_responses_qs; - __Pyx_LocalBuf_ND __pyx_pybuffernd_rl_arr; - __Pyx_Buffer __pyx_pybuffer_rl_arr; - __Pyx_LocalBuf_ND __pyx_pybuffernd_split_by; - __Pyx_Buffer __pyx_pybuffer_split_by; - __Pyx_LocalBuf_ND __pyx_pybuffernd_unique; - __Pyx_Buffer __pyx_pybuffer_unique; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_xs; - __Pyx_Buffer __pyx_pybuffer_xs; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyArrayObject *__pyx_t_8 = NULL; - PyArrayObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); - Py_ssize_t __pyx_t_14; - npy_intp __pyx_t_15; - npy_intp __pyx_t_16; - Py_ssize_t __pyx_t_17; - PyArrayObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - PyObject *__pyx_t_21 = NULL; - PyArrayObject *__pyx_t_22 = NULL; - PyArrayObject *__pyx_t_23 = NULL; - Py_ssize_t __pyx_t_24; - Py_ssize_t __pyx_t_25; - Py_ssize_t __pyx_t_26; - float __pyx_t_27; - Py_ssize_t __pyx_t_28; - Py_ssize_t __pyx_t_29; - Py_ssize_t __pyx_t_30; - Py_ssize_t __pyx_t_31; - Py_ssize_t __pyx_t_32; - PyObject *__pyx_t_33 = NULL; - PyObject *__pyx_t_34 = NULL; - double __pyx_t_35; - PyObject *__pyx_t_36 = NULL; - PyObject *__pyx_t_37 = NULL; - PyObject *__pyx_t_38 = NULL; - PyObject *__pyx_t_39 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__15) - __Pyx_RefNannySetupContext("wiener_like_rlssm_nn_reg", 0); - __Pyx_TraceCall("wiener_like_rlssm_nn_reg", __pyx_f[0], 508, 0, __PYX_ERR(0, 508, __pyx_L1_error)); - __pyx_pybuffer_qs.pybuffer.buf = NULL; - __pyx_pybuffer_qs.refcount = 0; - __pyx_pybuffernd_qs.data = NULL; - __pyx_pybuffernd_qs.rcbuffer = &__pyx_pybuffer_qs; - __pyx_pybuffer_xs.pybuffer.buf = NULL; - __pyx_pybuffer_xs.refcount = 0; - __pyx_pybuffernd_xs.data = NULL; - __pyx_pybuffernd_xs.rcbuffer = &__pyx_pybuffer_xs; - __pyx_pybuffer_feedbacks.pybuffer.buf = NULL; - __pyx_pybuffer_feedbacks.refcount = 0; - __pyx_pybuffernd_feedbacks.data = NULL; - __pyx_pybuffernd_feedbacks.rcbuffer = &__pyx_pybuffer_feedbacks; - __pyx_pybuffer_responses.pybuffer.buf = NULL; - __pyx_pybuffer_responses.refcount = 0; - __pyx_pybuffernd_responses.data = NULL; - __pyx_pybuffernd_responses.rcbuffer = &__pyx_pybuffer_responses; - __pyx_pybuffer_responses_qs.pybuffer.buf = NULL; - __pyx_pybuffer_responses_qs.refcount = 0; - __pyx_pybuffernd_responses_qs.data = NULL; - __pyx_pybuffernd_responses_qs.rcbuffer = &__pyx_pybuffer_responses_qs; - __pyx_pybuffer_unique.pybuffer.buf = NULL; - __pyx_pybuffer_unique.refcount = 0; - __pyx_pybuffernd_unique.data = NULL; - __pyx_pybuffernd_unique.rcbuffer = &__pyx_pybuffer_unique; - __pyx_pybuffer_data_copy.pybuffer.buf = NULL; - __pyx_pybuffer_data_copy.refcount = 0; - __pyx_pybuffernd_data_copy.data = NULL; - __pyx_pybuffernd_data_copy.rcbuffer = &__pyx_pybuffer_data_copy; - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - __pyx_pybuffer_rl_arr.pybuffer.buf = NULL; - __pyx_pybuffer_rl_arr.refcount = 0; - __pyx_pybuffernd_rl_arr.data = NULL; - __pyx_pybuffernd_rl_arr.rcbuffer = &__pyx_pybuffer_rl_arr; - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - __pyx_pybuffer_response.pybuffer.buf = NULL; - __pyx_pybuffer_response.refcount = 0; - __pyx_pybuffernd_response.data = NULL; - __pyx_pybuffernd_response.rcbuffer = &__pyx_pybuffer_response; - __pyx_pybuffer_feedback.pybuffer.buf = NULL; - __pyx_pybuffer_feedback.refcount = 0; - __pyx_pybuffernd_feedback.data = NULL; - __pyx_pybuffernd_feedback.rcbuffer = &__pyx_pybuffer_feedback; - __pyx_pybuffer_split_by.pybuffer.buf = NULL; - __pyx_pybuffer_split_by.refcount = 0; - __pyx_pybuffernd_split_by.data = NULL; - __pyx_pybuffernd_split_by.rcbuffer = &__pyx_pybuffer_split_by; - __pyx_pybuffer_params_bnds.pybuffer.buf = NULL; - __pyx_pybuffer_params_bnds.refcount = 0; - __pyx_pybuffernd_params_bnds.data = NULL; - __pyx_pybuffernd_params_bnds.rcbuffer = &__pyx_pybuffer_params_bnds; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) - } - __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rl_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rl_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) - } - __pyx_pybuffernd_rl_arr.diminfo[0].strides = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rl_arr.diminfo[0].shape = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rl_arr.diminfo[1].strides = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rl_arr.diminfo[1].shape = __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.shape[1]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_response.rcbuffer->pybuffer, (PyObject*)__pyx_v_response, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) - } - __pyx_pybuffernd_response.diminfo[0].strides = __pyx_pybuffernd_response.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_response.diminfo[0].shape = __pyx_pybuffernd_response.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedback, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) - } - __pyx_pybuffernd_feedback.diminfo[0].strides = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedback.diminfo[0].shape = __pyx_pybuffernd_feedback.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer, (PyObject*)__pyx_v_split_by, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) - } - __pyx_pybuffernd_split_by.diminfo[0].strides = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_split_by.diminfo[0].shape = __pyx_pybuffernd_split_by.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer, (PyObject*)__pyx_v_params_bnds, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 508, __pyx_L1_error) - } - __pyx_pybuffernd_params_bnds.diminfo[0].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_params_bnds.diminfo[0].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_params_bnds.diminfo[1].strides = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_params_bnds.diminfo[1].shape = __pyx_pybuffernd_params_bnds.rcbuffer->pybuffer.shape[1]; - - /* "wfpt.pyx":518 - * double p_outlier=0, double w_outlier=0, network = None): - * cdef double rl_alpha - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i, j, i_p - * cdef Py_ssize_t s_size - */ - __Pyx_TraceLine(518,0,__PYX_ERR(0, 518, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":522 - * cdef Py_ssize_t s_size - * cdef int s - * cdef double log_p = 0 # <<<<<<<<<<<<<< - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier - */ - __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error)) - __pyx_v_log_p = 0.0; - - /* "wfpt.pyx":523 - * cdef int s - * cdef double log_p = 0 - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef double wp_outlier = w_outlier * p_outlier - * cdef double alfa - */ - __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":524 - * cdef double log_p = 0 - * cdef double sum_logp = 0 - * cdef double wp_outlier = w_outlier * p_outlier # <<<<<<<<<<<<<< - * cdef double alfa - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - */ - __Pyx_TraceLine(524,0,__PYX_ERR(0, 524, __pyx_L1_error)) - __pyx_v_wp_outlier = (__pyx_v_w_outlier * __pyx_v_p_outlier); - - /* "wfpt.pyx":526 - * cdef double wp_outlier = w_outlier * p_outlier - * cdef double alfa - * cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim=1] xs - * cdef np.ndarray[double, ndim=1] feedbacks - */ - __Pyx_TraceLine(526,0,__PYX_ERR(0, 526, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 526, __pyx_L1_error) - __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_qs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 526, __pyx_L1_error) - } else {__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_t_8 = 0; - __pyx_v_qs = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":531 - * cdef np.ndarray[long, ndim=1] responses - * cdef np.ndarray[long, ndim=1] responses_qs - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) # <<<<<<<<<<<<<< - * cdef np.ndarray[float, ndim=2] data_copy = data - * cdef float ll_min = -16.11809 - */ - __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_split_by)}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 531, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unique.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_unique = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 531, __pyx_L1_error) - } else {__pyx_pybuffernd_unique.diminfo[0].strides = __pyx_pybuffernd_unique.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unique.diminfo[0].shape = __pyx_pybuffernd_unique.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_9 = 0; - __pyx_v_unique = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":532 - * cdef np.ndarray[long, ndim=1] responses_qs - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * cdef np.ndarray[float, ndim=2] data_copy = data # <<<<<<<<<<<<<< - * cdef float ll_min = -16.11809 - * cdef int cumm_s_size = 0 - */ - __Pyx_TraceLine(532,0,__PYX_ERR(0, 532, __pyx_L1_error)) - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data_copy.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_data), &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - __pyx_v_data_copy = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 532, __pyx_L1_error) - } else {__pyx_pybuffernd_data_copy.diminfo[0].strides = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data_copy.diminfo[0].shape = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data_copy.diminfo[1].strides = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data_copy.diminfo[1].shape = __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.shape[1]; - } - } - __Pyx_INCREF((PyObject *)__pyx_v_data); - __pyx_v_data_copy = ((PyArrayObject *)__pyx_v_data); - - /* "wfpt.pyx":533 - * cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - * cdef np.ndarray[float, ndim=2] data_copy = data - * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< - * cdef int cumm_s_size = 0 - * - */ - __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error)) - __pyx_v_ll_min = -16.11809; - - /* "wfpt.pyx":534 - * cdef np.ndarray[float, ndim=2] data_copy = data - * cdef float ll_min = -16.11809 - * cdef int cumm_s_size = 0 # <<<<<<<<<<<<<< - * - * if not p_outlier_in_range(p_outlier): - */ - __Pyx_TraceLine(534,0,__PYX_ERR(0, 534, __pyx_L1_error)) - __pyx_v_cumm_s_size = 0; - - /* "wfpt.pyx":536 - * cdef int cumm_s_size = 0 - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(536,0,__PYX_ERR(0, 536, __pyx_L1_error)) - __pyx_t_10 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_10); - if (__pyx_t_11) { - - /* "wfpt.pyx":537 - * - * if not p_outlier_in_range(p_outlier): - * return -np.inf # <<<<<<<<<<<<<< - * - * # Check for boundary violations -- if true, return -np.inf - */ - __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":536 - * cdef int cumm_s_size = 0 - * - * if not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":540 - * - * # Check for boundary violations -- if true, return -np.inf - * for i_p in np.arange(1, data.shape[1]-2): # <<<<<<<<<<<<<< - * lower_bnd = params_bnds[0][i_p] - * upper_bnd = params_bnds[1][i_p] - */ - __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_data)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(((__pyx_t_1[1]) - 2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_int_1, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 540, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 540, __pyx_L1_error) - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } else { - if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 540, __pyx_L1_error) - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_13(__pyx_t_4); - if (unlikely(!__pyx_t_2)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 540, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_i_p = __pyx_t_14; - - /* "wfpt.pyx":541 - * # Check for boundary violations -- if true, return -np.inf - * for i_p in np.arange(1, data.shape[1]-2): - * lower_bnd = params_bnds[0][i_p] # <<<<<<<<<<<<<< - * upper_bnd = params_bnds[1][i_p] - * - */ - __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error)) - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_lower_bnd, __pyx_t_6); - __pyx_t_6 = 0; - - /* "wfpt.pyx":542 - * for i_p in np.arange(1, data.shape[1]-2): - * lower_bnd = params_bnds[0][i_p] - * upper_bnd = params_bnds[1][i_p] # <<<<<<<<<<<<<< - * - * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: - */ - __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error)) - __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i_p, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_v_upper_bnd, __pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":544 - * upper_bnd = params_bnds[1][i_p] - * - * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(544,0,__PYX_ERR(0, 544, __pyx_L1_error)) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_slice__8); - __Pyx_GIVEREF(__pyx_slice__8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__8)) __PYX_ERR(0, 544, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[1] = {__pyx_t_6, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lower_bnd, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_10) { - } else { - __pyx_t_11 = __pyx_t_10; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__8); - __Pyx_GIVEREF(__pyx_slice__8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__8)) __PYX_ERR(0, 544, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[1] = {__pyx_t_2, }; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_upper_bnd, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_11 = __pyx_t_10; - __pyx_L7_bool_binop_done:; - if (__pyx_t_11) { - - /* "wfpt.pyx":545 - * - * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: - * return -np.inf # <<<<<<<<<<<<<< - * - * # unique represent # of conditions - */ - __Pyx_TraceLine(545,0,__PYX_ERR(0, 545, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":544 - * upper_bnd = params_bnds[1][i_p] - * - * if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":540 - * - * # Check for boundary violations -- if true, return -np.inf - * for i_p in np.arange(1, data.shape[1]-2): # <<<<<<<<<<<<<< - * lower_bnd = params_bnds[0][i_p] - * upper_bnd = params_bnds[1][i_p] - */ - __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error)) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":548 - * - * # unique represent # of conditions - * for j in range(unique.shape[0]): # <<<<<<<<<<<<<< - * s = unique[j] - * # select trials for current condition, identified by the split_by-array - */ - __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_unique)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L1_error) - __pyx_t_15 = (__pyx_t_1[0]); - __pyx_t_16 = __pyx_t_15; - for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_16; __pyx_t_12+=1) { - __pyx_v_j = __pyx_t_12; - - /* "wfpt.pyx":549 - * # unique represent # of conditions - * for j in range(unique.shape[0]): - * s = unique[j] # <<<<<<<<<<<<<< - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] - */ - __Pyx_TraceLine(549,0,__PYX_ERR(0, 549, __pyx_L1_error)) - __pyx_t_17 = __pyx_v_j; - __pyx_v_s = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_unique.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_unique.diminfo[0].strides)); - - /* "wfpt.pyx":551 - * s = unique[j] - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] # <<<<<<<<<<<<<< - * responses = response[split_by == s] - * xs = x[split_by == s] - */ - __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_feedback), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 551, __pyx_L1_error) - __pyx_t_18 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer, (PyObject*)__pyx_v_feedbacks, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21); - } - __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0; - } - __pyx_pybuffernd_feedbacks.diminfo[0].strides = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_feedbacks.diminfo[0].shape = __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) - } - __pyx_t_18 = 0; - __Pyx_XDECREF_SET(__pyx_v_feedbacks, ((PyArrayObject *)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "wfpt.pyx":552 - * # select trials for current condition, identified by the split_by-array - * feedbacks = feedback[split_by == s] - * responses = response[split_by == s] # <<<<<<<<<<<<<< - * xs = x[split_by == s] - * s_size = xs.shape[0] - */ - __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 552, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_response), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 552, __pyx_L1_error) - __pyx_t_22 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19); - } - __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0; - } - __pyx_pybuffernd_responses.diminfo[0].strides = __pyx_pybuffernd_responses.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses.diminfo[0].shape = __pyx_pybuffernd_responses.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 552, __pyx_L1_error) - } - __pyx_t_22 = 0; - __Pyx_XDECREF_SET(__pyx_v_responses, ((PyArrayObject *)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "wfpt.pyx":553 - * feedbacks = feedback[split_by == s] - * responses = response[split_by == s] - * xs = x[split_by == s] # <<<<<<<<<<<<<< - * s_size = xs.shape[0] - * qs[0] = q - */ - __Pyx_TraceLine(553,0,__PYX_ERR(0, 553, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_split_by), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_23 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xs.rcbuffer->pybuffer, (PyObject*)__pyx_v_xs, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21); - } - __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0; - } - __pyx_pybuffernd_xs.diminfo[0].strides = __pyx_pybuffernd_xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xs.diminfo[0].shape = __pyx_pybuffernd_xs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 553, __pyx_L1_error) - } - __pyx_t_23 = 0; - __Pyx_XDECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "wfpt.pyx":554 - * responses = response[split_by == s] - * xs = x[split_by == s] - * s_size = xs.shape[0] # <<<<<<<<<<<<<< - * qs[0] = q - * qs[1] = q - */ - __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_xs)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L1_error) - __pyx_v_s_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":555 - * xs = x[split_by == s] - * s_size = xs.shape[0] - * qs[0] = q # <<<<<<<<<<<<<< - * qs[1] = q - * - */ - __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error)) - __pyx_t_17 = 0; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":556 - * s_size = xs.shape[0] - * qs[0] = q - * qs[1] = q # <<<<<<<<<<<<<< - * - * responses_qs = responses - */ - __Pyx_TraceLine(556,0,__PYX_ERR(0, 556, __pyx_L1_error)) - __pyx_t_17 = 1; - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides) = __pyx_v_q; - - /* "wfpt.pyx":558 - * qs[1] = q - * - * responses_qs = responses # <<<<<<<<<<<<<< - * responses_qs[responses_qs == -1] = 0 - * - */ - __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error)) - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_responses), &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer, (PyObject*)__pyx_v_responses_qs, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19); - } - __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0; - } - __pyx_pybuffernd_responses_qs.diminfo[0].strides = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_responses_qs.diminfo[0].shape = __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) - } - __Pyx_INCREF((PyObject *)__pyx_v_responses); - __Pyx_XDECREF_SET(__pyx_v_responses_qs, ((PyArrayObject *)__pyx_v_responses)); - - /* "wfpt.pyx":559 - * - * responses_qs = responses - * responses_qs[responses_qs == -1] = 0 # <<<<<<<<<<<<<< - * - * # loop through all trials in current condition - */ - __Pyx_TraceLine(559,0,__PYX_ERR(0, 559, __pyx_L1_error)) - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_responses_qs), __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error) - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_responses_qs), __pyx_t_4, __pyx_int_0) < 0))) __PYX_ERR(0, 559, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":562 - * - * # loop through all trials in current condition - * for i in range(0, s_size): # <<<<<<<<<<<<<< - * tp_scale = data[cumm_s_size + i, 0] - * if tp_scale < 0: - */ - __Pyx_TraceLine(562,0,__PYX_ERR(0, 562, __pyx_L1_error)) - __pyx_t_14 = __pyx_v_s_size; - __pyx_t_24 = __pyx_t_14; - for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { - __pyx_v_i = __pyx_t_25; - - /* "wfpt.pyx":563 - * # loop through all trials in current condition - * for i in range(0, s_size): - * tp_scale = data[cumm_s_size + i, 0] # <<<<<<<<<<<<<< - * if tp_scale < 0: - * return -np.inf - */ - __Pyx_TraceLine(563,0,__PYX_ERR(0, 563, __pyx_L1_error)) - __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); - __pyx_t_26 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_tp_scale, __pyx_t_4); - __pyx_t_4 = 0; - - /* "wfpt.pyx":564 - * for i in range(0, s_size): - * tp_scale = data[cumm_s_size + i, 0] - * if tp_scale < 0: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error)) - __pyx_t_4 = PyObject_RichCompare(__pyx_v_tp_scale, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 564, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_11) { - - /* "wfpt.pyx":565 - * tp_scale = data[cumm_s_size + i, 0] - * if tp_scale < 0: - * return -np.inf # <<<<<<<<<<<<<< - * - * data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale - */ - __Pyx_TraceLine(565,0,__PYX_ERR(0, 565, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":564 - * for i in range(0, s_size): - * tp_scale = data[cumm_s_size + i, 0] - * if tp_scale < 0: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":567 - * return -np.inf - * - * data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale # <<<<<<<<<<<<<< - * - * # Check for boundary violations -- if true, return -np.inf - */ - __Pyx_TraceLine(567,0,__PYX_ERR(0, 567, __pyx_L1_error)) - __pyx_t_26 = 1; - __pyx_t_17 = 0; - __pyx_t_4 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_qs.diminfo[0].strides)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_v_tp_scale); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_27 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_27 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); - __pyx_t_26 = 0; - *__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[1].strides) = __pyx_t_27; - - /* "wfpt.pyx":570 - * - * # Check for boundary violations -- if true, return -np.inf - * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - __Pyx_TraceLine(570,0,__PYX_ERR(0, 570, __pyx_L1_error)) - __pyx_t_26 = (__pyx_v_cumm_s_size + __pyx_v_i); - __pyx_t_17 = 0; - __pyx_t_6 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[1].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_10) { - } else { - __pyx_t_11 = __pyx_t_10; - goto __pyx_L16_bool_binop_done; - } - __pyx_t_17 = (__pyx_v_cumm_s_size + __pyx_v_i); - __pyx_t_26 = 0; - __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_data_copy.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_data_copy.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_data_copy.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_params_bnds), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_t_10; - __pyx_L16_bool_binop_done:; - if (__pyx_t_11) { - - /* "wfpt.pyx":571 - * # Check for boundary violations -- if true, return -np.inf - * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: - * return -np.inf # <<<<<<<<<<<<<< - * - * rl_alpha = rl_arr[cumm_s_size + i, 0] - */ - __Pyx_TraceLine(571,0,__PYX_ERR(0, 571, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":570 - * - * # Check for boundary violations -- if true, return -np.inf - * if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: # <<<<<<<<<<<<<< - * return -np.inf - * - */ - } - - /* "wfpt.pyx":573 - * return -np.inf - * - * rl_alpha = rl_arr[cumm_s_size + i, 0] # <<<<<<<<<<<<<< - * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - * - */ - __Pyx_TraceLine(573,0,__PYX_ERR(0, 573, __pyx_L1_error)) - __pyx_t_26 = (__pyx_v_cumm_s_size + __pyx_v_i); - __pyx_t_17 = 0; - __pyx_v_rl_alpha = (*__Pyx_BufPtrStrided2d(float *, __pyx_pybuffernd_rl_arr.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rl_arr.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_rl_arr.diminfo[1].strides)); - - /* "wfpt.pyx":574 - * - * rl_alpha = rl_arr[cumm_s_size + i, 0] - * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) # <<<<<<<<<<<<<< - * - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ - */ - __Pyx_TraceLine(574,0,__PYX_ERR(0, 574, __pyx_L1_error)) - __pyx_v_alfa = (pow(2.718281828459, __pyx_v_rl_alpha) / (1.0 + pow(2.718281828459, __pyx_v_rl_alpha))); - - /* "wfpt.pyx":576 - * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - * - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[i] - qs[responses_qs[i]]) - * cumm_s_size += s_size - */ - __Pyx_TraceLine(576,0,__PYX_ERR(0, 576, __pyx_L1_error)) - __pyx_t_17 = __pyx_v_i; - __pyx_t_26 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - - /* "wfpt.pyx":577 - * - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ - * alfa * (feedbacks[i] - qs[responses_qs[i]]) # <<<<<<<<<<<<<< - * cumm_s_size += s_size - * - */ - __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error)) - __pyx_t_28 = __pyx_v_i; - __pyx_t_29 = __pyx_v_i; - __pyx_t_30 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - - /* "wfpt.pyx":576 - * alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - * - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ # <<<<<<<<<<<<<< - * alfa * (feedbacks[i] - qs[responses_qs[i]]) - * cumm_s_size += s_size - */ - __Pyx_TraceLine(576,0,__PYX_ERR(0, 576, __pyx_L1_error)) - __pyx_t_31 = __pyx_v_i; - __pyx_t_32 = (*__Pyx_BufPtrStrided1d(long *, __pyx_pybuffernd_responses_qs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_responses_qs.diminfo[0].strides)); - *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_qs.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_qs.diminfo[0].strides)) + (__pyx_v_alfa * ((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_feedbacks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_feedbacks.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_qs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_qs.diminfo[0].strides))))); - } - - /* "wfpt.pyx":578 - * qs[responses_qs[i]] = qs[responses_qs[i]] + \ - * alfa * (feedbacks[i] - qs[responses_qs[i]]) - * cumm_s_size += s_size # <<<<<<<<<<<<<< - * - * # Call to network: - */ - __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error)) - __pyx_v_cumm_s_size = (__pyx_v_cumm_s_size + __pyx_v_s_size); - } - - /* "wfpt.pyx":581 - * - * # Call to network: - * if p_outlier == 0: # <<<<<<<<<<<<<< - * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) - * else: - */ - __Pyx_TraceLine(581,0,__PYX_ERR(0, 581, __pyx_L1_error)) - __pyx_t_11 = (__pyx_v_p_outlier == 0.0); - if (__pyx_t_11) { - - /* "wfpt.pyx":582 - * # Call to network: - * if p_outlier == 0: - * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) # <<<<<<<<<<<<<< - * else: - * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - */ - __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_umath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_maximum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __pyx_t_34 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_33))) { - __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_33); - if (likely(__pyx_t_34)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); - __Pyx_INCREF(__pyx_t_34); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_33, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_34, ((PyObject *)__pyx_v_data_copy)}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - } - __pyx_t_33 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __pyx_t_34 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_34)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_34); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_34, __pyx_t_2, __pyx_t_33}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_3 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_sum_logp = __pyx_t_35; - - /* "wfpt.pyx":581 - * - * # Call to network: - * if p_outlier == 0: # <<<<<<<<<<<<<< - * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) - * else: - */ - goto __pyx_L18; - } - - /* "wfpt.pyx":584 - * sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) - * else: - * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< - * - * return sum_logp - */ - __Pyx_TraceLine(584,0,__PYX_ERR(0, 584, __pyx_L1_error)) - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_34); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_core); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_umath); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_maximum); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_37); - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __pyx_t_39 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_38))) { - __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_38); - if (likely(__pyx_t_39)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_38); - __Pyx_INCREF(__pyx_t_39); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_38, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_39, ((PyObject *)__pyx_v_data_copy)}; - __pyx_t_36 = __Pyx_PyObject_FastCall(__pyx_t_38, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; - if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_36); - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - } - __pyx_t_38 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_38); - __pyx_t_39 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_37))) { - __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_37); - if (likely(__pyx_t_39)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37); - __Pyx_INCREF(__pyx_t_39); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_37, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_39, __pyx_t_36, __pyx_t_38}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_37, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; - __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; - } - __pyx_t_37 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_34))) { - __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_34); - if (likely(__pyx_t_37)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34); - __Pyx_INCREF(__pyx_t_37); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_34, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_37, __pyx_t_2}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_34, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - } - __pyx_t_34 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_34); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_34); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __pyx_t_34 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_34); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_34); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __pyx_t_34 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_33))) { - __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_33); - if (likely(__pyx_t_34)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); - __Pyx_INCREF(__pyx_t_34); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_33, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - } - __pyx_t_33 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_33)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_33); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_33, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_35 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_sum_logp = __pyx_t_35; - } - __pyx_L18:; - - /* "wfpt.pyx":586 - * sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - * - * return sum_logp # <<<<<<<<<<<<<< - * - * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, - */ - __Pyx_TraceLine(586,0,__PYX_ERR(0, 586, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":508 - * - * - * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< - * np.ndarray[float, ndim=2] rl_arr, - * np.ndarray[double, ndim=1] x, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_33); - __Pyx_XDECREF(__pyx_t_34); - __Pyx_XDECREF(__pyx_t_36); - __Pyx_XDECREF(__pyx_t_37); - __Pyx_XDECREF(__pyx_t_38); - __Pyx_XDECREF(__pyx_t_39); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data_copy.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rl_arr.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_rlssm_nn_reg", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data_copy.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedback.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_feedbacks.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_params_bnds.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_response.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_responses_qs.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rl_arr.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_split_by.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unique.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xs.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_qs); - __Pyx_XDECREF((PyObject *)__pyx_v_xs); - __Pyx_XDECREF((PyObject *)__pyx_v_feedbacks); - __Pyx_XDECREF((PyObject *)__pyx_v_responses); - __Pyx_XDECREF((PyObject *)__pyx_v_responses_qs); - __Pyx_XDECREF((PyObject *)__pyx_v_unique); - __Pyx_XDECREF((PyObject *)__pyx_v_data_copy); - __Pyx_XDECREF(__pyx_v_lower_bnd); - __Pyx_XDECREF(__pyx_v_upper_bnd); - __Pyx_XDECREF(__pyx_v_tp_scale); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":588 - * return sum_logp - * - * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< - * double sv, double a, double z, double sz, double t, double st, double t_min, - * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_23wiener_like_contaminant(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_22wiener_like_contaminant, "wiener_like_contaminant(ndarray x, ndarray cont_x, double v, double sv, double a, double z, double sz, double t, double st, double t_min, double t_max, double err, int n_st=10, int n_sz=10, bool use_adaptive=1, double simps_err=1e-8)\nWiener likelihood function where RTs could come from a\n separate, uniform contaminant distribution.\n\n Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007)\n "); -static PyMethodDef __pyx_mdef_4wfpt_23wiener_like_contaminant = {"wiener_like_contaminant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_23wiener_like_contaminant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_22wiener_like_contaminant}; -static PyObject *__pyx_pw_4wfpt_23wiener_like_contaminant(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_cont_x = 0; - double __pyx_v_v; - double __pyx_v_sv; - double __pyx_v_a; - double __pyx_v_z; - double __pyx_v_sz; - double __pyx_v_t; - double __pyx_v_st; - double __pyx_v_t_min; - double __pyx_v_t_max; - double __pyx_v_err; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_contaminant (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 588, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_cont_x,&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_t_min,&__pyx_n_s_t_max,&__pyx_n_s_err,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cont_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 1); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 2); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 3); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 4); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 5); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 6); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 7); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 8); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_min)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 9); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_max)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[10]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 10); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[11]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, 11); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_contaminant") < 0)) __PYX_ERR(0, 588, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_cont_x = ((PyArrayObject *)values[1]); - __pyx_v_v = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) - __pyx_v_t_min = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_t_min == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) - __pyx_v_t_max = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_t_max == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) - __pyx_v_err = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) - if (values[12]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)10)); - } - if (values[13]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)10)); - } - if (values[14]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[15]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-8)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_contaminant", 0, 12, 16, __pyx_nargs); __PYX_ERR(0, 588, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_contaminant", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 588, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cont_x), __pyx_ptype_5numpy_ndarray, 1, "cont_x", 0))) __PYX_ERR(0, 588, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_22wiener_like_contaminant(__pyx_self, __pyx_v_x, __pyx_v_cont_x, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_t_min, __pyx_v_t_max, __pyx_v_err, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_22wiener_like_contaminant(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_cont_x, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_t_min, double __pyx_v_t_max, double __pyx_v_err, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err) { - CYTHON_UNUSED Py_ssize_t __pyx_v_size; - Py_ssize_t __pyx_v_i; - double __pyx_v_p; - double __pyx_v_sum_logp; - int __pyx_v_n_cont; - CYTHON_UNUSED int __pyx_v_pos_cont; - __Pyx_LocalBuf_ND __pyx_pybuffernd_cont_x; - __Pyx_Buffer __pyx_pybuffer_cont_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - npy_intp *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - Py_ssize_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - int __pyx_t_10; - double __pyx_t_11; - struct __pyx_opt_args_4wfpt_full_pdf __pyx_t_12; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__16) - __Pyx_RefNannySetupContext("wiener_like_contaminant", 0); - __Pyx_TraceCall("wiener_like_contaminant", __pyx_f[0], 588, 0, __PYX_ERR(0, 588, __pyx_L1_error)); - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - __pyx_pybuffer_cont_x.pybuffer.buf = NULL; - __pyx_pybuffer_cont_x.refcount = 0; - __pyx_pybuffernd_cont_x.data = NULL; - __pyx_pybuffernd_cont_x.rcbuffer = &__pyx_pybuffer_cont_x; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cont_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_cont_x, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 588, __pyx_L1_error) - } - __pyx_pybuffernd_cont_x.diminfo[0].strides = __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cont_x.diminfo[0].shape = __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":597 - * Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007) - * """ - * cdef Py_ssize_t size = x.shape[0] # <<<<<<<<<<<<<< - * cdef Py_ssize_t i - * cdef double p - */ - __Pyx_TraceLine(597,0,__PYX_ERR(0, 597, __pyx_L1_error)) - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L1_error) - __pyx_v_size = (__pyx_t_1[0]); - - /* "wfpt.pyx":600 - * cdef Py_ssize_t i - * cdef double p - * cdef double sum_logp = 0 # <<<<<<<<<<<<<< - * cdef int n_cont = np.sum(cont_x) - * cdef int pos_cont = 0 - */ - __Pyx_TraceLine(600,0,__PYX_ERR(0, 600, __pyx_L1_error)) - __pyx_v_sum_logp = 0.0; - - /* "wfpt.pyx":601 - * cdef double p - * cdef double sum_logp = 0 - * cdef int n_cont = np.sum(cont_x) # <<<<<<<<<<<<<< - * cdef int pos_cont = 0 - * - */ - __Pyx_TraceLine(601,0,__PYX_ERR(0, 601, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_cont_x)}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_n_cont = __pyx_t_5; - - /* "wfpt.pyx":602 - * cdef double sum_logp = 0 - * cdef int n_cont = np.sum(cont_x) - * cdef int pos_cont = 0 # <<<<<<<<<<<<<< - * - * for i in prange(size, nogil=True): - */ - __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error)) - __pyx_v_pos_cont = 0; - - /* "wfpt.pyx":604 - * cdef int pos_cont = 0 - * - * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< - * if cont_x[i] == 0: - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - */ - __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error)) - { - #ifdef WITH_THREAD - PyThreadState *_save; - _save = NULL; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { - __pyx_t_6 = __pyx_v_size; - { - Py_ssize_t __pyx_parallel_temp0 = ((Py_ssize_t)0xbad0bad0); - double __pyx_parallel_temp1 = ((double)__PYX_NAN()); - double __pyx_parallel_temp2 = ((double)__PYX_NAN()); - const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0; - PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL; - int __pyx_parallel_why; - __pyx_parallel_why = 0; - #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) - #undef likely - #undef unlikely - #define likely(x) (x) - #define unlikely(x) (x) - #endif - __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_8 > 0) - { - #ifdef _OPENMP - #pragma omp parallel reduction(+:__pyx_v_sum_logp) private(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_9) firstprivate(__pyx_t_2, __pyx_t_4) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) - #endif /* _OPENMP */ - { - #ifdef _OPENMP - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - Py_BEGIN_ALLOW_THREADS - #endif /* _OPENMP */ - #ifdef _OPENMP - #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_p) - #endif /* _OPENMP */ - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ - if (__pyx_parallel_why < 2) - { - __pyx_v_i = (Py_ssize_t)(0 + 1 * __pyx_t_7); - /* Initialize private variables to invalid values */ - __pyx_v_p = ((double)__PYX_NAN()); - - /* "wfpt.pyx":605 - * - * for i in prange(size, nogil=True): - * if cont_x[i] == 0: # <<<<<<<<<<<<<< - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) - */ - __Pyx_TraceLine(605,1,__PYX_ERR(0, 605, __pyx_L8_error)) - __pyx_t_9 = __pyx_v_i; - __pyx_t_10 = ((*__Pyx_BufPtrStrided1d(int *, __pyx_pybuffernd_cont_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_cont_x.diminfo[0].strides)) == 0); - if (__pyx_t_10) { - - /* "wfpt.pyx":606 - * for i in prange(size, nogil=True): - * if cont_x[i] == 0: - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, # <<<<<<<<<<<<<< - * n_st, n_sz, use_adaptive, simps_err) - * if p == 0: - */ - __Pyx_TraceLine(606,1,__PYX_ERR(0, 606, __pyx_L8_error)) - __pyx_t_9 = __pyx_v_i; - - /* "wfpt.pyx":607 - * if cont_x[i] == 0: - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) # <<<<<<<<<<<<<< - * if p == 0: - * with gil: - */ - __Pyx_TraceLine(607,1,__PYX_ERR(0, 607, __pyx_L8_error)) - __pyx_t_12.__pyx_n = 4; - __pyx_t_12.n_st = __pyx_v_n_st; - __pyx_t_12.n_sz = __pyx_v_n_sz; - __pyx_t_12.use_adaptive = __pyx_v_use_adaptive; - __pyx_t_12.simps_err = __pyx_v_simps_err; - __pyx_t_11 = __pyx_f_4wfpt_full_pdf((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, 0, &__pyx_t_12); if (unlikely(__pyx_t_11 == ((double)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 606, __pyx_L8_error) - __pyx_v_p = __pyx_t_11; - - /* "wfpt.pyx":608 - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) - * if p == 0: # <<<<<<<<<<<<<< - * with gil: - * return -np.inf - */ - __Pyx_TraceLine(608,1,__PYX_ERR(0, 608, __pyx_L8_error)) - __pyx_t_10 = (__pyx_v_p == 0.0); - if (__pyx_t_10) { - - /* "wfpt.pyx":609 - * n_st, n_sz, use_adaptive, simps_err) - * if p == 0: - * with gil: # <<<<<<<<<<<<<< - * return -np.inf - * sum_logp += log(p) - */ - __Pyx_TraceLine(609,1,__PYX_ERR(0, 609, __pyx_L8_error)) - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - /*try:*/ { - - /* "wfpt.pyx":610 - * if p == 0: - * with gil: - * return -np.inf # <<<<<<<<<<<<<< - * sum_logp += log(p) - * # If one probability = 0, the log sum will be -Inf - */ - __Pyx_TraceLine(610,0,__PYX_ERR(0, 610, __pyx_L15_error)) - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L14_return; - } - - /* "wfpt.pyx":609 - * n_st, n_sz, use_adaptive, simps_err) - * if p == 0: - * with gil: # <<<<<<<<<<<<<< - * return -np.inf - * sum_logp += log(p) - */ - __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L15_error)) - /*finally:*/ { - __pyx_L14_return: { - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - goto __pyx_L9_return; - } - __pyx_L15_error: { - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - goto __pyx_L8_error; - } - } - } - - /* "wfpt.pyx":608 - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) - * if p == 0: # <<<<<<<<<<<<<< - * with gil: - * return -np.inf - */ - } - - /* "wfpt.pyx":611 - * with gil: - * return -np.inf - * sum_logp += log(p) # <<<<<<<<<<<<<< - * # If one probability = 0, the log sum will be -Inf - * - */ - __Pyx_TraceLine(611,1,__PYX_ERR(0, 611, __pyx_L8_error)) - __pyx_v_sum_logp = (__pyx_v_sum_logp + log(__pyx_v_p)); - - /* "wfpt.pyx":605 - * - * for i in prange(size, nogil=True): - * if cont_x[i] == 0: # <<<<<<<<<<<<<< - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - * n_st, n_sz, use_adaptive, simps_err) - */ - } - goto __pyx_L18; - __pyx_L9_return:; - __pyx_parallel_why = 3; - goto __pyx_L17; - __pyx_L8_error:; - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - #ifdef _OPENMP - #pragma omp flush(__pyx_parallel_exc_type) - #endif /* _OPENMP */ - if (!__pyx_parallel_exc_type) { - __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb); - __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno; - __Pyx_GOTREF(__pyx_parallel_exc_type); - } - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - } - __pyx_parallel_why = 4; - goto __pyx_L17; - __pyx_L17:; - #ifdef _OPENMP - #pragma omp critical(__pyx_parallel_lastprivates1) - #endif /* _OPENMP */ - { - __pyx_parallel_temp0 = __pyx_v_i; - __pyx_parallel_temp1 = __pyx_v_p; - __pyx_parallel_temp2 = __pyx_v_sum_logp; - } - __pyx_L18:; - #ifdef _OPENMP - #pragma omp flush(__pyx_parallel_why) - #endif /* _OPENMP */ - } - } - #ifdef _OPENMP - Py_END_ALLOW_THREADS - #else -{ -#ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - #endif /* _OPENMP */ - /* Clean up any temporaries */ - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - #ifndef _OPENMP -} -#endif /* _OPENMP */ - } - } - if (__pyx_parallel_exc_type) { - /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */ - __pyx_parallel_why = 4; - } - if (__pyx_parallel_why) { - __pyx_v_i = __pyx_parallel_temp0; - __pyx_v_p = __pyx_parallel_temp1; - __pyx_v_sum_logp = __pyx_parallel_temp2; - switch (__pyx_parallel_why) { - case 4: - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_GIVEREF(__pyx_parallel_exc_type); - __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); - __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - } - goto __pyx_L4_error; - } - } - } - #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) - #undef likely - #undef unlikely - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #endif - } - - /* "wfpt.pyx":604 - * cdef int pos_cont = 0 - * - * for i in prange(size, nogil=True): # <<<<<<<<<<<<<< - * if cont_x[i] == 0: - * p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - */ - __Pyx_TraceLine(604,1,__PYX_ERR(0, 604, __pyx_L4_error)) - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L4_error: { - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L1_error; - } - __pyx_L5:; - } - } - - /* "wfpt.pyx":615 - * - * # add the log likelihood of the contaminations - * sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) # <<<<<<<<<<<<<< - * - * return sum_logp - */ - __Pyx_TraceLine(615,0,__PYX_ERR(0, 615, __pyx_L1_error)) - __pyx_v_sum_logp = (__pyx_v_sum_logp + (__pyx_v_n_cont * log(((0.5 * 1.) / (__pyx_v_t_max - __pyx_v_t_min))))); - - /* "wfpt.pyx":617 - * sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) - * - * return sum_logp # <<<<<<<<<<<<<< - * - * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, - */ - __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_logp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":588 - * return sum_logp - * - * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< - * double sv, double a, double z, double sz, double t, double st, double t_min, - * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cont_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_contaminant", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cont_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":619 - * return sum_logp - * - * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< - * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_25gen_cdf_using_pdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_24gen_cdf_using_pdf, "gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, int N=500, double time=5., int n_st=2, int n_sz=2, bool use_adaptive=1, double simps_err=1e-3, double p_outlier=0, double w_outlier=0)\n\n generate cdf vector using the pdf\n "); -static PyMethodDef __pyx_mdef_4wfpt_25gen_cdf_using_pdf = {"gen_cdf_using_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_25gen_cdf_using_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_24gen_cdf_using_pdf}; -static PyObject *__pyx_pw_4wfpt_25gen_cdf_using_pdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - double __pyx_v_v; - double __pyx_v_sv; - double __pyx_v_a; - double __pyx_v_z; - double __pyx_v_sz; - double __pyx_v_t; - double __pyx_v_st; - double __pyx_v_err; - int __pyx_v_N; - double __pyx_v_time; - int __pyx_v_n_st; - int __pyx_v_n_sz; - int __pyx_v_use_adaptive; - double __pyx_v_simps_err; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("gen_cdf_using_pdf (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 619, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_sv,&__pyx_n_s_a,&__pyx_n_s_z,&__pyx_n_s_sz,&__pyx_n_s_t,&__pyx_n_s_st,&__pyx_n_s_err,&__pyx_n_s_N,&__pyx_n_s_time,&__pyx_n_s_n_st,&__pyx_n_s_n_sz,&__pyx_n_s_use_adaptive,&__pyx_n_s_simps_err,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sv)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 1); __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 2); __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 3); __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sz)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 4); __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 5); __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 6); __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, 7); __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_N); - if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time); - if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_st); - if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n_sz); - if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_adaptive); - if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_simps_err); - if (value) { values[13] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[14] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[15] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gen_cdf_using_pdf") < 0)) __PYX_ERR(0, 619, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_v = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_v == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - __pyx_v_sv = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_sv == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - __pyx_v_a = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - __pyx_v_z = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_z == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - __pyx_v_sz = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_sz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - __pyx_v_st = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - __pyx_v_err = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - if (values[8]) { - __pyx_v_N = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) - } else { - __pyx_v_N = ((int)((int)0x1F4)); - } - if (values[9]) { - __pyx_v_time = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) - } else { - __pyx_v_time = ((double)((double)5.)); - } - if (values[10]) { - __pyx_v_n_st = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_n_st == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) - } else { - __pyx_v_n_st = ((int)((int)2)); - } - if (values[11]) { - __pyx_v_n_sz = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_n_sz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) - } else { - __pyx_v_n_sz = ((int)((int)2)); - } - if (values[12]) { - __pyx_v_use_adaptive = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_use_adaptive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) - } else { - __pyx_v_use_adaptive = ((int)((int)1)); - } - if (values[13]) { - __pyx_v_simps_err = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_simps_err == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) - } else { - __pyx_v_simps_err = ((double)((double)1e-3)); - } - if (values[14]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[15]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("gen_cdf_using_pdf", 0, 8, 16, __pyx_nargs); __PYX_ERR(0, 619, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.gen_cdf_using_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4wfpt_24gen_cdf_using_pdf(__pyx_self, __pyx_v_v, __pyx_v_sv, __pyx_v_a, __pyx_v_z, __pyx_v_sz, __pyx_v_t, __pyx_v_st, __pyx_v_err, __pyx_v_N, __pyx_v_time, __pyx_v_n_st, __pyx_v_n_sz, __pyx_v_use_adaptive, __pyx_v_simps_err, __pyx_v_p_outlier, __pyx_v_w_outlier); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_24gen_cdf_using_pdf(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_v, double __pyx_v_sv, double __pyx_v_a, double __pyx_v_z, double __pyx_v_sz, double __pyx_v_t, double __pyx_v_st, double __pyx_v_err, int __pyx_v_N, double __pyx_v_time, int __pyx_v_n_st, int __pyx_v_n_sz, int __pyx_v_use_adaptive, double __pyx_v_simps_err, double __pyx_v_p_outlier, double __pyx_v_w_outlier) { - PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_cdf_array = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_cdf_array; - __Pyx_Buffer __pyx_pybuffer_cdf_array; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - PyArrayObject *__pyx_t_11 = NULL; - npy_intp *__pyx_t_12; - PyArrayObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - PyObject *__pyx_t_21 = NULL; - PyObject *__pyx_t_22 = NULL; - PyObject *__pyx_t_23 = NULL; - PyObject *__pyx_t_24 = NULL; - PyObject *__pyx_t_25 = NULL; - PyObject *__pyx_t_26 = NULL; - PyObject *__pyx_t_27 = NULL; - npy_intp __pyx_t_28; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__17) - __Pyx_RefNannySetupContext("gen_cdf_using_pdf", 0); - __Pyx_TraceCall("gen_cdf_using_pdf", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error)); - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - __pyx_pybuffer_cdf_array.pybuffer.buf = NULL; - __pyx_pybuffer_cdf_array.refcount = 0; - __pyx_pybuffernd_cdf_array.data = NULL; - __pyx_pybuffernd_cdf_array.rcbuffer = &__pyx_pybuffer_cdf_array; - - /* "wfpt.pyx":625 - * generate cdf vector using the pdf - * """ - * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< - * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError( - */ - __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error)) - __pyx_t_2 = (__pyx_v_sv < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_a <= 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_z < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_z > 1.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_sz < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_sz > 1.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_z + (__pyx_v_sz / 2.)) > 1.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "wfpt.pyx":626 - * """ - * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ - * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): # <<<<<<<<<<<<<< - * raise ValueError( - * "at least one of the parameters is out of the support") - */ - __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error)) - __pyx_t_2 = ((__pyx_v_z - (__pyx_v_sz / 2.)) < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = ((__pyx_v_t - (__pyx_v_st / 2.)) < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_t < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_st < 0.0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = __pyx_f_4wfpt_p_outlier_in_range(__pyx_v_p_outlier); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L1_error) - __pyx_t_3 = (!__pyx_t_2); - __pyx_t_1 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - - /* "wfpt.pyx":625 - * generate cdf vector using the pdf - * """ - * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< - * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError( - */ - __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error)) - if (unlikely(__pyx_t_1)) { - - /* "wfpt.pyx":627 - * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ - * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError( # <<<<<<<<<<<<<< - * "at least one of the parameters is out of the support") - * - */ - __Pyx_TraceLine(627,0,__PYX_ERR(0, 627, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 627, __pyx_L1_error) - - /* "wfpt.pyx":625 - * generate cdf vector using the pdf - * """ - * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ # <<<<<<<<<<<<<< - * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError( - */ - } - - /* "wfpt.pyx":630 - * "at least one of the parameters is out of the support") - * - * cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) - * cdef int idx - */ - __Pyx_TraceLine(630,0,__PYX_ERR(0, 630, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyFloat_FromDouble((-__pyx_v_time)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_From_long(((2 * __pyx_v_N) + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_5, __pyx_t_7, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_x = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 630, __pyx_L1_error) - } else {__pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_11 = 0; - __pyx_v_x = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "wfpt.pyx":631 - * - * cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) - * cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) # <<<<<<<<<<<<<< - * cdef int idx - * - */ - __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_12 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L1_error) - __pyx_t_4 = PyInt_FromSsize_t((__pyx_t_12[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error) - __pyx_t_13 = ((PyArrayObject *)__pyx_t_5); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_cdf_array = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 631, __pyx_L1_error) - } else {__pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_13 = 0; - __pyx_v_cdf_array = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "wfpt.pyx":635 - * - * # compute pdf on the real line - * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, # <<<<<<<<<<<<<< - * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) - * - */ - __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pdf_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_sv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_z); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = PyFloat_FromDouble(__pyx_v_sz); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyFloat_FromDouble(__pyx_v_st); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = PyFloat_FromDouble(__pyx_v_err); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - - /* "wfpt.pyx":636 - * # compute pdf on the real line - * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, - * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) # <<<<<<<<<<<<<< - * - * # integrate - */ - __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error)) - __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_n_st); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_n_sz); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __pyx_t_20 = __Pyx_PyBool_FromLong(__pyx_v_use_adaptive); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __pyx_t_21 = PyFloat_FromDouble(__pyx_v_simps_err); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __pyx_t_22 = PyFloat_FromDouble(__pyx_v_p_outlier); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); - __pyx_t_23 = PyFloat_FromDouble(__pyx_v_w_outlier); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_23); - __pyx_t_24 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_24)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_24); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[17] = {__pyx_t_24, ((PyObject *)__pyx_v_x), __pyx_t_8, __pyx_t_6, __pyx_t_7, __pyx_t_9, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_int_0, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 16+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - - /* "wfpt.pyx":635 - * - * # compute pdf on the real line - * cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, # <<<<<<<<<<<<<< - * n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) - * - */ - __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error)) - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 635, __pyx_L1_error) - __pyx_t_13 = ((PyArrayObject *)__pyx_t_5); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer); - __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_cdf_array, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27); - } - __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0; - } - __pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 635, __pyx_L1_error) - } - __pyx_t_13 = 0; - __Pyx_DECREF_SET(__pyx_v_cdf_array, ((PyArrayObject *)__pyx_t_5)); - __pyx_t_5 = 0; - - /* "wfpt.pyx":639 - * - * # integrate - * cdf_array[1:] = integrate.cumtrapz(cdf_array) # <<<<<<<<<<<<<< - * - * # normalize - */ - __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_integrate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cumtrapz); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_23); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_23))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_23); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_23, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_cdf_array)}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_23, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - } - if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_cdf_array), __pyx_slice__11, __pyx_t_5) < 0))) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "wfpt.pyx":642 - * - * # normalize - * cdf_array /= cdf_array[x.shape[0] - 1] # <<<<<<<<<<<<<< - * - * return x, cdf_array - */ - __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error)) - __pyx_t_12 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L1_error) - __pyx_t_28 = ((__pyx_t_12[0]) - 1); - __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_cdf_array.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_23 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_cdf_array), __pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_23); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_23) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_23, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 642, __pyx_L1_error) - __pyx_t_13 = ((PyArrayObject *)__pyx_t_23); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer); - __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_cdf_array, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25); - } - __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0; - } - __pyx_pybuffernd_cdf_array.diminfo[0].strides = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdf_array.diminfo[0].shape = __pyx_pybuffernd_cdf_array.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) - } - __pyx_t_13 = 0; - __Pyx_DECREF_SET(__pyx_v_cdf_array, ((PyArrayObject *)__pyx_t_23)); - __pyx_t_23 = 0; - - /* "wfpt.pyx":644 - * cdf_array /= cdf_array[x.shape[0] - 1] - * - * return x, cdf_array # <<<<<<<<<<<<<< - * - * - */ - __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_23); - __Pyx_INCREF((PyObject *)__pyx_v_x); - __Pyx_GIVEREF((PyObject *)__pyx_v_x); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)__pyx_v_x))) __PYX_ERR(0, 644, __pyx_L1_error); - __Pyx_INCREF((PyObject *)__pyx_v_cdf_array); - __Pyx_GIVEREF((PyObject *)__pyx_v_cdf_array); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, ((PyObject *)__pyx_v_cdf_array))) __PYX_ERR(0, 644, __pyx_L1_error); - __pyx_r = __pyx_t_23; - __pyx_t_23 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":619 - * return sum_logp - * - * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< - * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_15); - __Pyx_XDECREF(__pyx_t_16); - __Pyx_XDECREF(__pyx_t_17); - __Pyx_XDECREF(__pyx_t_18); - __Pyx_XDECREF(__pyx_t_19); - __Pyx_XDECREF(__pyx_t_20); - __Pyx_XDECREF(__pyx_t_21); - __Pyx_XDECREF(__pyx_t_22); - __Pyx_XDECREF(__pyx_t_23); - __Pyx_XDECREF(__pyx_t_24); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.gen_cdf_using_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdf_array.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_x); - __Pyx_XDECREF((PyObject *)__pyx_v_cdf_array); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":647 - * - * - * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< - * - * # get length of data - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_27split_cdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_26split_cdf, "split_cdf(ndarray x, ndarray data)"); -static PyMethodDef __pyx_mdef_4wfpt_27split_cdf = {"split_cdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_27split_cdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_26split_cdf}; -static PyObject *__pyx_pw_4wfpt_27split_cdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_x = 0; - PyArrayObject *__pyx_v_data = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("split_cdf (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 647, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 647, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 647, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("split_cdf", 1, 2, 2, 1); __PYX_ERR(0, 647, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "split_cdf") < 0)) __PYX_ERR(0, 647, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_x = ((PyArrayObject *)values[0]); - __pyx_v_data = ((PyArrayObject *)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("split_cdf", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 647, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.split_cdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 647, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 647, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_26split_cdf(__pyx_self, __pyx_v_x, __pyx_v_data); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_26split_cdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_data) { - int __pyx_v_N; - PyArrayObject *__pyx_v_x_lb = 0; - PyArrayObject *__pyx_v_lb = 0; - PyArrayObject *__pyx_v_x_ub = 0; - PyArrayObject *__pyx_v_ub = 0; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - __Pyx_LocalBuf_ND __pyx_pybuffernd_lb; - __Pyx_Buffer __pyx_pybuffer_lb; - __Pyx_LocalBuf_ND __pyx_pybuffernd_ub; - __Pyx_Buffer __pyx_pybuffer_ub; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x; - __Pyx_Buffer __pyx_pybuffer_x; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x_lb; - __Pyx_Buffer __pyx_pybuffer_x_lb; - __Pyx_LocalBuf_ND __pyx_pybuffernd_x_ub; - __Pyx_Buffer __pyx_pybuffer_x_ub; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyArrayObject *__pyx_t_4 = NULL; - PyArrayObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - int __pyx_t_12; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyArrayObject *__pyx_t_16 = NULL; - PyArrayObject *__pyx_t_17 = NULL; - Py_ssize_t __pyx_t_18; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__19) - __Pyx_RefNannySetupContext("split_cdf", 0); - __Pyx_TraceCall("split_cdf", __pyx_f[0], 647, 0, __PYX_ERR(0, 647, __pyx_L1_error)); - __pyx_pybuffer_x_lb.pybuffer.buf = NULL; - __pyx_pybuffer_x_lb.refcount = 0; - __pyx_pybuffernd_x_lb.data = NULL; - __pyx_pybuffernd_x_lb.rcbuffer = &__pyx_pybuffer_x_lb; - __pyx_pybuffer_lb.pybuffer.buf = NULL; - __pyx_pybuffer_lb.refcount = 0; - __pyx_pybuffernd_lb.data = NULL; - __pyx_pybuffernd_lb.rcbuffer = &__pyx_pybuffer_lb; - __pyx_pybuffer_x_ub.pybuffer.buf = NULL; - __pyx_pybuffer_x_ub.refcount = 0; - __pyx_pybuffernd_x_ub.data = NULL; - __pyx_pybuffernd_x_ub.rcbuffer = &__pyx_pybuffer_x_ub; - __pyx_pybuffer_ub.pybuffer.buf = NULL; - __pyx_pybuffer_ub.refcount = 0; - __pyx_pybuffernd_ub.data = NULL; - __pyx_pybuffernd_ub.rcbuffer = &__pyx_pybuffer_ub; - __pyx_pybuffer_x.pybuffer.buf = NULL; - __pyx_pybuffer_x.refcount = 0; - __pyx_pybuffernd_x.data = NULL; - __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 647, __pyx_L1_error) - } - __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 647, __pyx_L1_error) - } - __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; - - /* "wfpt.pyx":650 - * - * # get length of data - * cdef int N = (len(data) - 1) / 2 # <<<<<<<<<<<<<< - * - * # lower bound is reversed - */ - __Pyx_TraceLine(650,0,__PYX_ERR(0, 650, __pyx_L1_error)) - __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 650, __pyx_L1_error) - __pyx_v_N = ((__pyx_t_1 - 1) / 2); - - /* "wfpt.pyx":653 - * - * # lower bound is reversed - * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] - * # lower bound is cumulative in the wrong direction - */ - __Pyx_TraceLine(653,0,__PYX_ERR(0, 653, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 653, __pyx_L1_error) - __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_lb.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_x_lb = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 653, __pyx_L1_error) - } else {__pyx_pybuffernd_x_lb.diminfo[0].strides = __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_lb.diminfo[0].shape = __pyx_pybuffernd_x_lb.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_4 = 0; - __pyx_v_x_lb = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "wfpt.pyx":654 - * # lower bound is reversed - * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] - * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] # <<<<<<<<<<<<<< - * # lower bound is cumulative in the wrong direction - * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) - */ - __Pyx_TraceLine(654,0,__PYX_ERR(0, 654, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 654, __pyx_L1_error) - __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lb.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_lb = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_lb.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 654, __pyx_L1_error) - } else {__pyx_pybuffernd_lb.diminfo[0].strides = __pyx_pybuffernd_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lb.diminfo[0].shape = __pyx_pybuffernd_lb.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_5 = 0; - __pyx_v_lb = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "wfpt.pyx":656 - * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] - * # lower bound is cumulative in the wrong direction - * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) # <<<<<<<<<<<<<< - * - * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] - */ - __Pyx_TraceLine(656,0,__PYX_ERR(0, 656, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_int_0)) __PYX_ERR(0, 656, __pyx_L1_error); - __pyx_t_11 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_12 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_diff); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_12 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_lb)}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __pyx_t_11 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_11)) __PYX_ERR(0, 656, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_11 = 0; - __pyx_t_11 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_12 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __pyx_t_8 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_12 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 656, __pyx_L1_error) - __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lb.rcbuffer->pybuffer); - __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lb.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_12 < 0)) { - PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lb.rcbuffer->pybuffer, (PyObject*)__pyx_v_lb, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15); - } - __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0; - } - __pyx_pybuffernd_lb.diminfo[0].strides = __pyx_pybuffernd_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lb.diminfo[0].shape = __pyx_pybuffernd_lb.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) - } - __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_lb, ((PyArrayObject *)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "wfpt.pyx":658 - * lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) - * - * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] - * # ub does not start at 0 - */ - __Pyx_TraceLine(658,0,__PYX_ERR(0, 658, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 658, __pyx_L1_error) - __pyx_t_16 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x_ub.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_x_ub = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 658, __pyx_L1_error) - } else {__pyx_pybuffernd_x_ub.diminfo[0].strides = __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x_ub.diminfo[0].shape = __pyx_pybuffernd_x_ub.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_16 = 0; - __pyx_v_x_ub = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "wfpt.pyx":659 - * - * cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] - * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] # <<<<<<<<<<<<<< - * # ub does not start at 0 - * ub -= ub[0] - */ - __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 659, __pyx_L1_error) - __pyx_t_17 = ((PyArrayObject *)__pyx_t_3); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ub.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_ub = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ub.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 659, __pyx_L1_error) - } else {__pyx_pybuffernd_ub.diminfo[0].strides = __pyx_pybuffernd_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ub.diminfo[0].shape = __pyx_pybuffernd_ub.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_17 = 0; - __pyx_v_ub = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "wfpt.pyx":661 - * cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] - * # ub does not start at 0 - * ub -= ub[0] # <<<<<<<<<<<<<< - * - * return (x_lb, lb, x_ub, ub) - */ - __Pyx_TraceLine(661,0,__PYX_ERR(0, 661, __pyx_L1_error)) - __pyx_t_18 = 0; - __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_ub.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ub.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_ub), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 661, __pyx_L1_error) - __pyx_t_17 = ((PyArrayObject *)__pyx_t_6); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ub.rcbuffer->pybuffer); - __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ub.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_12 < 0)) { - PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ub.rcbuffer->pybuffer, (PyObject*)__pyx_v_ub, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13); - } - __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0; - } - __pyx_pybuffernd_ub.diminfo[0].strides = __pyx_pybuffernd_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ub.diminfo[0].shape = __pyx_pybuffernd_ub.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) - } - __pyx_t_17 = 0; - __Pyx_DECREF_SET(__pyx_v_ub, ((PyArrayObject *)__pyx_t_6)); - __pyx_t_6 = 0; - - /* "wfpt.pyx":663 - * ub -= ub[0] - * - * return (x_lb, lb, x_ub, ub) # <<<<<<<<<<<<<< - * - * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, - */ - __Pyx_TraceLine(663,0,__PYX_ERR(0, 663, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF((PyObject *)__pyx_v_x_lb); - __Pyx_GIVEREF((PyObject *)__pyx_v_x_lb); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_x_lb))) __PYX_ERR(0, 663, __pyx_L1_error); - __Pyx_INCREF((PyObject *)__pyx_v_lb); - __Pyx_GIVEREF((PyObject *)__pyx_v_lb); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_lb))) __PYX_ERR(0, 663, __pyx_L1_error); - __Pyx_INCREF((PyObject *)__pyx_v_x_ub); - __Pyx_GIVEREF((PyObject *)__pyx_v_x_ub); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_x_ub))) __PYX_ERR(0, 663, __pyx_L1_error); - __Pyx_INCREF((PyObject *)__pyx_v_ub); - __Pyx_GIVEREF((PyObject *)__pyx_v_ub); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_ub))) __PYX_ERR(0, 663, __pyx_L1_error); - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":647 - * - * - * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< - * - * # get length of data - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lb.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ub.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_lb.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_ub.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.split_cdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lb.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ub.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_lb.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x_ub.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_x_lb); - __Pyx_XDECREF((PyObject *)__pyx_v_lb); - __Pyx_XDECREF((PyObject *)__pyx_v_x_ub); - __Pyx_XDECREF((PyObject *)__pyx_v_ub); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":665 - * return (x_lb, lb, x_ub, ub) - * - * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_28wiener_like_multi_nn_mlp, "wiener_like_multi_nn_mlp(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); -static PyMethodDef __pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp = {"wiener_like_multi_nn_mlp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_28wiener_like_multi_nn_mlp}; -static PyObject *__pyx_pw_4wfpt_29wiener_like_multi_nn_mlp(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_data = 0; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - PyObject *__pyx_v_network = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 665, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; - - /* "wfpt.pyx":668 - * double p_outlier = 0, - * double w_outlier = 0, - * network = None): # <<<<<<<<<<<<<< - * #**kwargs): - * - */ - values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); - if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_nn_mlp") < 0)) __PYX_ERR(0, 665, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_data = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[2]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - __pyx_v_network = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_nn_mlp", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 665, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 665, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(__pyx_self, __pyx_v_data, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); - - /* "wfpt.pyx":665 - * return (x_lb, lb, x_ub, ub) - * - * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_28wiener_like_multi_nn_mlp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { - float __pyx_v_ll_min; - float __pyx_v_log_p; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - float __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__21) - __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp", 0); - __Pyx_TraceCall("wiener_like_multi_nn_mlp", __pyx_f[0], 665, 0, __PYX_ERR(0, 665, __pyx_L1_error)); - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 665, __pyx_L1_error) - } - __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; - - /* "wfpt.pyx":676 - * # (in that order) - * - * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< - * cdef float log_p - * - */ - __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error)) - __pyx_v_ll_min = -16.11809; - - /* "wfpt.pyx":680 - * - * # Call to network: - * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< - * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - */ - __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_p_outlier == 0.0); - if (__pyx_t_1) { - - /* "wfpt.pyx":681 - * # Call to network: - * if p_outlier == 0: # previous ddm_model - * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< - * else: - * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - */ - __Pyx_TraceLine(681,0,__PYX_ERR(0, 681, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_umath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_maximum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_data)}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_log_p = __pyx_t_10; - - /* "wfpt.pyx":680 - * - * # Call to network: - * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< - * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - */ - goto __pyx_L3; - } - - /* "wfpt.pyx":683 - * log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< - * return log_p - * - */ - __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error)) - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_umath); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_maximum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_13))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_13, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, ((PyObject *)__pyx_v_data)}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __pyx_t_13 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_11, __pyx_t_13}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __pyx_t_12 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __pyx_t_8 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_t_7 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_log_p = __pyx_t_10; - } - __pyx_L3:; - - /* "wfpt.pyx":684 - * else: - * log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - * return log_p # <<<<<<<<<<<<<< - * - * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, - */ - __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_log_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":665 - * return (x_lb, lb, x_ub, ub) - * - * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_14); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wfpt.pyx":686 - * return log_p - * - * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4wfpt_30wiener_like_multi_nn_mlp_pdf, "wiener_like_multi_nn_mlp_pdf(ndarray data, double p_outlier=0, double w_outlier=0, network=None)"); -static PyMethodDef __pyx_mdef_4wfpt_31wiener_like_multi_nn_mlp_pdf = {"wiener_like_multi_nn_mlp_pdf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4wfpt_30wiener_like_multi_nn_mlp_pdf}; -static PyObject *__pyx_pw_4wfpt_31wiener_like_multi_nn_mlp_pdf(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyArrayObject *__pyx_v_data = 0; - double __pyx_v_p_outlier; - double __pyx_v_w_outlier; - PyObject *__pyx_v_network = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp_pdf (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 686, __pyx_L3_error) - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_p_outlier,&__pyx_n_s_w_outlier,&__pyx_n_s_network,0}; - - /* "wfpt.pyx":689 - * double p_outlier = 0, - * double w_outlier = 0, - * network = None): # <<<<<<<<<<<<<< - * #**kwargs): - * - */ - values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p_outlier); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w_outlier); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_network); - if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wiener_like_multi_nn_mlp_pdf") < 0)) __PYX_ERR(0, 686, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_data = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_p_outlier = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L3_error) - } else { - __pyx_v_p_outlier = ((double)((double)0.0)); - } - if (values[2]) { - __pyx_v_w_outlier = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_w_outlier == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) - } else { - __pyx_v_w_outlier = ((double)((double)0.0)); - } - __pyx_v_network = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wiener_like_multi_nn_mlp_pdf", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 686, __pyx_L3_error) - goto __pyx_L3_error; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 686, __pyx_L1_error) - __pyx_r = __pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(__pyx_self, __pyx_v_data, __pyx_v_p_outlier, __pyx_v_w_outlier, __pyx_v_network); - - /* "wfpt.pyx":686 - * return log_p - * - * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4wfpt_30wiener_like_multi_nn_mlp_pdf(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, double __pyx_v_p_outlier, double __pyx_v_w_outlier, PyObject *__pyx_v_network) { - float __pyx_v_ll_min; - float __pyx_v_log_p; - __Pyx_LocalBuf_ND __pyx_pybuffernd_data; - __Pyx_Buffer __pyx_pybuffer_data; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - float __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__22) - __Pyx_RefNannySetupContext("wiener_like_multi_nn_mlp_pdf", 0); - __Pyx_TraceCall("wiener_like_multi_nn_mlp_pdf", __pyx_f[0], 686, 0, __PYX_ERR(0, 686, __pyx_L1_error)); - __pyx_pybuffer_data.pybuffer.buf = NULL; - __pyx_pybuffer_data.refcount = 0; - __pyx_pybuffernd_data.data = NULL; - __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 686, __pyx_L1_error) - } - __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; - - /* "wfpt.pyx":697 - * # (in that order) - * - * cdef float ll_min = -16.11809 # <<<<<<<<<<<<<< - * cdef float log_p - * - */ - __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error)) - __pyx_v_ll_min = -16.11809; - - /* "wfpt.pyx":701 - * - * # Call to network: - * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< - * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - */ - __Pyx_TraceLine(701,0,__PYX_ERR(0, 701, __pyx_L1_error)) - __pyx_t_1 = (__pyx_v_p_outlier == 0.0); - if (__pyx_t_1) { - - /* "wfpt.pyx":702 - * # Call to network: - * if p_outlier == 0: # previous ddm_model - * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) # <<<<<<<<<<<<<< - * else: - * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - */ - __Pyx_TraceLine(702,0,__PYX_ERR(0, 702, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_umath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_maximum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_data)}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_log_p = __pyx_t_10; - - /* "wfpt.pyx":701 - * - * # Call to network: - * if p_outlier == 0: # previous ddm_model # <<<<<<<<<<<<<< - * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - */ - goto __pyx_L3; - } - - /* "wfpt.pyx":704 - * log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - * else: - * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) # <<<<<<<<<<<<<< - * return log_p - */ - __Pyx_TraceLine(704,0,__PYX_ERR(0, 704, __pyx_L1_error)) - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_umath); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_maximum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_network, __pyx_n_s_predict_on_batch); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_13))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_13, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, ((PyObject *)__pyx_v_data)}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __pyx_t_13 = PyFloat_FromDouble(__pyx_v_ll_min); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_11, __pyx_t_13}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __pyx_t_12 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __pyx_t_8 = PyFloat_FromDouble((1.0 - __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyFloat_FromDouble((__pyx_v_w_outlier * __pyx_v_p_outlier)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_t_7 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_9 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_log_p = __pyx_t_10; - } - __pyx_L3:; - - /* "wfpt.pyx":705 - * else: - * log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - * return log_p # <<<<<<<<<<<<<< - */ - __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L1_error)) - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_log_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "wfpt.pyx":686 - * return log_p - * - * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_14); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("wfpt.wiener_like_multi_nn_mlp_pdf", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1}, - {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0}, - {&__pyx_n_s__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 0, 1, 1}, - {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, - {&__pyx_n_u_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 1, 0, 1}, - {&__pyx_n_s_alfa, __pyx_k_alfa, sizeof(__pyx_k_alfa), 0, 0, 1, 1}, - {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, - {&__pyx_n_u_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 1, 0, 1}, - {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, - {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, - {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_kp_u_at_least_one_of_the_parameters_i, __pyx_k_at_least_one_of_the_parameters_i, sizeof(__pyx_k_at_least_one_of_the_parameters_i), 0, 1, 0, 0}, - {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, - {&__pyx_n_s_cdf_array, __pyx_k_cdf_array, sizeof(__pyx_k_cdf_array), 0, 0, 1, 1}, - {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, - {&__pyx_n_s_cont_x, __pyx_k_cont_x, sizeof(__pyx_k_cont_x), 0, 0, 1, 1}, - {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, - {&__pyx_n_s_core, __pyx_k_core, sizeof(__pyx_k_core), 0, 0, 1, 1}, - {&__pyx_n_s_cumm_s_size, __pyx_k_cumm_s_size, sizeof(__pyx_k_cumm_s_size), 0, 0, 1, 1}, - {&__pyx_n_s_cumsum, __pyx_k_cumsum, sizeof(__pyx_k_cumsum), 0, 0, 1, 1}, - {&__pyx_n_s_cumtrapz, __pyx_k_cumtrapz, sizeof(__pyx_k_cumtrapz), 0, 0, 1, 1}, - {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, - {&__pyx_n_s_data_copy, __pyx_k_data_copy, sizeof(__pyx_k_data_copy), 0, 0, 1, 1}, - {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, - {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, - {&__pyx_n_s_drift, __pyx_k_drift, sizeof(__pyx_k_drift), 0, 0, 1, 1}, - {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, - {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, - {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, - {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1}, - {&__pyx_n_s_feedback, __pyx_k_feedback, sizeof(__pyx_k_feedback), 0, 0, 1, 1}, - {&__pyx_n_s_feedbacks, __pyx_k_feedbacks, sizeof(__pyx_k_feedbacks), 0, 0, 1, 1}, - {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, - {&__pyx_n_s_full_pdf, __pyx_k_full_pdf, sizeof(__pyx_k_full_pdf), 0, 0, 1, 1}, - {&__pyx_n_s_gen_cdf_using_pdf, __pyx_k_gen_cdf_using_pdf, sizeof(__pyx_k_gen_cdf_using_pdf), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_i_p, __pyx_k_i_p, sizeof(__pyx_k_i_p), 0, 0, 1, 1}, - {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, - {&__pyx_n_s_ij, __pyx_k_ij, sizeof(__pyx_k_ij), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_integrate, __pyx_k_integrate, sizeof(__pyx_k_integrate), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, - {&__pyx_n_s_lb, __pyx_k_lb, sizeof(__pyx_k_lb), 0, 0, 1, 1}, - {&__pyx_n_s_linspace, __pyx_k_linspace, sizeof(__pyx_k_linspace), 0, 0, 1, 1}, - {&__pyx_n_s_ll_min, __pyx_k_ll_min, sizeof(__pyx_k_ll_min), 0, 0, 1, 1}, - {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1}, - {&__pyx_n_s_log_p, __pyx_k_log_p, sizeof(__pyx_k_log_p), 0, 0, 1, 1}, - {&__pyx_n_s_logp, __pyx_k_logp, sizeof(__pyx_k_logp), 0, 0, 1, 1}, - {&__pyx_n_s_lower_bnd, __pyx_k_lower_bnd, sizeof(__pyx_k_lower_bnd), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, - {&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1}, - {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, - {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1}, - {&__pyx_n_s_multi, __pyx_k_multi, sizeof(__pyx_k_multi), 0, 0, 1, 1}, - {&__pyx_n_s_n_cont, __pyx_k_n_cont, sizeof(__pyx_k_n_cont), 0, 0, 1, 1}, - {&__pyx_n_s_n_params, __pyx_k_n_params, sizeof(__pyx_k_n_params), 0, 0, 1, 1}, - {&__pyx_n_s_n_st, __pyx_k_n_st, sizeof(__pyx_k_n_st), 0, 0, 1, 1}, - {&__pyx_n_s_n_sz, __pyx_k_n_sz, sizeof(__pyx_k_n_sz), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_network, __pyx_k_network, sizeof(__pyx_k_network), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, - {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, - {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, - {&__pyx_n_s_p_outlier, __pyx_k_p_outlier, sizeof(__pyx_k_p_outlier), 0, 0, 1, 1}, - {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1}, - {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, - {&__pyx_n_s_params_bnds, __pyx_k_params_bnds, sizeof(__pyx_k_params_bnds), 0, 0, 1, 1}, - {&__pyx_n_s_params_iter, __pyx_k_params_iter, sizeof(__pyx_k_params_iter), 0, 0, 1, 1}, - {&__pyx_n_s_params_rl, __pyx_k_params_rl, sizeof(__pyx_k_params_rl), 0, 0, 1, 1}, - {&__pyx_n_s_params_ssm, __pyx_k_params_ssm, sizeof(__pyx_k_params_ssm), 0, 0, 1, 1}, - {&__pyx_n_s_pdf_array, __pyx_k_pdf_array, sizeof(__pyx_k_pdf_array), 0, 0, 1, 1}, - {&__pyx_n_s_pos_alfa, __pyx_k_pos_alfa, sizeof(__pyx_k_pos_alfa), 0, 0, 1, 1}, - {&__pyx_n_s_pos_alpha, __pyx_k_pos_alpha, sizeof(__pyx_k_pos_alpha), 0, 0, 1, 1}, - {&__pyx_n_s_pos_cont, __pyx_k_pos_cont, sizeof(__pyx_k_pos_cont), 0, 0, 1, 1}, - {&__pyx_n_s_predict_on_batch, __pyx_k_predict_on_batch, sizeof(__pyx_k_predict_on_batch), 0, 0, 1, 1}, - {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, - {&__pyx_n_s_qs, __pyx_k_qs, sizeof(__pyx_k_qs), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1}, - {&__pyx_n_s_responses, __pyx_k_responses, sizeof(__pyx_k_responses), 0, 0, 1, 1}, - {&__pyx_n_s_responses_qs, __pyx_k_responses_qs, sizeof(__pyx_k_responses_qs), 0, 0, 1, 1}, - {&__pyx_n_s_rl_alpha, __pyx_k_rl_alpha, sizeof(__pyx_k_rl_alpha), 0, 0, 1, 1}, - {&__pyx_n_s_rl_arr, __pyx_k_rl_arr, sizeof(__pyx_k_rl_arr), 0, 0, 1, 1}, - {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, - {&__pyx_n_s_s_size, __pyx_k_s_size, sizeof(__pyx_k_s_size), 0, 0, 1, 1}, - {&__pyx_n_s_scipy, __pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 0, 1, 1}, - {&__pyx_n_s_scipy_integrate, __pyx_k_scipy_integrate, sizeof(__pyx_k_scipy_integrate), 0, 0, 1, 1}, - {&__pyx_n_s_simps_err, __pyx_k_simps_err, sizeof(__pyx_k_simps_err), 0, 0, 1, 1}, - {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_split_by, __pyx_k_split_by, sizeof(__pyx_k_split_by), 0, 0, 1, 1}, - {&__pyx_n_s_split_cdf, __pyx_k_split_cdf, sizeof(__pyx_k_split_cdf), 0, 0, 1, 1}, - {&__pyx_n_s_squeeze, __pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 0, 1, 1}, - {&__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p, __pyx_k_src_hssm_likelihoods_hddm_wfpt_p, sizeof(__pyx_k_src_hssm_likelihoods_hddm_wfpt_p), 0, 0, 1, 0}, - {&__pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_k_src_hssm_likelihoods_hddm_wfpt_w, sizeof(__pyx_k_src_hssm_likelihoods_hddm_wfpt_w), 0, 0, 1, 0}, - {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, - {&__pyx_n_u_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 1, 0, 1}, - {&__pyx_n_s_stack, __pyx_k_stack, sizeof(__pyx_k_stack), 0, 0, 1, 1}, - {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, - {&__pyx_n_s_sum_logp, __pyx_k_sum_logp, sizeof(__pyx_k_sum_logp), 0, 0, 1, 1}, - {&__pyx_n_s_sv, __pyx_k_sv, sizeof(__pyx_k_sv), 0, 0, 1, 1}, - {&__pyx_n_u_sv, __pyx_k_sv, sizeof(__pyx_k_sv), 0, 1, 0, 1}, - {&__pyx_n_s_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 0, 1, 1}, - {&__pyx_n_u_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 1, 0, 1}, - {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, - {&__pyx_n_u_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 1, 0, 1}, - {&__pyx_n_s_t_max, __pyx_k_t_max, sizeof(__pyx_k_t_max), 0, 0, 1, 1}, - {&__pyx_n_s_t_min, __pyx_k_t_min, sizeof(__pyx_k_t_min), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_tile, __pyx_k_tile, sizeof(__pyx_k_tile), 0, 0, 1, 1}, - {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, - {&__pyx_n_s_tp_scale, __pyx_k_tp_scale, sizeof(__pyx_k_tp_scale), 0, 0, 1, 1}, - {&__pyx_n_s_ub, __pyx_k_ub, sizeof(__pyx_k_ub), 0, 0, 1, 1}, - {&__pyx_n_s_umath, __pyx_k_umath, sizeof(__pyx_k_umath), 0, 0, 1, 1}, - {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1}, - {&__pyx_n_s_upper_bnd, __pyx_k_upper_bnd, sizeof(__pyx_k_upper_bnd), 0, 0, 1, 1}, - {&__pyx_n_s_use_adaptive, __pyx_k_use_adaptive, sizeof(__pyx_k_use_adaptive), 0, 0, 1, 1}, - {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_u_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 1, 0, 1}, - {&__pyx_n_s_w_outlier, __pyx_k_w_outlier, sizeof(__pyx_k_w_outlier), 0, 0, 1, 1}, - {&__pyx_n_s_wfpt, __pyx_k_wfpt, sizeof(__pyx_k_wfpt), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like, __pyx_k_wiener_like, sizeof(__pyx_k_wiener_like), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_contaminant, __pyx_k_wiener_like_contaminant, sizeof(__pyx_k_wiener_like_contaminant), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_multi, __pyx_k_wiener_like_multi, sizeof(__pyx_k_wiener_like_multi), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_multi_nn_mlp, __pyx_k_wiener_like_multi_nn_mlp, sizeof(__pyx_k_wiener_like_multi_nn_mlp), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_multi_nn_mlp_pdf, __pyx_k_wiener_like_multi_nn_mlp_pdf, sizeof(__pyx_k_wiener_like_multi_nn_mlp_pdf), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_multi_rlddm, __pyx_k_wiener_like_multi_rlddm, sizeof(__pyx_k_wiener_like_multi_rlddm), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_rl, __pyx_k_wiener_like_rl, sizeof(__pyx_k_wiener_like_rl), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_rlddm, __pyx_k_wiener_like_rlddm, sizeof(__pyx_k_wiener_like_rlddm), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_rlssm_nn, __pyx_k_wiener_like_rlssm_nn, sizeof(__pyx_k_wiener_like_rlssm_nn), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_like_rlssm_nn_reg, __pyx_k_wiener_like_rlssm_nn_reg, sizeof(__pyx_k_wiener_like_rlssm_nn_reg), 0, 0, 1, 1}, - {&__pyx_n_s_wiener_logp_array, __pyx_k_wiener_logp_array, sizeof(__pyx_k_wiener_logp_array), 0, 0, 1, 1}, - {&__pyx_n_s_wp_outlier, __pyx_k_wp_outlier, sizeof(__pyx_k_wp_outlier), 0, 0, 1, 1}, - {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {&__pyx_n_s_x_lb, __pyx_k_x_lb, sizeof(__pyx_k_x_lb), 0, 0, 1, 1}, - {&__pyx_n_s_x_ub, __pyx_k_x_ub, sizeof(__pyx_k_x_ub), 0, 0, 1, 1}, - {&__pyx_n_s_xs, __pyx_k_xs, sizeof(__pyx_k_xs), 0, 0, 1, 1}, - {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, - {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, - {&__pyx_n_u_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 1, 0, 1}, - {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 66, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 627, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 983, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983 - * __pyx_import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "wfpt.pyx":133 - * - * if not p_outlier_in_range(p_outlier): - * logp[:] = -np.inf # <<<<<<<<<<<<<< - * return logp - * - */ - __pyx_slice__8 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__8); - __Pyx_GIVEREF(__pyx_slice__8); - - /* "wfpt.pyx":330 - * - * - * data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) # <<<<<<<<<<<<<< - * data[:, n_params:] = np.stack([x, response], axis = 1) - * - */ - __pyx_slice__11 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__11); - __Pyx_GIVEREF(__pyx_slice__11); - - /* "wfpt.pyx":627 - * if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ - * (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): - * raise ValueError( # <<<<<<<<<<<<<< - * "at least one of the parameters is out of the support") - * - */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_at_least_one_of_the_parameters_i); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - - /* "wfpt.pyx":653 - * - * # lower bound is reversed - * cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] # <<<<<<<<<<<<<< - * cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] - * # lower bound is cumulative in the wrong direction - */ - __pyx_slice__20 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); - - /* "wfpt.pyx":19 - * #from hddm.model_config import model_config - * - * import scipy.integrate as integrate # <<<<<<<<<<<<<< - * from copy import copy - * import numpy as np - */ - __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_scipy, __pyx_n_s_integrate); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 - * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * - * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< - * z, double sz, double t, double st, double err, int - * n_st=2, int n_sz=2, bint use_adaptive=1, double - */ - __pyx_tuple__26 = PyTuple_Pack(13, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(13, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_p, __pyx_n_s_full_pdf, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(2, 104, __pyx_L1_error) - __pyx_tuple__27 = PyTuple_Pack(4, __pyx_int_2, __pyx_int_2, __pyx_int_1, __pyx_float_1eneg_3); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - - /* "wfpt.pyx":32 - * include 'integrate.pxi' - * - * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< - * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, - * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - */ - __pyx_tuple__28 = PyTuple_Pack(19, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_logp, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_y); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_pdf_array, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 32, __pyx_L1_error) - - /* "wfpt.pyx":54 - * - * - * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0.1): - */ - __pyx_tuple__29 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 20, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 54, __pyx_L1_error) - - /* "wfpt.pyx":78 - * return sum_logp - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - __pyx_tuple__30 = PyTuple_Pack(24, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_multi, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_params, __pyx_n_s_params_iter, __pyx_n_s_param); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 78, __pyx_L1_error) - - /* "wfpt.pyx":110 - * return sum_logp - * - * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] v, - * np.ndarray[double, ndim=1] sv, - */ - __pyx_tuple__31 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_logp, __pyx_n_s_p, __pyx_n_s_wp_outlier); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 20, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_logp_array, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 110, __pyx_L1_error) - - /* "wfpt.pyx":150 - * return logp - * - * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - __pyx_tuple__32 = PyTuple_Pack(36, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_alpha, __pyx_n_s_pos_alpha, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_unique); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 36, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rlddm, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 150, __pyx_L1_error) - - /* "wfpt.pyx":228 - * - * - * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] x, - * np.ndarray[long, ndim=1] response, - */ - __pyx_tuple__33 = PyTuple_Pack(37, __pyx_n_s_model, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_params_ssm, __pyx_n_s_params_rl, __pyx_n_s_params_bnds, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_v, __pyx_n_s_rl_alpha, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_p, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_log_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_responses_qs, __pyx_n_s_unique, __pyx_n_s_n_params, __pyx_n_s_data, __pyx_n_s_ll_min, __pyx_n_s_cumm_s_size, __pyx_n_s_lower_bnd, __pyx_n_s_upper_bnd); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(12, 0, 0, 37, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rlssm_nn, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 228, __pyx_L1_error) - - /* "wfpt.pyx":342 - * - * - * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] feedback, - * np.ndarray[long, ndim=1] split_by, - */ - __pyx_tuple__34 = PyTuple_Pack(30, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_alpha, __pyx_n_s_pos_alpha, __pyx_n_s_v, __pyx_n_s_z, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_drift, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_pos_alfa, __pyx_n_s_qs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_unique); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(15, 0, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rl, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 342, __pyx_L1_error) - - /* "wfpt.pyx":429 - * - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 429, __pyx_L1_error) - - /* "wfpt.pyx":462 - * - * - * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - __pyx_tuple__35 = PyTuple_Pack(34, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_alpha, __pyx_n_s_err, __pyx_n_s_multi, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_size, __pyx_n_s_ij, __pyx_n_s_s_size, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_s, __pyx_n_s_qs, __pyx_n_s_params, __pyx_n_s_params_iter, __pyx_n_s_i, __pyx_n_s_param, __pyx_n_s_alfa); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(21, 0, 0, 34, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi_rlddm, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 462, __pyx_L1_error) - - /* "wfpt.pyx":508 - * - * - * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< - * np.ndarray[float, ndim=2] rl_arr, - * np.ndarray[double, ndim=1] x, - */ - __pyx_tuple__36 = PyTuple_Pack(34, __pyx_n_s_data, __pyx_n_s_rl_arr, __pyx_n_s_x, __pyx_n_s_response, __pyx_n_s_feedback, __pyx_n_s_split_by, __pyx_n_s_q, __pyx_n_s_params_bnds, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_rl_alpha, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_p, __pyx_n_s_s_size, __pyx_n_s_s, __pyx_n_s_log_p, __pyx_n_s_sum_logp, __pyx_n_s_wp_outlier, __pyx_n_s_alfa, __pyx_n_s_qs, __pyx_n_s_xs, __pyx_n_s_feedbacks, __pyx_n_s_responses, __pyx_n_s_responses_qs, __pyx_n_s_unique, __pyx_n_s_data_copy, __pyx_n_s_ll_min, __pyx_n_s_cumm_s_size, __pyx_n_s_lower_bnd, __pyx_n_s_upper_bnd, __pyx_n_s_tp_scale); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 34, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_rlssm_nn_reg, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 508, __pyx_L1_error) - - /* "wfpt.pyx":588 - * return sum_logp - * - * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< - * double sv, double a, double z, double sz, double t, double st, double t_min, - * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, - */ - __pyx_tuple__37 = PyTuple_Pack(22, __pyx_n_s_x, __pyx_n_s_cont_x, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_t_min, __pyx_n_s_t_max, __pyx_n_s_err, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_sum_logp, __pyx_n_s_n_cont, __pyx_n_s_pos_cont); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 22, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_contaminant, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 588, __pyx_L1_error) - - /* "wfpt.pyx":619 - * return sum_logp - * - * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< - * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - __pyx_tuple__38 = PyTuple_Pack(19, __pyx_n_s_v, __pyx_n_s_sv, __pyx_n_s_a, __pyx_n_s_z, __pyx_n_s_sz, __pyx_n_s_t, __pyx_n_s_st, __pyx_n_s_err, __pyx_n_s_N, __pyx_n_s_time, __pyx_n_s_n_st, __pyx_n_s_n_sz, __pyx_n_s_use_adaptive, __pyx_n_s_simps_err, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_x, __pyx_n_s_cdf_array, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(16, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_gen_cdf_using_pdf, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 619, __pyx_L1_error) - - /* "wfpt.pyx":647 - * - * - * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< - * - * # get length of data - */ - __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_s_x, __pyx_n_s_data, __pyx_n_s_N, __pyx_n_s_x_lb, __pyx_n_s_lb, __pyx_n_s_x_ub, __pyx_n_s_ub); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 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_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_split_cdf, 647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 647, __pyx_L1_error) - - /* "wfpt.pyx":665 - * return (x_lb, lb, x_ub, ub) - * - * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_p_outlier, __pyx_n_s_w_outlier, __pyx_n_s_network, __pyx_n_s_ll_min, __pyx_n_s_log_p); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi_nn_mlp, 665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 665, __pyx_L1_error) - - /* "wfpt.pyx":686 - * return log_p - * - * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_hssm_likelihoods_hddm_wfpt_w, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_float_1eneg_3 = PyFloat_FromDouble(1e-3); if (unlikely(!__pyx_float_1eneg_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_float_2_718281828459 = PyFloat_FromDouble(2.718281828459); if (unlikely(!__pyx_float_2_718281828459)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - /* NumpyImportArray.init */ - /* - * Cython has automatically inserted a call to _import_array since - * you didn't include one when you cimported numpy. To disable this - * add the line - * numpy._import_array - */ -#ifdef NPY_FEATURE_VERSION -#ifndef NO_IMPORT_ARRAY -if (unlikely(_import_array() == -1)) { - PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import " - "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; " - "use 'numpy._import_array' to disable if you are certain you don't need it)."); -} -#endif -#endif - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", - #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), - #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyTypeObject), - #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyHeapTypeObject), - #endif - __Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_2); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_2(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_2(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_2); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_variable_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - - -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec_wfpt(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec_wfpt}, - {0, NULL} -}; -#endif - -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "wfpt", - 0, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ - #else - -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif -#endif - -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif -#endif - - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initwfpt(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initwfpt(void) -#else -__Pyx_PyMODINIT_FUNC PyInit_wfpt(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit_wfpt(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -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) -#endif -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else - result = PyDict_SetItemString(moddict, to_name, value); -#endif - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; - } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - if (__Pyx_check_single_interpreter()) - return NULL; - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; -#endif - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} - - -static CYTHON_SMALL_CODE int __pyx_pymod_exec_wfpt(PyObject *__pyx_pyinit_module) -#endif -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - __Pyx_TraceDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module 'wfpt' has already been imported. Re-initialisation is not supported."); - return -1; - } - #elif PY_MAJOR_VERSION >= 3 - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); - #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("wfpt", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to wfpt pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - pystate_addmodule_run = 1; - } - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #endif - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_wfpt(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_wfpt) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "wfpt")) { - if (unlikely((PyDict_SetItemString(modules, "wfpt", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_wfpt(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":245 - * - * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ - */ - __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":251 - * - * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ - */ - __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":257 - * - * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ - */ - __Pyx_TraceLine(257,0,__PYX_ERR(1, 257, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":263 - * - * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - __Pyx_TraceLine(263,0,__PYX_ERR(1, 263, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":271 - * - * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - __Pyx_TraceLine(271,0,__PYX_ERR(1, 271, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":278 - * - * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ - */ - __Pyx_TraceLine(278,0,__PYX_ERR(1, 278, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":284 - * - * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. - */ - __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - __Pyx_TraceLine(773,0,__PYX_ERR(1, 773, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape - */ - __Pyx_TraceLine(788,0,__PYX_ERR(1, 788, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":967 - * int _import_umath() except -1 - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) - */ - __Pyx_TraceLine(967,0,__PYX_ERR(1, 967, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":971 - * PyArray_SetBaseObject(arr, base) - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * base = PyArray_BASE(arr) - * if base is NULL: - */ - __Pyx_TraceLine(971,0,__PYX_ERR(1, 971, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * __pyx_import_array() - */ - __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 - * - * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.timedelta64)` - */ - __Pyx_TraceLine(998,0,__PYX_ERR(1, 998, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1013 - * - * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.datetime64)` - */ - __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 - * - * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy datetime64 object - */ - __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 - * - * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy timedelta64 object - */ - __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error)) - - - /* "../../../private/var/folders/9x/cjrfyjd9443d4_0wt9qw8fhh0000gq/T/tmpzyfj3a6z/.venv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1045 - * - * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the unit part of the dtype for a numpy datetime64 object. - */ - __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error)) - - - /* "wfpt.pyx":19 - * #from hddm.model_config import model_config - * - * import scipy.integrate as integrate # <<<<<<<<<<<<<< - * from copy import copy - * import numpy as np - */ - __Pyx_TraceLine(19,0,__PYX_ERR(0, 19, __pyx_L1_error)) - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_scipy_integrate, __pyx_tuple__23); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_integrate, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "wfpt.pyx":20 - * - * import scipy.integrate as integrate - * from copy import copy # <<<<<<<<<<<<<< - * import numpy as np - * - */ - __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error)) - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_copy); - __Pyx_GIVEREF(__pyx_n_s_copy); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_copy)) __PYX_ERR(0, 20, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_copy, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "wfpt.pyx":21 - * import scipy.integrate as integrate - * from copy import copy - * import numpy as np # <<<<<<<<<<<<<< - * - * cimport numpy as np - */ - __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error)) - __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":6 - * #cython: boundscheck=False - * - * import numpy as np # <<<<<<<<<<<<<< - * cimport numpy as np - * cimport cython - */ - __Pyx_TraceLine(6,0,__PYX_ERR(3, 6, __pyx_L1_error)) - __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(3, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":28 - * T max[T](T a, T b) - * - * cdef double ftt_01w(double tt, double w, double err) nogil: # <<<<<<<<<<<<<< - * """Compute f(t|0,1,w) for the likelihood of the drift diffusion model using the method - * and implementation of Navarro & Fuss, 2009. - */ - __Pyx_TraceLine(28,0,__PYX_ERR(2, 28, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":67 - * return p - * - * cdef inline double prob_ub(double v, double a, double z) nogil: # <<<<<<<<<<<<<< - * """Probability of hitting upper boundary.""" - * if v == 0: - */ - __Pyx_TraceLine(67,0,__PYX_ERR(2, 67, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":74 - * return (exp(-2 * a * z * v) - 1) / (exp(-2 * a * v) - 1) - * - * cdef double pdf(double x, double v, double a, double w, double err) nogil: # <<<<<<<<<<<<<< - * """Compute the likelihood of the drift diffusion model f(t|v,a,z) using the method - * and implementation of Navarro & Fuss, 2009. - */ - __Pyx_TraceLine(74,0,__PYX_ERR(2, 74, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":87 - * return p*exp(-v*a*w -(pow(v,2))*x/2.)/(pow(a,2)) - * - * cdef double pdf_sv(double x, double v, double sv, double a, double z, double err) nogil: # <<<<<<<<<<<<<< - * """Compute the likelihood of the drift diffusion model f(t|v,a,z,sv) using the method - * and implementation of Navarro & Fuss, 2009. - */ - __Pyx_TraceLine(87,0,__PYX_ERR(2, 87, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/pdf.pxi":104 - * return exp(log(p) + ((a*z*sv)**2 - 2*a*v*z - (v**2)*x)/(2*(sv**2)*x+2))/sqrt((sv**2)*x+1)/(a**2) - * - * cpdef double full_pdf(double x, double v, double sv, double a, double # <<<<<<<<<<<<<< - * z, double sz, double t, double st, double err, int - * n_st=2, int n_sz=2, bint use_adaptive=1, double - */ - __Pyx_TraceLine(104,0,__PYX_ERR(2, 104, __pyx_L1_error)) - - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_1full_pdf, 0, __pyx_n_s_full_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__27); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_full_pdf, __pyx_t_3) < 0) __PYX_ERR(2, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":12 - * include 'pdf.pxi' - * - * cdef double simpson_1D(double x, double v, double sv, double a, double z, double t, double err, # <<<<<<<<<<<<<< - * double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: - * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" - */ - __Pyx_TraceLine(12,0,__PYX_ERR(3, 12, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":47 - * return ((ht+hz) * S / 3) - * - * cdef double simpson_2D(double x, double v, double sv, double a, double z, double t, double err, double lb_z, double ub_z, int n_sz, double lb_t, double ub_t, int n_st) nogil: # <<<<<<<<<<<<<< - * #assert ((n_sz&1)==0 and (n_st&1)==0), "n_st and n_sz have to be even" - * #assert ((ub_t-lb_t)*(ub_z-lb_z)>0 and (n_sz*n_st)>0), "the function is defined for 2D-integration only, lb_t: %f, ub_t %f, lb_z %f, ub_z %f, n_sz: %d, n_st %d" % (lb_t, ub_t, lb_z, ub_z, n_sz, n_st) - */ - __Pyx_TraceLine(47,0,__PYX_ERR(3, 47, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":72 - * return (ht * S / 3) - * - * cdef double adaptiveSimpsonsAux(double x, double v, double sv, double a, double z, double t, double pdf_err, # <<<<<<<<<<<<<< - * double lb_z, double ub_z, double lb_t, double ub_t, double ZT, double simps_err, - * double S, double f_beg, double f_end, double f_mid, int bottom) nogil: - */ - __Pyx_TraceLine(72,0,__PYX_ERR(3, 72, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":114 - * Sright, f_mid, f_end, fe, bottom-1) - * - * cdef double adaptiveSimpsons_1D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< - * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, - * double simps_err, int maxRecursionDepth) nogil: - */ - __Pyx_TraceLine(114,0,__PYX_ERR(3, 114, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":143 - * return res - * - * cdef double adaptiveSimpsonsAux_2D(double x, double v, double sv, # <<<<<<<<<<<<<< - * double a, double z, double t, double - * pdf_err, double err_1d, double lb_z, - */ - __Pyx_TraceLine(143,0,__PYX_ERR(3, 143, __pyx_L1_error)) - - - /* "src/hssm/likelihoods/hddm_wfpt/integrate.pxi":181 - * - * - * cdef double adaptiveSimpsons_2D(double x, double v, double sv, double a, double z, double t, # <<<<<<<<<<<<<< - * double pdf_err, double lb_z, double ub_z, double lb_t, double ub_t, - * double simps_err, int maxRecursionDepth_sz, int maxRecursionDepth_st) nogil: - */ - __Pyx_TraceLine(181,0,__PYX_ERR(3, 181, __pyx_L1_error)) - - - /* "wfpt.pyx":33 - * - * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, - * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, # <<<<<<<<<<<<<< - * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - * - */ - __Pyx_TraceLine(33,0,__PYX_ERR(0, 33, __pyx_L1_error)) - __pyx_t_3 = PyFloat_FromDouble(((double)1e-4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "wfpt.pyx":34 - * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, - * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, - * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(34,0,__PYX_ERR(0, 34, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "wfpt.pyx":32 - * include 'integrate.pxi' - * - * def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, # <<<<<<<<<<<<<< - * double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, - * double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - */ - __Pyx_TraceLine(32,0,__PYX_ERR(0, 32, __pyx_L1_error)) - __pyx_t_10 = PyTuple_New(8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8)) __PYX_ERR(0, 32, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_9)) __PYX_ERR(0, 32, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_3pdf_array, 0, __pyx_n_s_pdf_array, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pdf_array, __pyx_t_9) < 0) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "wfpt.pyx":50 - * return y - * - * cdef inline bint p_outlier_in_range(double p_outlier): # <<<<<<<<<<<<<< - * return (p_outlier >= 0) & (p_outlier <= 1) - * - */ - __Pyx_TraceLine(50,0,__PYX_ERR(0, 50, __pyx_L1_error)) - - - /* "wfpt.pyx":55 - * - * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< - * double p_outlier=0, double w_outlier=0.1): - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(55,0,__PYX_ERR(0, 55, __pyx_L1_error)) - __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "wfpt.pyx":56 - * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0.1): # <<<<<<<<<<<<<< - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t i - */ - __Pyx_TraceLine(56,0,__PYX_ERR(0, 56, __pyx_L1_error)) - __pyx_t_6 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyFloat_FromDouble(((double)0.1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - - /* "wfpt.pyx":54 - * - * - * def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, # <<<<<<<<<<<<<< - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0.1): - */ - __Pyx_TraceLine(54,0,__PYX_ERR(0, 54, __pyx_L1_error)) - __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10)) __PYX_ERR(0, 54, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7)) __PYX_ERR(0, 54, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_8 = 0; - __pyx_t_7 = 0; - __pyx_t_6 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_5wiener_like, 0, __pyx_n_s_wiener_like, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like, __pyx_t_5) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "wfpt.pyx":79 - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(79,0,__PYX_ERR(0, 79, __pyx_L1_error)) - __pyx_t_5 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "wfpt.pyx":80 - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t i - */ - __Pyx_TraceLine(80,0,__PYX_ERR(0, 80, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - - /* "wfpt.pyx":78 - * return sum_logp - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - __Pyx_TraceLine(78,0,__PYX_ERR(0, 78, __pyx_L1_error)) - __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, Py_None)) __PYX_ERR(0, 78, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_6)) __PYX_ERR(0, 78, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error); - __pyx_t_5 = 0; - __pyx_t_4 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_7wiener_like_multi, 0, __pyx_n_s_wiener_like_multi, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi, __pyx_t_10) < 0) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "wfpt.pyx":119 - * np.ndarray[double, ndim=1] st, - * double err, - * int n_st=10, # <<<<<<<<<<<<<< - * int n_sz=10, - * bint use_adaptive=1, - */ - __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error)) - __pyx_t_10 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - - /* "wfpt.pyx":120 - * double err, - * int n_st=10, - * int n_sz=10, # <<<<<<<<<<<<<< - * bint use_adaptive=1, - * double simps_err=1e-8, - */ - __Pyx_TraceLine(120,0,__PYX_ERR(0, 120, __pyx_L1_error)) - __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "wfpt.pyx":121 - * int n_st=10, - * int n_sz=10, - * bint use_adaptive=1, # <<<<<<<<<<<<<< - * double simps_err=1e-8, - * double p_outlier=0, - */ - __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error)) - __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - - /* "wfpt.pyx":122 - * int n_sz=10, - * bint use_adaptive=1, - * double simps_err=1e-8, # <<<<<<<<<<<<<< - * double p_outlier=0, - * double w_outlier=0.1): - */ - __Pyx_TraceLine(122,0,__PYX_ERR(0, 122, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "wfpt.pyx":123 - * bint use_adaptive=1, - * double simps_err=1e-8, - * double p_outlier=0, # <<<<<<<<<<<<<< - * double w_outlier=0.1): - * - */ - __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error)) - __pyx_t_6 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "wfpt.pyx":124 - * double simps_err=1e-8, - * double p_outlier=0, - * double w_outlier=0.1): # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error)) - __pyx_t_4 = PyFloat_FromDouble(((double)0.1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "wfpt.pyx":110 - * return sum_logp - * - * def wiener_logp_array(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] v, - * np.ndarray[double, ndim=1] sv, - */ - __Pyx_TraceLine(110,0,__PYX_ERR(0, 110, __pyx_L1_error)) - __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10)) __PYX_ERR(0, 110, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9)) __PYX_ERR(0, 110, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_8)) __PYX_ERR(0, 110, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error); - __pyx_t_10 = 0; - __pyx_t_9 = 0; - __pyx_t_8 = 0; - __pyx_t_7 = 0; - __pyx_t_6 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_9wiener_logp_array, 0, __pyx_n_s_wiener_logp_array, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_logp_array, __pyx_t_4) < 0) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":156 - * double q, double alpha, double pos_alpha, double v, - * double sv, double a, double z, double sz, double t, - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "wfpt.pyx":157 - * double sv, double a, double z, double sz, double t, - * double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t i, j - */ - __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "wfpt.pyx":150 - * return logp - * - * def wiener_like_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - __Pyx_TraceLine(150,0,__PYX_ERR(0, 150, __pyx_L1_error)) - __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_11wiener_like_rlddm, 0, __pyx_n_s_wiener_like_rlddm, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlddm, __pyx_t_9) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "wfpt.pyx":237 - * np.ndarray[double, ndim=1] params_rl, - * np.ndarray[double, ndim=2] params_bnds, - * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< - * - * cdef double v = params_ssm[0] - */ - __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - - /* "wfpt.pyx":228 - * - * - * def wiener_like_rlssm_nn(str model, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] x, - * np.ndarray[long, ndim=1] response, - */ - __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error)) - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(0, 228, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_None)) __PYX_ERR(0, 228, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_13wiener_like_rlssm_nn, 0, __pyx_n_s_wiener_like_rlssm_nn, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlssm_nn, __pyx_t_10) < 0) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "wfpt.pyx":346 - * np.ndarray[long, ndim=1] split_by, - * double q, double alpha, double pos_alpha, double v, double z, - * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, # <<<<<<<<<<<<<< - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = response.shape[0] - */ - __Pyx_TraceLine(346,0,__PYX_ERR(0, 346, __pyx_L1_error)) - __pyx_t_10 = PyFloat_FromDouble(((double)1e-4)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "wfpt.pyx":347 - * double q, double alpha, double pos_alpha, double v, double z, - * double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< - * cdef Py_ssize_t size = response.shape[0] - * cdef Py_ssize_t i, j - */ - __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error)) - __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "wfpt.pyx":342 - * - * - * def wiener_like_rl(np.ndarray[long, ndim=1] response, # <<<<<<<<<<<<<< - * np.ndarray[double, ndim=1] feedback, - * np.ndarray[long, ndim=1] split_by, - */ - __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error)) - __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10)) __PYX_ERR(0, 342, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8)) __PYX_ERR(0, 342, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9)) __PYX_ERR(0, 342, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error); - __pyx_t_10 = 0; - __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_7 = 0; - __pyx_t_6 = 0; - __pyx_t_5 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_15wiener_like_rl, 0, __pyx_n_s_wiener_like_rl, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rl, __pyx_t_4) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":430 - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "wfpt.pyx":431 - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t i - */ - __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "wfpt.pyx":429 - * - * - * def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, # <<<<<<<<<<<<<< - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error)) - __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, Py_None)) __PYX_ERR(0, 429, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_2 = 0; - __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_17wiener_like_multi, 0, __pyx_n_s_wiener_like_multi, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi, __pyx_t_9) < 0) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "wfpt.pyx":467 - * np.ndarray[long, ndim=1] split_by, - * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< - * double p_outlier=0, double w_outlier=0): - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error)) - __pyx_t_9 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "wfpt.pyx":468 - * double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, - * int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< - * cdef Py_ssize_t size = x.shape[0] - * cdef Py_ssize_t ij - */ - __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error)) - __pyx_t_5 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "wfpt.pyx":462 - * - * - * def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, # <<<<<<<<<<<<<< - * np.ndarray[long, ndim=1] response, - * np.ndarray[double, ndim=1] feedback, - */ - __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error)) - __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None)) __PYX_ERR(0, 462, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9)) __PYX_ERR(0, 462, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_8)) __PYX_ERR(0, 462, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7)) __PYX_ERR(0, 462, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_6)) __PYX_ERR(0, 462, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_8 = 0; - __pyx_t_7 = 0; - __pyx_t_6 = 0; - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_19wiener_like_multi_rlddm, 0, __pyx_n_s_wiener_like_multi_rlddm, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_rlddm, __pyx_t_2) < 0) __PYX_ERR(0, 462, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "wfpt.pyx":516 - * double q, - * np.ndarray[double, ndim=2] params_bnds, - * double p_outlier=0, double w_outlier=0, network = None): # <<<<<<<<<<<<<< - * cdef double rl_alpha - * cdef Py_ssize_t size = x.shape[0] - */ - __Pyx_TraceLine(516,0,__PYX_ERR(0, 516, __pyx_L1_error)) - __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "wfpt.pyx":508 - * - * - * def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, # <<<<<<<<<<<<<< - * np.ndarray[float, ndim=2] rl_arr, - * np.ndarray[double, ndim=1] x, - */ - __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error)) - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None)) __PYX_ERR(0, 508, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_21wiener_like_rlssm_nn_reg, 0, __pyx_n_s_wiener_like_rlssm_nn_reg, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_rlssm_nn_reg, __pyx_t_4) < 0) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "wfpt.pyx":590 - * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, - * double sv, double a, double z, double sz, double t, double st, double t_min, - * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, # <<<<<<<<<<<<<< - * double simps_err=1e-8): - * """Wiener likelihood function where RTs could come from a - */ - __Pyx_TraceLine(590,0,__PYX_ERR(0, 590, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(((int)10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "wfpt.pyx":591 - * double sv, double a, double z, double sz, double t, double st, double t_min, - * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, - * double simps_err=1e-8): # <<<<<<<<<<<<<< - * """Wiener likelihood function where RTs could come from a - * separate, uniform contaminant distribution. - */ - __Pyx_TraceLine(591,0,__PYX_ERR(0, 591, __pyx_L1_error)) - __pyx_t_6 = PyFloat_FromDouble(((double)1e-8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "wfpt.pyx":588 - * return sum_logp - * - * def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, # <<<<<<<<<<<<<< - * double sv, double a, double z, double sz, double t, double st, double t_min, - * double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, - */ - __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error)) - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(0, 588, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_23wiener_like_contaminant, 0, __pyx_n_s_wiener_like_contaminant, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_contaminant, __pyx_t_6) < 0) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "wfpt.pyx":620 - * - * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, - * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, # <<<<<<<<<<<<<< - * double p_outlier=0, double w_outlier=0): - * """ - */ - __Pyx_TraceLine(620,0,__PYX_ERR(0, 620, __pyx_L1_error)) - __pyx_t_6 = __Pyx_PyInt_From_int(((int)0x1F4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(((double)5.)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_From_int(((int)2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyFloat_FromDouble(((double)1e-3)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - - /* "wfpt.pyx":621 - * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, - * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): # <<<<<<<<<<<<<< - * """ - * generate cdf vector using the pdf - */ - __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - - /* "wfpt.pyx":619 - * return sum_logp - * - * def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, # <<<<<<<<<<<<<< - * int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, - * double p_outlier=0, double w_outlier=0): - */ - __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error)) - __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_5)) __PYX_ERR(0, 619, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_8)) __PYX_ERR(0, 619, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_9)) __PYX_ERR(0, 619, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_10)) __PYX_ERR(0, 619, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_2 = 0; - __pyx_t_5 = 0; - __pyx_t_4 = 0; - __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_25gen_cdf_using_pdf, 0, __pyx_n_s_gen_cdf_using_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_gen_cdf_using_pdf, __pyx_t_10) < 0) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "wfpt.pyx":647 - * - * - * def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): # <<<<<<<<<<<<<< - * - * # get length of data - */ - __Pyx_TraceLine(647,0,__PYX_ERR(0, 647, __pyx_L1_error)) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_27split_cdf, 0, __pyx_n_s_split_cdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_cdf, __pyx_t_10) < 0) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "wfpt.pyx":666 - * - * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, - * double p_outlier = 0, # <<<<<<<<<<<<<< - * double w_outlier = 0, - * network = None): - */ - __Pyx_TraceLine(666,0,__PYX_ERR(0, 666, __pyx_L1_error)) - __pyx_t_10 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - - /* "wfpt.pyx":667 - * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, - * double p_outlier = 0, - * double w_outlier = 0, # <<<<<<<<<<<<<< - * network = None): - * #**kwargs): - */ - __Pyx_TraceLine(667,0,__PYX_ERR(0, 667, __pyx_L1_error)) - __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "wfpt.pyx":665 - * return (x_lb, lb, x_ub, ub) - * - * def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error)) - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10)) __PYX_ERR(0, 665, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None)) __PYX_ERR(0, 665, __pyx_L1_error); - __pyx_t_10 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_29wiener_like_multi_nn_mlp, 0, __pyx_n_s_wiener_like_multi_nn_mlp, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_nn_mlp, __pyx_t_3) < 0) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "wfpt.pyx":687 - * - * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, - * double p_outlier = 0, # <<<<<<<<<<<<<< - * double w_outlier = 0, - * network = None): - */ - __Pyx_TraceLine(687,0,__PYX_ERR(0, 687, __pyx_L1_error)) - __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "wfpt.pyx":688 - * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, - * double p_outlier = 0, - * double w_outlier = 0, # <<<<<<<<<<<<<< - * network = None): - * #**kwargs): - */ - __Pyx_TraceLine(688,0,__PYX_ERR(0, 688, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "wfpt.pyx":686 - * return log_p - * - * def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, # <<<<<<<<<<<<<< - * double p_outlier = 0, - * double w_outlier = 0, - */ - __Pyx_TraceLine(686,0,__PYX_ERR(0, 686, __pyx_L1_error)) - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9)) __PYX_ERR(0, 686, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None)) __PYX_ERR(0, 686, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4wfpt_31wiener_like_multi_nn_mlp_pdf, 0, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, NULL, __pyx_n_s_wfpt, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wiener_like_multi_nn_mlp_pdf, __pyx_t_9) < 0) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "wfpt.pyx":1 - * # cython: embedsignature=True # <<<<<<<<<<<<<< - * # cython: cdivision=True - * # cython: wraparound=False - */ - __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error)) - __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_TraceReturn(Py_None, 0); - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init wfpt", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); - } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init wfpt"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif -} -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#endif - - - -/* #### Code section: utility_code_def ### */ - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* PyObjectGetAttrStrNoError */ -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; - } - return exc_info; -} -#endif - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif -} -#endif - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) -#endif -{ - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 - local_value = tstate->current_exception; - tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif - } - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* ErrOccurredWithGIL */ -static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) { - int err; - #ifdef WITH_THREAD - PyGILState_STATE _save = PyGILState_Ensure(); - #endif - err = !!PyErr_Occurred(); - #ifdef WITH_THREAD - PyGILState_Release(_save); - #endif - return err; -} - -/* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} -static CYTHON_INLINE PyObject * -__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return PyList_New(0); - } - res = PyList_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); - return res; -} -#endif - -/* BytesEquals */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } -#endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } - } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -/* fastcall */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) -{ - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); - for (i = 0; i < n; i++) - { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; - } - for (i = 0; i < n; i++) - { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); - if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error - return kwvalues[i]; - } - } - return NULL; // not found (no exception set) -} -#endif - -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; -#endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; -#endif - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values - Py_DECREF(key); -#endif - key = NULL; - value = NULL; - continue; - } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* IsLittleEndian */ -static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) -{ - union { - uint32_t u32; - uint8_t u8[4]; - } S; - S.u32 = 0x01020304; - return S.u8[0] == 4; -} - -/* BufferFormatCheck */ -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type) { - stack[0].field = &ctx->root; - stack[0].parent_offset = 0; - ctx->root.type = type; - ctx->root.name = "buffer dtype"; - ctx->root.offset = 0; - ctx->head = stack; - ctx->head->field = &ctx->root; - ctx->fmt_offset = 0; - ctx->head->parent_offset = 0; - ctx->new_packmode = '@'; - ctx->enc_packmode = '@'; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->is_complex = 0; - ctx->is_valid_array = 0; - ctx->struct_alignment = 0; - while (type->typegroup == 'S') { - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = 0; - type = type->fields->type; - } -} -static int __Pyx_BufFmt_ParseNumber(const char** ts) { - int count; - const char* t = *ts; - if (*t < '0' || *t > '9') { - return -1; - } else { - count = *t++ - '0'; - while (*t >= '0' && *t <= '9') { - count *= 10; - count += *t++ - '0'; - } - } - *ts = t; - return count; -} -static int __Pyx_BufFmt_ExpectNumber(const char **ts) { - int number = __Pyx_BufFmt_ParseNumber(ts); - if (number == -1) - PyErr_Format(PyExc_ValueError,\ - "Does not understand character buffer dtype format string ('%c')", **ts); - return number; -} -static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { - PyErr_Format(PyExc_ValueError, - "Unexpected format string character: '%c'", ch); -} -static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { - switch (ch) { - case '?': return "'bool'"; - case 'c': return "'char'"; - case 'b': return "'signed char'"; - case 'B': return "'unsigned char'"; - case 'h': return "'short'"; - case 'H': return "'unsigned short'"; - case 'i': return "'int'"; - case 'I': return "'unsigned int'"; - case 'l': return "'long'"; - case 'L': return "'unsigned long'"; - case 'q': return "'long long'"; - case 'Q': return "'unsigned long long'"; - case 'f': return (is_complex ? "'complex float'" : "'float'"); - case 'd': return (is_complex ? "'complex double'" : "'double'"); - case 'g': return (is_complex ? "'complex long double'" : "'long double'"); - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - case 's': case 'p': return "a string"; - case 0: return "end"; - default: return "unparsable format string"; - } -} -static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return 2; - case 'i': case 'I': case 'l': case 'L': return 4; - case 'q': case 'Q': return 8; - case 'f': return (is_complex ? 8 : 4); - case 'd': return (is_complex ? 16 : 8); - case 'g': { - PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); - return 0; - } - case 'O': case 'P': return sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(short); - case 'i': case 'I': return sizeof(int); - case 'l': case 'L': return sizeof(long); - #ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(PY_LONG_LONG); - #endif - case 'f': return sizeof(float) * (is_complex ? 2 : 1); - case 'd': return sizeof(double) * (is_complex ? 2 : 1); - case 'g': return sizeof(long double) * (is_complex ? 2 : 1); - case 'O': case 'P': return sizeof(void*); - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} -typedef struct { char c; short x; } __Pyx_st_short; -typedef struct { char c; int x; } __Pyx_st_int; -typedef struct { char c; long x; } __Pyx_st_long; -typedef struct { char c; float x; } __Pyx_st_float; -typedef struct { char c; double x; } __Pyx_st_double; -typedef struct { char c; long double x; } __Pyx_st_longdouble; -typedef struct { char c; void *x; } __Pyx_st_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) { - CYTHON_UNUSED_VAR(is_complex); - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_st_float) - sizeof(float); - case 'd': return sizeof(__Pyx_st_double) - sizeof(double); - case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -/* These are for computing the padding at the end of the struct to align - on the first member of the struct. This will probably the same as above, - but we don't have any guarantees. - */ -typedef struct { short x; char c; } __Pyx_pad_short; -typedef struct { int x; char c; } __Pyx_pad_int; -typedef struct { long x; char c; } __Pyx_pad_long; -typedef struct { float x; char c; } __Pyx_pad_float; -typedef struct { double x; char c; } __Pyx_pad_double; -typedef struct { long double x; char c; } __Pyx_pad_longdouble; -typedef struct { void *x; char c; } __Pyx_pad_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) { - CYTHON_UNUSED_VAR(is_complex); - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); - case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); - case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} -static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { - switch (ch) { - case 'c': - return 'H'; - case 'b': case 'h': case 'i': - case 'l': case 'q': case 's': case 'p': - return 'I'; - case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': - return 'U'; - case 'f': case 'd': case 'g': - return (is_complex ? 'C' : 'R'); - case 'O': - return 'O'; - case 'P': - return 'P'; - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} -static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { - if (ctx->head == NULL || ctx->head->field == &ctx->root) { - const char* expected; - const char* quote; - if (ctx->head == NULL) { - expected = "end"; - quote = ""; - } else { - expected = ctx->head->field->type->name; - quote = "'"; - } - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected %s%s%s but got %s", - quote, expected, quote, - __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); - } else { - __Pyx_StructField* field = ctx->head->field; - __Pyx_StructField* parent = (ctx->head - 1)->field; - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", - field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), - parent->type->name, field->name); - } -} -static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { - char group; - size_t size, offset, arraysize = 1; - if (ctx->enc_type == 0) return 0; - if (ctx->head->field->type->arraysize[0]) { - int i, ndim = 0; - if (ctx->enc_type == 's' || ctx->enc_type == 'p') { - ctx->is_valid_array = ctx->head->field->type->ndim == 1; - ndim = 1; - if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { - PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %zu", - ctx->head->field->type->arraysize[0], ctx->enc_count); - return -1; - } - } - if (!ctx->is_valid_array) { - PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", - ctx->head->field->type->ndim, ndim); - return -1; - } - for (i = 0; i < ctx->head->field->type->ndim; i++) { - arraysize *= ctx->head->field->type->arraysize[i]; - } - ctx->is_valid_array = 0; - ctx->enc_count = 1; - } - group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); - do { - __Pyx_StructField* field = ctx->head->field; - __Pyx_TypeInfo* type = field->type; - if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { - size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); - } else { - size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); - } - if (ctx->enc_packmode == '@') { - size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); - size_t align_mod_offset; - if (align_at == 0) return -1; - align_mod_offset = ctx->fmt_offset % align_at; - if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; - if (ctx->struct_alignment == 0) - ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, - ctx->is_complex); - } - if (type->size != size || type->typegroup != group) { - if (type->typegroup == 'C' && type->fields != NULL) { - size_t parent_offset = ctx->head->parent_offset + field->offset; - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = parent_offset; - continue; - } - if ((type->typegroup == 'H' || group == 'H') && type->size == size) { - } else { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - } - offset = ctx->head->parent_offset + field->offset; - if (ctx->fmt_offset != offset) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", - (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); - return -1; - } - ctx->fmt_offset += size; - if (arraysize) - ctx->fmt_offset += (arraysize - 1) * size; - --ctx->enc_count; - while (1) { - if (field == &ctx->root) { - ctx->head = NULL; - if (ctx->enc_count != 0) { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - break; - } - ctx->head->field = ++field; - if (field->type == NULL) { - --ctx->head; - field = ctx->head->field; - continue; - } else if (field->type->typegroup == 'S') { - size_t parent_offset = ctx->head->parent_offset + field->offset; - if (field->type->fields->type == NULL) continue; - field = field->type->fields; - ++ctx->head; - ctx->head->field = field; - ctx->head->parent_offset = parent_offset; - break; - } else { - break; - } - } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 0; -} -static int -__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) -{ - const char *ts = *tsp; - int i = 0, number, ndim; - ++ts; - if (ctx->new_count != 1) { - PyErr_SetString(PyExc_ValueError, - "Cannot handle repeated arrays in format string"); - return -1; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1; - ndim = ctx->head->field->type->ndim; - while (*ts && *ts != ')') { - switch (*ts) { - case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; - default: break; - } - number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return -1; - if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) { - PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %d", - ctx->head->field->type->arraysize[i], number); - return -1; - } - if (*ts != ',' && *ts != ')') { - PyErr_Format(PyExc_ValueError, - "Expected a comma in format string, got '%c'", *ts); - return -1; - } - if (*ts == ',') ts++; - i++; - } - if (i != ndim) { - PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", - ctx->head->field->type->ndim, i); - return -1; - } - if (!*ts) { - PyErr_SetString(PyExc_ValueError, - "Unexpected end of format string, expected ')'"); - return -1; - } - ctx->is_valid_array = 1; - ctx->new_count = 1; - *tsp = ++ts; - return 0; -} -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { - int got_Z = 0; - while (1) { - switch(*ts) { - case 0: - if (ctx->enc_type != 0 && ctx->head == NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - return ts; - case ' ': - case '\r': - case '\n': - ++ts; - break; - case '<': - if (!__Pyx_Is_Little_Endian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_Is_Little_Endian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '=': - case '@': - case '^': - ctx->new_packmode = *ts++; - break; - case 'T': - { - const char* ts_after_sub; - size_t i, struct_count = ctx->new_count; - size_t struct_alignment = ctx->struct_alignment; - ctx->new_count = 1; - ++ts; - if (*ts != '{') { - PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - ctx->enc_count = 0; - ctx->struct_alignment = 0; - ++ts; - ts_after_sub = ts; - for (i = 0; i != struct_count; ++i) { - ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); - if (!ts_after_sub) return NULL; - } - ts = ts_after_sub; - if (struct_alignment) ctx->struct_alignment = struct_alignment; - } - break; - case '}': - { - size_t alignment = ctx->struct_alignment; - ++ts; - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - if (alignment && ctx->fmt_offset % alignment) { - ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); - } - } - return ts; - case 'x': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->fmt_offset += ctx->new_count; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->enc_packmode = ctx->new_packmode; - ++ts; - break; - case 'Z': - got_Z = 1; - ++ts; - if (*ts != 'f' && *ts != 'd' && *ts != 'g') { - __Pyx_BufFmt_RaiseUnexpectedChar('Z'); - return NULL; - } - CYTHON_FALLTHROUGH; - case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': - case 'l': case 'L': case 'q': case 'Q': - case 'f': case 'd': case 'g': - case 'O': case 'p': - if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && - (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { - ctx->enc_count += ctx->new_count; - ctx->new_count = 1; - got_Z = 0; - ++ts; - break; - } - CYTHON_FALLTHROUGH; - case 's': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_count = ctx->new_count; - ctx->enc_packmode = ctx->new_packmode; - ctx->enc_type = *ts; - ctx->is_complex = got_Z; - ++ts; - ctx->new_count = 1; - got_Z = 0; - break; - case ':': - ++ts; - while(*ts != ':') ++ts; - ++ts; - break; - case '(': - if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL; - break; - default: - { - int number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - ctx->new_count = (size_t)number; - } - } - } -} - -/* BufferGetAndValidate */ - static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (unlikely(info->buf == NULL)) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} -static void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} -static int __Pyx__GetBufferAndValidate( - Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, - int nd, int cast, __Pyx_BufFmt_StackElem* stack) -{ - buf->buf = NULL; - if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { - __Pyx_ZeroBuffer(buf); - return -1; - } - if (unlikely(buf->ndim != nd)) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if (unlikely((size_t)buf->itemsize != dtype->size)) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_SafeReleaseBuffer(buf); - return -1; -} - -/* PyDictVersioning */ - #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ - #if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - __Pyx_TypeName obj_type_name; - __Pyx_TypeName type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(__Pyx_TypeCheck(obj, type))) - return 1; - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_TypeError, - "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, - obj_type_name, type_name); - __Pyx_DECREF_TypeName(obj_type_name); - __Pyx_DECREF_TypeName(type_name); - return 0; -} - -/* BufferFallbackError */ - static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_SetString(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); -} - -/* PyFunctionFastCall */ - #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectFastCall */ - static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result = 0; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; - } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - bad: - Py_DECREF(argstuple); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { -#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) - if (__Pyx_IsCyOrPyCFunction(func)) -#else - if (PyCFunction_Check(func)) -#endif - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - } - else if (nargs == 1 && kwargs == NULL) { - if (PyCFunction_Check(func)) - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, args[0]); - } - } - } -#endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - #if PY_VERSION_HEX >= 0x030700A1 - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif - #if CYTHON_VECTORCALL - #if Py_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif - if (f) { - return f(func, args, (size_t)nargs, kwargs); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, kwargs); - } - #endif - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); - } - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); -} - -/* DictGetItem */ - #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - if (unlikely(PyTuple_Check(key))) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) { - PyErr_SetObject(PyExc_KeyError, args); - Py_DECREF(args); - } - } else { - PyErr_SetObject(PyExc_KeyError, key); - } - } - return NULL; - } - Py_INCREF(value); - return value; -} -#endif - -/* GetItemInt */ - static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); - if (unlikely(!key)) return NULL; - r = mm->mp_subscript(o, key); - Py_DECREF(key); - return r; - } - if (likely(sm && sm->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* PyObjectCallOneArg */ - static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* ObjectGetItem */ - #if CYTHON_USE_TYPE_SLOTS -static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { - PyObject *runerr = NULL; - Py_ssize_t key_value; - key_value = __Pyx_PyIndex_AsSsize_t(index); - if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); - } - if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); - PyErr_Clear(); - PyErr_Format(PyExc_IndexError, - "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); - __Pyx_DECREF_TypeName(index_type_name); - } - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { - __Pyx_TypeName obj_type_name; - if (likely(PyType_Check(obj))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); - if (meth) { - PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); - Py_DECREF(meth); - return result; - } - } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { - PyTypeObject *tp = Py_TYPE(obj); - PyMappingMethods *mm = tp->tp_as_mapping; - PySequenceMethods *sm = tp->tp_as_sequence; - if (likely(mm && mm->mp_subscript)) { - return mm->mp_subscript(obj, key); - } - if (likely(sm && sm->sq_item)) { - return __Pyx_PyObject_GetIndex(obj, key); - } - return __Pyx_PyObject_GetItem_Slow(obj, key); -} -#endif - -/* PyIntCompare */ - static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_UNUSED_VAR(inplace); - if (op1 == op2) { - return 0; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - return (a != b); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); - const digit* digits = __Pyx_PyLong_Digits(op1); - if (intval == 0) { - return (__Pyx_PyLong_IsZero(op1) != 1); - } else if (intval < 0) { - if (__Pyx_PyLong_IsNonNeg(op1)) - return 1; - intval = -intval; - } else { - if (__Pyx_PyLong_IsNeg(op1)) - return 1; - } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - return (unequal != 0); - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - return ((double)a != (double)b); - } - return __Pyx_PyObject_IsTrueAndDecref( - PyObject_RichCompare(op1, op2, Py_NE)); -} - -/* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_MAYBE_UNUSED_VAR(inplace); - CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a - (unsigned long)b); - if (likely((x^a) >= 0 || (x^~b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_subtract(op1, op2); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; -#endif - if (unlikely(__Pyx_PyLong_IsZero(op1))) { - return PyLong_FromLong(-intval); - } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); - } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); - } - } - x = a - b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: - llx = lla - llb; - return PyLong_FromLongLong(llx); -#endif - - - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - double result; - - PyFPE_START_PROTECT("subtract", return NULL) - result = ((double)a) - (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); - } - return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); -} -#endif - -/* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_MAYBE_UNUSED_VAR(inplace); - CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op2))) { - const long a = intval; - long x; - long b = PyInt_AS_LONG(op2); - - x = (long)((unsigned long)a + (unsigned long)b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op2))) { - const long a = intval; - long b, x; -#ifdef HAVE_LONG_LONG - const PY_LONG_LONG lla = intval; - PY_LONG_LONG llb, llx; -#endif - if (unlikely(__Pyx_PyLong_IsZero(op2))) { - return __Pyx_NewRef(op1); - } - if (likely(__Pyx_PyLong_IsCompact(op2))) { - b = __Pyx_PyLong_CompactValue(op2); - } else { - const digit* digits = __Pyx_PyLong_Digits(op2); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - } - x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); -#endif - - - } - #endif - if (PyFloat_CheckExact(op2)) { - const long a = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double b = __pyx_PyFloat_AsDouble(op2); -#else - double b = PyFloat_AS_DOUBLE(op2); -#endif - double result; - - PyFPE_START_PROTECT("add", return NULL) - result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); - } - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); -} -#endif - -/* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_2 -#define __PYX_HAVE_RT_ImportType_3_0_2 -static PyTypeObject *__Pyx_ImportType_3_0_2(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_2 check_size) -{ - PyObject *result = 0; - char warning[200]; - Py_ssize_t basicsize; - Py_ssize_t itemsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - PyObject *py_itemsize; -#endif - result = PyObject_GetAttrString(module, class_name); - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#if !CYTHON_COMPILING_IN_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; - itemsize = ((PyTypeObject *)result)->tp_itemsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; - py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); - if (!py_itemsize) - goto bad; - itemsize = PyLong_AsSsize_t(py_itemsize); - Py_DECREF(py_itemsize); - py_itemsize = 0; - if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (itemsize) { - if (size % alignment) { - alignment = size % alignment; - } - if (itemsize < (Py_ssize_t)alignment) - itemsize = (Py_ssize_t)alignment; - } - if ((size_t)(basicsize + itemsize) < size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize+itemsize); - goto bad; - } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_2 && - ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd-%zd from PyObject", - module_name, class_name, size, basicsize, basicsize+itemsize); - goto bad; - } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_2 && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(result); - return NULL; -} -#endif - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif - } - } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif - return module; -} - -/* ImportDottedModule */ - #if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 - PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif - "No module named '%U'", partial_name); -#endif -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; - nparts = PyTuple_GET_SIZE(parts_tuple); - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = PySequence_ITEM(parts_tuple, i); -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -#endif -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__24; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - const char* module_name_str = 0; - PyObject* module_name = 0; - PyObject* module_dot = 0; - PyObject* full_name = 0; - PyErr_Clear(); - module_name_str = PyModule_GetName(module); - if (unlikely(!module_name_str)) { goto modbad; } - module_name = PyUnicode_FromString(module_name_str); - if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__25); - if (unlikely(!module_dot)) { goto modbad; } - full_name = PyUnicode_Concat(module_dot, name); - if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - { - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - goto modbad; - value = PyObject_GetItem(modules, full_name); - } - #else - value = PyImport_GetModule(full_name); - #endif - modbad: - Py_XDECREF(full_name); - Py_XDECREF(module_dot); - Py_XDECREF(module_name); - } - if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* FixUpExtensionType */ - #if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - CYTHON_UNUSED_VAR(spec); - CYTHON_UNUSED_VAR(type); -#else - const PyType_Slot *slot = spec->slots; - while (slot && slot->slot && slot->slot != Py_tp_members) - slot++; - if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) - const -#endif - PyMemberDef *memb = (PyMemberDef*) slot->pfunc; - while (memb && memb->name) { - if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 - if (strcmp(memb->name, "__weaklistoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_weaklistoffset = memb->offset; - changed = 1; - } - else if (strcmp(memb->name, "__dictoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_dictoffset = memb->offset; - changed = 1; - } -#if CYTHON_METH_FASTCALL - else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 - type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif - changed = 1; - } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON - else if (strcmp(memb->name, "__module__") == 0) { - PyObject *descr; - assert(memb->type == T_OBJECT); - assert(memb->flags == 0 || memb->flags == READONLY); - descr = PyDescr_NewMember(type, memb); - if (unlikely(!descr)) - return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); - return -1; - } - Py_DECREF(descr); - changed = 1; - } -#endif - } - memb++; - } - if (changed) - PyType_Modified(type); - } -#endif - return 0; -} -#endif - -/* FetchSharedCythonModule */ - static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); - if (unlikely(!abi_module)) return NULL; - Py_INCREF(abi_module); - return abi_module; -} - -/* FetchCommonType */ - static int __Pyx_VerifyCachedType(PyObject *cached_type, - const char *name, - Py_ssize_t basicsize, - Py_ssize_t expected_basicsize) { - if (!PyType_Check(cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", name); - return -1; - } - if (basicsize != expected_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - name); - return -1; - } - return 0; -} -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; - const char* object_name = strrchr(spec->name, '.'); - object_name = object_name ? object_name+1 : spec->name; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif - if (__Pyx_VerifyCachedType( - cached_type, - object_name, - basicsize, - spec->basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); - if (unlikely(!cached_type)) goto bad; - if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; -done: - Py_DECREF(abi_module); - assert(cached_type == NULL || PyType_Check(cached_type)); - return (PyTypeObject *) cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#endif - -/* PyVectorcallFastCallDict */ - #if CYTHON_METH_FASTCALL -static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - PyObject *res = NULL; - PyObject *kwnames; - PyObject **newargs; - PyObject **kwvalues; - Py_ssize_t i, pos; - size_t j; - PyObject *key, *value; - unsigned long keys_are_strings; - Py_ssize_t nkw = PyDict_GET_SIZE(kw); - newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); - if (unlikely(newargs == NULL)) { - PyErr_NoMemory(); - return NULL; - } - for (j = 0; j < nargs; j++) newargs[j] = args[j]; - kwnames = PyTuple_New(nkw); - if (unlikely(kwnames == NULL)) { - PyMem_Free(newargs); - return NULL; - } - kwvalues = newargs + nargs; - pos = i = 0; - keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; - Py_INCREF(key); - Py_INCREF(value); - PyTuple_SET_ITEM(kwnames, i, key); - kwvalues[i] = value; - i++; - } - if (unlikely(!keys_are_strings)) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - goto cleanup; - } - res = vc(func, newargs, nargs, kwnames); -cleanup: - Py_DECREF(kwnames); - for (i = 0; i < nkw; i++) - Py_DECREF(kwvalues[i]); - PyMem_Free(newargs); - return res; -} -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { - return vc(func, args, nargs, NULL); - } - return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); -} -#endif - -/* CythonFunctionShared */ - static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - __Pyx_Py_XDECREF_SET( - __Pyx_CyFunction_GetClassObj(f), - ((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#else - __Pyx_Py_XDECREF_SET( - ((PyCMethodObject *) (f))->mm_class, - (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#endif -} -static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) -{ - CYTHON_UNUSED_VAR(closure); - if (unlikely(op->func_doc == NULL)) { -#if CYTHON_COMPILING_IN_LIMITED_API - op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); - if (unlikely(!op->func_doc)) return NULL; -#else - if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 - op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } -#endif - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_doc, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_name == NULL)) { -#if CYTHON_COMPILING_IN_LIMITED_API - op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_name, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_qualname); - return op->func_qualname; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_qualname, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(op); - CYTHON_UNUSED_VAR(context); - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - CYTHON_UNUSED_VAR(context); - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value || value == Py_None) { - value = NULL; - } else if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - __Pyx_Py_XDECREF_SET(op->func_annotations, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; - CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 - if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; - fromlist = PyList_New(1); - if (unlikely(!fromlist)) return NULL; - Py_INCREF(marker); -#if CYTHON_ASSUME_SAFE_MACROS - PyList_SET_ITEM(fromlist, 0, marker); -#else - if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); - Py_DECREF(fromlist); - return NULL; - } -#endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); - Py_DECREF(fromlist); - if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); - Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); - } -ignore: - PyErr_Clear(); - } -#endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); -} -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject * -__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { - CYTHON_UNUSED_VAR(context); - return PyObject_GetAttrString(op->func, "__module__"); -} -static int -__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - return PyObject_SetAttrString(op->func, "__module__", value); -} -#endif -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, -#if CYTHON_COMPILING_IN_LIMITED_API - {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, -#endif - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, -#endif -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, -#if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, -#else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#endif -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, -#else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, -#endif -#endif - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) -{ - CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 - Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { -#if !CYTHON_COMPILING_IN_LIMITED_API - PyCFunctionObject *cf = (PyCFunctionObject*) op; -#endif - if (unlikely(op == NULL)) - return NULL; -#if CYTHON_COMPILING_IN_LIMITED_API - op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); - if (unlikely(!op->func)) return NULL; -#endif - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; -#if !CYTHON_COMPILING_IN_LIMITED_API - cf->m_ml = ml; - cf->m_self = (PyObject *) op; -#endif - Py_XINCREF(closure); - op->func_closure = closure; -#if !CYTHON_COMPILING_IN_LIMITED_API - Py_XINCREF(module); - cf->m_module = module; -#endif - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - op->func_classobj = NULL; -#else - ((PyCMethodObject*)op)->mm_class = NULL; -#endif - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - op->func_is_coroutine = NULL; -#if CYTHON_METH_FASTCALL - switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { - case METH_NOARGS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; - break; - case METH_O: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; - break; - case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; - break; - case METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; - break; - case METH_VARARGS | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = NULL; - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - Py_DECREF(op); - return NULL; - } -#endif - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); -#if CYTHON_COMPILING_IN_LIMITED_API - Py_CLEAR(m->func); -#else - Py_CLEAR(((PyCFunctionObject*)m)->m_module); -#endif - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 - Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); -#else - { - PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; - ((PyCMethodObject *) (m))->mm_class = NULL; - Py_XDECREF(cls); - } -#endif -#endif - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } - return 0; -} -static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - __Pyx_PyHeapTypeObject_GC_Del(m); -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - __Pyx__CyFunction_dealloc(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - Py_VISIT(m->func_closure); -#if CYTHON_COMPILING_IN_LIMITED_API - Py_VISIT(m->func); -#else - Py_VISIT(((PyCFunctionObject*)m)->m_module); -#endif - Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API - Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } - return 0; -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", - op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif -} -static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; - PyCFunction meth; - int flags; - meth = PyCFunction_GetFunction(f); - if (unlikely(!meth)) return NULL; - flags = PyCFunction_GetFlags(f); - if (unlikely(flags < 0)) return NULL; -#else - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - int flags = f->m_ml->ml_flags; -#endif - Py_ssize_t size; - switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(arg); -#else - size = PyTuple_Size(arg); - if (unlikely(size < 0)) return NULL; -#endif - if (likely(size == 0)) - return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(arg); -#else - size = PyTuple_Size(arg); - if (unlikely(size < 0)) return NULL; -#endif - if (likely(size == 1)) { - PyObject *result, *arg0; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - arg0 = PyTuple_GET_ITEM(arg, 0); - #else - arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; - #endif - result = (*meth)(self, arg0); - #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(arg0); - #endif - return result; - } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - return NULL; - } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif - return NULL; -} -static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *self, *result; -#if CYTHON_COMPILING_IN_LIMITED_API - self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); - if (unlikely(!self) && PyErr_Occurred()) return NULL; -#else - self = ((PyCFunctionObject*)func)->m_self; -#endif - result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); - return result; -} -static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { - PyObject *result; - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL - __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); - if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS - return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); -#else - (void) &__Pyx_PyVectorcall_FastCallDict; - return PyVectorcall_Call(func, args, kw); -#endif - } -#endif - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - Py_ssize_t argc; - PyObject *new_args; - PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS - argc = PyTuple_GET_SIZE(args); -#else - argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; -#endif - new_args = PyTuple_GetSlice(args, 1, argc); - if (unlikely(!new_args)) - return NULL; - self = PyTuple_GetItem(args, 0); - if (unlikely(!self)) { - Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 - PyErr_Format(PyExc_TypeError, - "unbound method %.200S() needs an argument", - cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif - return NULL; - } - result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); - Py_DECREF(new_args); - } else { - result = __Pyx_CyFunction_Call(func, args, kw); - } - return result; -} -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) -{ - int ret = 0; - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - ret = 1; - } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - return ret; -} -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, NULL); -} -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, args[0]); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; - PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); -} -#endif -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_CyFunctionType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, - {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, - {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, - {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, - {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, - {Py_tp_methods, (void *)__pyx_CyFunction_methods}, - {Py_tp_members, (void *)__pyx_CyFunction_members}, - {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, - {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, - {0, 0}, -}; -static PyType_Spec __pyx_CyFunctionType_spec = { - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif -}; -#endif -static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { - return -1; - } - return 0; -} -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); - if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -/* CythonFunction */ - static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), - ml, flags, qualname, closure, module, globals, code - ); - if (likely(op)) { - PyObject_GC_Track(op); - } - return op; -} - -/* CLineInTraceback */ - #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; - PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif - CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { - return c_line; - } - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); - if (likely(cython_runtime_dict)) { - __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { - c_line = 0; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - return c_line; -} -#endif - -/* CodeObjectCache */ - #if !CYTHON_COMPILING_IN_LIMITED_API -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} -#endif - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, - PyObject *firstlineno, PyObject *name) { - PyObject *replace = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; - replace = PyObject_GetAttrString(code, "replace"); - if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); - Py_DECREF(replace); - return result; - } - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - PyErr_Clear(); - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #endif -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; - PyObject *replace = NULL, *getframe = NULL, *frame = NULL; - PyObject *exc_type, *exc_value, *exc_traceback; - int success = 0; - if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); - } - PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); - } - if (unlikely(!code_object)) goto bad; - getframe = PySys_GetObject("_getframe"); - if (unlikely(!getframe)) goto bad; - if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; - frame = PyEval_EvalCode(code_object, dict, dict); - if (unlikely(!frame) || frame == Py_None) goto bad; - success = 1; - bad: - PyErr_Restore(exc_type, exc_value, exc_traceback); - Py_XDECREF(code_object); - Py_XDECREF(py_py_line); - Py_XDECREF(py_funcname); - Py_XDECREF(dict); - Py_XDECREF(replace); - if (success) { - PyTraceBack_Here( - (struct _frame*)frame); - } - Py_XDECREF(frame); -} -#else -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = NULL; - PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - funcname = PyUnicode_AsUTF8(py_funcname); - if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif - } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else - py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline - return py_code; -bad: - Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject *ptype, *pvalue, *ptraceback; - if (c_line) { - c_line = __Pyx_CLineForTraceback(tstate, c_line); - } - py_code = __pyx_find_code_object(c_line ? -c_line : py_line); - if (!py_code) { - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) { - /* If the code object creation fails, then we should clear the - fetched exception references and propagate the new exception */ - Py_XDECREF(ptype); - Py_XDECREF(pvalue); - Py_XDECREF(ptraceback); - goto bad; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); - } - py_frame = PyFrame_New( - tstate, /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} -#endif - -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - __Pyx_TypeName obj_type_name; - if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface", - obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return -1; -} -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject *obj = view->obj; - if (!obj) return; - if (PyObject_CheckBuffer(obj)) { - PyBuffer_Release(view); - return; - } - if ((0)) {} - view->obj = NULL; - Py_DECREF(obj); -} -#endif - - - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* Declarations */ - #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* Arithmetic */ - #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) -#else - static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - #if 1 - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - if (b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabsf(b.real) >= fabsf(b.imag)) { - if (b.real == 0 && b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); - } else { - float r = b.imag / b.real; - float s = (float)(1.0) / (b.real + b.imag * r); - return __pyx_t_float_complex_from_parts( - (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); - } - } else { - float r = b.real / b.imag; - float s = (float)(1.0) / (b.imag + b.real * r); - return __pyx_t_float_complex_from_parts( - (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); - } - } - #else - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - if (b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); - } else { - float denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_float_complex_from_parts( - (a.real * b.real + a.imag * b.imag) / denom, - (a.imag * b.real - a.real * b.imag) / denom); - } - } - #endif - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - return __Pyx_c_prod_float(a, a); - case 3: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(z, a); - case 4: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } else if ((b.imag == 0) && (a.real >= 0)) { - z.real = powf(a.real, b.real); - z.imag = 0; - return z; - } else if (a.real > 0) { - r = a.real; - theta = 0; - } else { - r = -a.real; - theta = atan2f(0.0, -1.0); - } - } else { - r = __Pyx_c_abs_float(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; - } - #endif -#endif - -/* Declarations */ - #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* Arithmetic */ - #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) -#else - static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - #if 1 - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabs(b.real) >= fabs(b.imag)) { - if (b.real == 0 && b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); - } else { - double r = b.imag / b.real; - double s = (double)(1.0) / (b.real + b.imag * r); - return __pyx_t_double_complex_from_parts( - (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); - } - } else { - double r = b.real / b.imag; - double s = (double)(1.0) / (b.imag + b.real * r); - return __pyx_t_double_complex_from_parts( - (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); - } - } - #else - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); - } else { - double denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_double_complex_from_parts( - (a.real * b.real + a.imag * b.imag) / denom, - (a.imag * b.real - a.real * b.imag) / denom); - } - } - #endif - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - return __Pyx_c_prod_double(a, a); - case 3: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, a); - case 4: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } else if ((b.imag == 0) && (a.real >= 0)) { - z.real = pow(a.real, b.real); - z.imag = 0; - return z; - } else if (a.real > 0) { - r = a.real; - theta = 0; - } else { - r = -a.real; - theta = atan2(0.0, -1.0); - } - } else { - r = __Pyx_c_abs_double(a); - theta = atan2(a.imag, a.real); - } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; - } - #endif -#endif - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); -#else - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); - if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); - if (!py_bytes) goto limited_bad; - order_str = PyUnicode_FromString(little ? "little" : "big"); - if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; - result = PyObject_Call(from_bytes, arg_tuple, kwds); - limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); - Py_XDECREF(kwds); - return result; -#endif - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); -#else - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); - if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); - if (!py_bytes) goto limited_bad; - order_str = PyUnicode_FromString(little ? "little" : "big"); - if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; - result = PyObject_Call(from_bytes, arg_tuple, kwds); - limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); - Py_XDECREF(kwds); - return result; -#endif - } -} - -/* FormatTypeName */ - #if CYTHON_COMPILING_IN_LIMITED_API -static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) -{ - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__41); - } - return name; -} -#endif - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __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]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* FastTypeChecks */ - #if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { - while (a) { - a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); - if (a == b) - return 1; - } - return b == &PyBaseObject_Type; -} -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (a == b) return 1; - mro = a->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(a, b); -} -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (cls == a || cls == b) return 1; - mro = cls->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - PyObject *base = PyTuple_GET_ITEM(mro, i); - if (base == (PyObject *)a || base == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else -static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - if (exc_type1) { - return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); - } else { - return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); - } -} -#endif -static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - assert(PyExceptionClass_Check(exc_type)); - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i '9'); - break; - } - if (rt_from_call[i] != ctversion[i]) { - same = 0; - break; - } - } - if (!same) { - char rtversion[5] = {'\0'}; - char message[200]; - for (i=0; i<4; ++i) { - if (rt_from_call[i] == '.') { - if (found_dot) break; - found_dot = 1; - } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { - break; - } - rtversion[i] = rt_from_call[i]; - } - PyOS_snprintf(message, sizeof(message), - "compile time version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* InitStrings */ - #if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - if (!*t->p) - return -1; - if (PyObject_Hash(*t->p) == -1) - return -1; - #endif - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} -#else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (likely(PyUnicode_IS_ASCII(o))) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -} -#endif -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { - return __Pyx_PyUnicode_AsStringAndSize(o, length); - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { - int retval; - if (unlikely(!x)) return -1; - retval = __Pyx_PyObject_IsTrue(x); - Py_DECREF(x); - return retval; -} -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 - if (PyLong_Check(result)) { - if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, - "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " - "The ability to return an instance of a strict subclass of int is deprecated, " - "and may be removed in a future version of Python.", - result_type_name)) { - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; - } - __Pyx_DECREF_TypeName(result_type_name); - return result; - } -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { -#if CYTHON_USE_TYPE_SLOTS - PyNumberMethods *m; -#endif - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else - if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); -#if CYTHON_USE_TYPE_SLOTS - m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else - if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); - } - #endif -#else - if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); - } -#endif - if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(__Pyx_PyLong_IsCompact(b))) { - return __Pyx_PyLong_CompactValue(b); - } else { - const digit* digits = __Pyx_PyLong_Digits(b); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - 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])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - 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])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { - if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { - return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif - } else { - Py_ssize_t ival; - PyObject *x; - x = PyNumber_Index(o); - if (!x) return -1; - ival = PyInt_AsLong(x); - Py_DECREF(x); - return ival; - } -} -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -/* #### Code section: utility_code_pragmas_end ### */ -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - - - -/* #### Code section: end ### */ -#endif /* Py_PYTHON_H */ diff --git a/src/hssm/likelihoods/hddm_wfpt/wfpt.pyx b/src/hssm/likelihoods/hddm_wfpt/wfpt.pyx deleted file mode 100644 index 9d410b44..00000000 --- a/src/hssm/likelihoods/hddm_wfpt/wfpt.pyx +++ /dev/null @@ -1,705 +0,0 @@ -# cython: embedsignature=True -# cython: cdivision=True -# cython: wraparound=False -# cython: boundscheck=False -# distutils: language = c++ -# -# Cython version of the Navarro & Fuss, 2009 DDM PDF. Based on the following code by Navarro & Fuss: -# http://www.psychocmath.logy.adelaide.edu.au/personalpages/staff/danielnavarro/resources/wfpt.m -# -# This implementation is about 170 times faster than the matlab -# reference version. -# -# Copyleft Thomas Wiecki (thomas_wiecki[at]brown.edu) & Imri Sofer, 2011 -# GPLv3 - -#import hddm -#from hddm.model_config import model_config - -import scipy.integrate as integrate -from copy import copy -import numpy as np - -cimport numpy as np -cimport cython - -from cython.parallel import * -# cimport openmp - -# include "pdf.pxi" -include 'integrate.pxi' - -def pdf_array(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, - double t, double st, double err=1e-4, bint logp=0, int n_st=2, int n_sz=2, bint use_adaptive=1, - double simps_err=1e-3, double p_outlier=0, double w_outlier=0): - - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i - cdef np.ndarray[double, ndim = 1] y = np.empty(size, dtype=np.double) - - for i in prange(size, nogil=True): - y[i] = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - n_st, n_sz, use_adaptive, simps_err) - - y = y * (1 - p_outlier) + (w_outlier * p_outlier) - if logp == 1: - return np.log(y) - else: - return y - -cdef inline bint p_outlier_in_range(double p_outlier): - return (p_outlier >= 0) & (p_outlier <= 1) - - -def wiener_like(np.ndarray[double, ndim=1] x, double v, double sv, double a, double z, double sz, double t, - double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - double p_outlier=0, double w_outlier=0.1): - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i - cdef double p - cdef double sum_logp = 0 - cdef double wp_outlier = w_outlier * p_outlier - - if not p_outlier_in_range(p_outlier): - return -np.inf - - for i in range(size): - p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - n_st, n_sz, use_adaptive, simps_err) - # If one probability = 0, the log sum will be -Inf - p = p * (1 - p_outlier) + wp_outlier - if p == 0: - return -np.inf - - sum_logp += log(p) - - return sum_logp - -def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, - int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - double p_outlier=0, double w_outlier=0): - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i - cdef double p = 0 - cdef double sum_logp = 0 - cdef double wp_outlier = w_outlier * p_outlier - - if multi is None: - return full_pdf(x, v, sv, a, z, sz, t, st, err) - else: - params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} - params_iter = copy(params) - for i in range(size): - for param in multi: - params_iter[param] = params[param][i] - if abs(x[i]) != 999.: - p = full_pdf(x[i], params_iter['v'], - params_iter['sv'], params_iter['a'], params_iter['z'], - params_iter['sz'], params_iter['t'], params_iter['st'], - err, n_st, n_sz, use_adaptive, simps_err) - p = p * (1 - p_outlier) + wp_outlier - elif x[i] == 999.: - p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - else: # x[i] == -999. - p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - - sum_logp += log(p) - - return sum_logp - -def wiener_logp_array(np.ndarray[double, ndim=1] x, - np.ndarray[double, ndim=1] v, - np.ndarray[double, ndim=1] sv, - np.ndarray[double, ndim=1] a, - np.ndarray[double, ndim=1] z, - np.ndarray[double, ndim=1] sz, - np.ndarray[double, ndim=1] t, - np.ndarray[double, ndim=1] st, - double err, - int n_st=10, - int n_sz=10, - bint use_adaptive=1, - double simps_err=1e-8, - double p_outlier=0, - double w_outlier=0.1): - - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i - cdef np.ndarray[double, ndim=1] logp = np.empty(size, dtype=np.double) - cdef double p - cdef double wp_outlier = w_outlier * p_outlier - - if not p_outlier_in_range(p_outlier): - logp[:] = -np.inf - return logp - - for i in range(size): - p = full_pdf(x[i], v[i], sv[i], a[i], z[i], sz[i], t[i], st[i], err, - n_st, n_sz, use_adaptive, simps_err) - - # If one probability = 0, the log sum will be -Inf - p = p * (1 - p_outlier) + wp_outlier - - if p == 0: - logp[i] = -np.inf - else: - logp[i] = np.log(p) - - return logp - -def wiener_like_rlddm(np.ndarray[double, ndim=1] x, - np.ndarray[long, ndim=1] response, - np.ndarray[double, ndim=1] feedback, - np.ndarray[long, ndim=1] split_by, - double q, double alpha, double pos_alpha, double v, - double sv, double a, double z, double sz, double t, - double st, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - double p_outlier=0, double w_outlier=0): - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i, j - cdef Py_ssize_t s_size - cdef int s - cdef double p - cdef double sum_logp = 0 - cdef double wp_outlier = w_outlier * p_outlier - cdef double alfa - cdef double pos_alfa - cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - cdef np.ndarray[double, ndim=1] xs - cdef np.ndarray[double, ndim=1] feedbacks - cdef np.ndarray[long, ndim=1] responses - cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - - if not p_outlier_in_range(p_outlier): - return -np.inf - - if pos_alpha==100.00: - pos_alfa = alpha - else: - pos_alfa = pos_alpha - - # unique represent # of conditions - for j in range(unique.shape[0]): - s = unique[j] - # select trials for current condition, identified by the split_by-array - feedbacks = feedback[split_by == s] - responses = response[split_by == s] - xs = x[split_by == s] - s_size = xs.shape[0] - qs[0] = q - qs[1] = q - - # don't calculate pdf for first trial but still update q - if feedbacks[0] > qs[responses[0]]: - alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - else: - alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) - - # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - # received on current trial. - qs[responses[0]] = qs[responses[0]] + \ - alfa * (feedbacks[0] - qs[responses[0]]) - - # loop through all trials in current condition - for i in range(1, s_size): - p = full_pdf(xs[i], ((qs[1] - qs[0]) * v), sv, a, z, - sz, t, st, err, n_st, n_sz, use_adaptive, simps_err) - # If one probability = 0, the log sum will be -Inf - p = p * (1 - p_outlier) + wp_outlier - if p == 0: - return -np.inf - sum_logp += log(p) - - # get learning rate for current trial. if pos_alpha is not in - # include it will be same as alpha so can still use this - # calculation: - if feedbacks[i] > qs[responses[i]]: - alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - else: - alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) - - # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - # received on current trial. - qs[responses[i]] = qs[responses[i]] + \ - alfa * (feedbacks[i] - qs[responses[i]]) - return sum_logp - - -def wiener_like_rlssm_nn(str model, - np.ndarray[double, ndim=1] x, - np.ndarray[long, ndim=1] response, - np.ndarray[double, ndim=1] feedback, - np.ndarray[long, ndim=1] split_by, - double q, - np.ndarray[double, ndim=1] params_ssm, - np.ndarray[double, ndim=1] params_rl, - np.ndarray[double, ndim=2] params_bnds, - double p_outlier=0, double w_outlier=0, network = None): - - cdef double v = params_ssm[0] - cdef double rl_alpha = params_rl[0] - - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i, j, i_p - cdef Py_ssize_t s_size - cdef int s - cdef double log_p = 0 - cdef double sum_logp = 0 - cdef double wp_outlier = w_outlier * p_outlier - cdef double alfa - cdef double pos_alfa - cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - cdef np.ndarray[double, ndim=1] xs - cdef np.ndarray[double, ndim=1] feedbacks - cdef np.ndarray[long, ndim=1] responses - cdef np.ndarray[long, ndim=1] responses_qs - cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - cdef Py_ssize_t n_params = params_ssm.shape[0] #+ params_rl.shape[0] - cdef np.ndarray[float, ndim=2] data = np.zeros((size, n_params + 2), dtype = np.float32) - cdef float ll_min = -16.11809 - cdef int cumm_s_size = 0 - - if not p_outlier_in_range(p_outlier): - return -np.inf - - # Check for boundary violations -- if true, return -np.inf - for i_p in np.arange(1, len(params_ssm)): - lower_bnd = params_bnds[0][i_p] - upper_bnd = params_bnds[1][i_p] - - if params_ssm[i_p] < lower_bnd or params_ssm[i_p] > upper_bnd: - return -np.inf - - - if len(params_rl) == 2: - pos_alfa = params_rl[1] - else: - pos_alfa = params_rl[0] - - - # unique represent # of conditions - for j in range(unique.shape[0]): - s = unique[j] - # select trials for current condition, identified by the split_by-array - feedbacks = feedback[split_by == s] - responses = response[split_by == s] - xs = x[split_by == s] - s_size = xs.shape[0] - qs[0] = q - qs[1] = q - - responses_qs = responses - responses_qs[responses_qs == -1] = 0 - - # don't calculate pdf for first trial but still update q - if feedbacks[0] > qs[responses_qs[0]]: - alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - else: - alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - - - # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - # received on current trial. - qs[responses_qs[0]] = qs[responses_qs[0]] + \ - alfa * (feedbacks[0] - qs[responses_qs[0]]) - - - data[0, 0] = 0.0 - # loop through all trials in current condition - for i in range(1, s_size): - data[cumm_s_size + i, 0] = (qs[1] - qs[0]) * v - # Check for boundary violations -- if true, return -np.inf - if data[cumm_s_size + i, 0] < params_bnds[0][0] or data[cumm_s_size + i, 0] > params_bnds[1][0]: - return -np.inf - - # get learning rate for current trial. if pos_alpha is not in - # include it will be same as alpha so can still use this - # calculation: - if feedbacks[i] > qs[responses_qs[i]]: - alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - else: - alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - - # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - # received on current trial. - qs[responses_qs[i]] = qs[responses_qs[i]] + \ - alfa * (feedbacks[i] - qs[responses_qs[i]]) - cumm_s_size += s_size - - - data[:, 1:n_params] = np.tile(params_ssm[1:], (size, 1)).astype(np.float32) - data[:, n_params:] = np.stack([x, response], axis = 1) - - # Call to network: - if p_outlier == 0: - sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - else: - sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - - return sum_logp - - -def wiener_like_rl(np.ndarray[long, ndim=1] response, - np.ndarray[double, ndim=1] feedback, - np.ndarray[long, ndim=1] split_by, - double q, double alpha, double pos_alpha, double v, double z, - double err=1e-4, int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-8, - double p_outlier=0, double w_outlier=0): - cdef Py_ssize_t size = response.shape[0] - cdef Py_ssize_t i, j - cdef Py_ssize_t s_size - cdef int s - cdef double drift - cdef double p - cdef double sum_logp = 0 - cdef double wp_outlier = w_outlier * p_outlier - cdef double alfa - cdef double pos_alfa - cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - cdef np.ndarray[double, ndim=1] feedbacks - cdef np.ndarray[long, ndim=1] responses - cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - - if not p_outlier_in_range(p_outlier): - return -np.inf - - if pos_alpha==100.00: - pos_alfa = alpha - else: - pos_alfa = pos_alpha - - # unique represent # of conditions - for j in range(unique.shape[0]): - s = unique[j] - # select trials for current condition, identified by the split_by-array - feedbacks = feedback[split_by == s] - responses = response[split_by == s] - s_size = responses.shape[0] - qs[0] = q - qs[1] = q - - # don't calculate pdf for first trial but still update q - if feedbacks[0] > qs[responses[0]]: - alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - else: - alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) - - # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - # received on current trial. - qs[responses[0]] = qs[responses[0]] + \ - alfa * (feedbacks[0] - qs[responses[0]]) - - # loop through all trials in current condition - for i in range(1, s_size): - - drift = (qs[1] - qs[0]) * v - - if drift == 0: - p = 0.5 - else: - if responses[i] == 1: - p = (2.718281828459**(-2 * z * drift) - 1) / \ - (2.718281828459**(-2 * drift) - 1) - else: - p = 1 - (2.718281828459**(-2 * z * drift) - 1) / \ - (2.718281828459**(-2 * drift) - 1) - - # If one probability = 0, the log sum will be -Inf - p = p * (1 - p_outlier) + wp_outlier - if p == 0: - return -np.inf - - sum_logp += log(p) - - # get learning rate for current trial. if pos_alpha is not in - # include it will be same as alpha so can still use this - # calculation: - if feedbacks[i] > qs[responses[i]]: - alfa = (2.718281828459**pos_alfa) / (1 + 2.718281828459**pos_alfa) - else: - alfa = (2.718281828459**alpha) / (1 + 2.718281828459**alpha) - - # qs[1] is upper bound, qs[0] is lower bound. feedbacks is reward - # received on current trial. - qs[responses[i]] = qs[responses[i]] + \ - alfa * (feedbacks[i] - qs[responses[i]]) - return sum_logp - - -def wiener_like_multi(np.ndarray[double, ndim=1] x, v, sv, a, z, sz, t, st, double err, multi=None, - int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - double p_outlier=0, double w_outlier=0): - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i - cdef double p = 0 - cdef double sum_logp = 0 - cdef double wp_outlier = w_outlier * p_outlier - - if multi is None: - return full_pdf(x, v, sv, a, z, sz, t, st, err) - else: - params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st} - params_iter = copy(params) - for i in range(size): - for param in multi: - params_iter[param] = params[param][i] - if abs(x[i]) != 999.: - p = full_pdf(x[i], params_iter['v'], - params_iter['sv'], params_iter['a'], params_iter['z'], - params_iter['sz'], params_iter['t'], params_iter['st'], - err, n_st, n_sz, use_adaptive, simps_err) - p = p * (1 - p_outlier) + wp_outlier - elif x[i] == 999.: - p = prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - else: # x[i] == -999. - p = 1 - prob_ub(params_iter['v'], params_iter['a'], params_iter['z']) - - sum_logp += log(p) - - return sum_logp - - -def wiener_like_multi_rlddm(np.ndarray[double, ndim=1] x, - np.ndarray[long, ndim=1] response, - np.ndarray[double, ndim=1] feedback, - np.ndarray[long, ndim=1] split_by, - double q, v, sv, a, z, sz, t, st, alpha, double err, multi=None, - int n_st=10, int n_sz=10, bint use_adaptive=1, double simps_err=1e-3, - double p_outlier=0, double w_outlier=0): - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t ij - cdef Py_ssize_t s_size - cdef double p = 0 - cdef double sum_logp = 0 - cdef double wp_outlier = w_outlier * p_outlier - cdef int s - cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - - if multi is None: - return full_pdf(x, v, sv, a, z, sz, t, st, err) - else: - params = {'v': v, 'z': z, 't': t, 'a': a, 'sv': sv, 'sz': sz, 'st': st, 'alpha':alpha} - params_iter = copy(params) - qs[0] = q - qs[1] = q - for i in range(size): - for param in multi: - params_iter[param] = params[param][i] - - if (i != 0): - if (split_by[i] != split_by[i-1]): - qs[0] = q - qs[1] = q - - p = full_pdf(x[i], params_iter['v'] * (qs[1] - qs[0]), - params_iter['sv'], params_iter['a'], params_iter['z'], - params_iter['sz'], params_iter[ - 't'], params_iter['st'], - err, n_st, n_sz, use_adaptive, simps_err) - p = p * (1 - p_outlier) + wp_outlier - sum_logp += log(p) - - alfa = (2.718281828459**params_iter['alpha']) / (1 + 2.718281828459**params_iter['alpha']) - qs[response[i]] = qs[response[i]] + alfa * (feedback[i] - qs[response[i]]) - - return sum_logp - - -def wiener_like_rlssm_nn_reg(np.ndarray[float, ndim=2] data, - np.ndarray[float, ndim=2] rl_arr, - np.ndarray[double, ndim=1] x, - np.ndarray[long, ndim=1] response, - np.ndarray[double, ndim=1] feedback, - np.ndarray[long, ndim=1] split_by, - double q, - np.ndarray[double, ndim=2] params_bnds, - double p_outlier=0, double w_outlier=0, network = None): - cdef double rl_alpha - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i, j, i_p - cdef Py_ssize_t s_size - cdef int s - cdef double log_p = 0 - cdef double sum_logp = 0 - cdef double wp_outlier = w_outlier * p_outlier - cdef double alfa - cdef np.ndarray[double, ndim=1] qs = np.array([q, q]) - cdef np.ndarray[double, ndim=1] xs - cdef np.ndarray[double, ndim=1] feedbacks - cdef np.ndarray[long, ndim=1] responses - cdef np.ndarray[long, ndim=1] responses_qs - cdef np.ndarray[long, ndim=1] unique = np.unique(split_by) - cdef np.ndarray[float, ndim=2] data_copy = data - cdef float ll_min = -16.11809 - cdef int cumm_s_size = 0 - - if not p_outlier_in_range(p_outlier): - return -np.inf - - # Check for boundary violations -- if true, return -np.inf - for i_p in np.arange(1, data.shape[1]-2): - lower_bnd = params_bnds[0][i_p] - upper_bnd = params_bnds[1][i_p] - - if data[:,i_p].min() < lower_bnd or data[:,i_p].max() > upper_bnd: - return -np.inf - - # unique represent # of conditions - for j in range(unique.shape[0]): - s = unique[j] - # select trials for current condition, identified by the split_by-array - feedbacks = feedback[split_by == s] - responses = response[split_by == s] - xs = x[split_by == s] - s_size = xs.shape[0] - qs[0] = q - qs[1] = q - - responses_qs = responses - responses_qs[responses_qs == -1] = 0 - - # loop through all trials in current condition - for i in range(0, s_size): - tp_scale = data[cumm_s_size + i, 0] - if tp_scale < 0: - return -np.inf - - data_copy[cumm_s_size + i, 0] = (qs[1] - qs[0]) * tp_scale - - # Check for boundary violations -- if true, return -np.inf - if data_copy[cumm_s_size + i, 0] < params_bnds[0][0] or data_copy[cumm_s_size + i, 0] > params_bnds[1][0]: - return -np.inf - - rl_alpha = rl_arr[cumm_s_size + i, 0] - alfa = (2.718281828459**rl_alpha) / (1 + 2.718281828459**rl_alpha) - - qs[responses_qs[i]] = qs[responses_qs[i]] + \ - alfa * (feedbacks[i] - qs[responses_qs[i]]) - cumm_s_size += s_size - - # Call to network: - if p_outlier == 0: - sum_logp = np.sum(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) - else: - sum_logp = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data_copy), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - - return sum_logp - -def wiener_like_contaminant(np.ndarray[double, ndim=1] x, np.ndarray[int, ndim=1] cont_x, double v, - double sv, double a, double z, double sz, double t, double st, double t_min, - double t_max, double err, int n_st=10, int n_sz=10, bint use_adaptive=1, - double simps_err=1e-8): - """Wiener likelihood function where RTs could come from a - separate, uniform contaminant distribution. - - Reference: Lee, Vandekerckhove, Navarro, & Tuernlinckx (2007) - """ - cdef Py_ssize_t size = x.shape[0] - cdef Py_ssize_t i - cdef double p - cdef double sum_logp = 0 - cdef int n_cont = np.sum(cont_x) - cdef int pos_cont = 0 - - for i in prange(size, nogil=True): - if cont_x[i] == 0: - p = full_pdf(x[i], v, sv, a, z, sz, t, st, err, - n_st, n_sz, use_adaptive, simps_err) - if p == 0: - with gil: - return -np.inf - sum_logp += log(p) - # If one probability = 0, the log sum will be -Inf - - # add the log likelihood of the contaminations - sum_logp += n_cont * log(0.5 * 1. / (t_max - t_min)) - - return sum_logp - -def gen_cdf_using_pdf(double v, double sv, double a, double z, double sz, double t, double st, double err, - int N=500, double time=5., int n_st=2, int n_sz=2, bint use_adaptive=1, double simps_err=1e-3, - double p_outlier=0, double w_outlier=0): - """ - generate cdf vector using the pdf - """ - if (sv < 0) or (a <= 0 ) or (z < 0) or (z > 1) or (sz < 0) or (sz > 1) or (z + sz / 2. > 1) or \ - (z - sz / 2. < 0) or (t - st / 2. < 0) or (t < 0) or (st < 0) or not p_outlier_in_range(p_outlier): - raise ValueError( - "at least one of the parameters is out of the support") - - cdef np.ndarray[double, ndim = 1] x = np.linspace(-time, time, 2 * N + 1) - cdef np.ndarray[double, ndim = 1] cdf_array = np.empty(x.shape[0], dtype=np.double) - cdef int idx - - # compute pdf on the real line - cdf_array = pdf_array(x, v, sv, a, z, sz, t, st, err, 0, - n_st, n_sz, use_adaptive, simps_err, p_outlier, w_outlier) - - # integrate - cdf_array[1:] = integrate.cumtrapz(cdf_array) - - # normalize - cdf_array /= cdf_array[x.shape[0] - 1] - - return x, cdf_array - - -def split_cdf(np.ndarray[double, ndim=1] x, np.ndarray[double, ndim=1] data): - - # get length of data - cdef int N = (len(data) - 1) / 2 - - # lower bound is reversed - cdef np.ndarray[double, ndim = 1] x_lb = -x[:N][::-1] - cdef np.ndarray[double, ndim = 1] lb = data[:N][::-1] - # lower bound is cumulative in the wrong direction - lb = np.cumsum(np.concatenate([np.array([0]), -np.diff(lb)])) - - cdef np.ndarray[double, ndim = 1] x_ub = x[N + 1:] - cdef np.ndarray[double, ndim = 1] ub = data[N + 1:] - # ub does not start at 0 - ub -= ub[0] - - return (x_lb, lb, x_ub, ub) - -def wiener_like_multi_nn_mlp(np.ndarray[float, ndim = 2] data, - double p_outlier = 0, - double w_outlier = 0, - network = None): - #**kwargs): - - # data is a matrix of shape (n_samples, n_params + 2) - # where the first n_params columns are the parameters - # and the last two columns are the rt and response - # (in that order) - - cdef float ll_min = -16.11809 - cdef float log_p - - # Call to network: - if p_outlier == 0: # previous ddm_model - log_p = np.sum(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - else: - log_p = np.sum(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - return log_p - -def wiener_like_multi_nn_mlp_pdf(np.ndarray[float, ndim = 2] data, - double p_outlier = 0, - double w_outlier = 0, - network = None): - #**kwargs): - - # data is a matrix of shape (n_samples, n_params + 2) - # where the first n_params columns are the parameters - # and the last two columns are the rt and response - # (in that order) - - cdef float ll_min = -16.11809 - cdef float log_p - - # Call to network: - if p_outlier == 0: # previous ddm_model - log_p = np.squeeze(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) - else: - log_p = np.squeeze(np.log(np.exp(np.core.umath.maximum(network.predict_on_batch(data), ll_min)) * (1.0 - p_outlier) + (w_outlier * p_outlier))) - return log_p From c1e78604f525e13afa105039f0d149c8694f7187 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Fri, 8 Sep 2023 13:19:44 -0400 Subject: [PATCH 08/14] update workflow to include test building documentation --- .github/workflows/run_tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 7fb6fff4..293c3f94 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -51,3 +51,6 @@ jobs: - name: Run tests run: poetry run pytest + + - name: build docs + run: poetry run mkdocs build From cb1dec969041f1d588cca0ffa3594d348dee71ca Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Fri, 8 Sep 2023 13:20:44 -0400 Subject: [PATCH 09/14] update documentation --- README.md | 3 +-- docs/changelog.md | 9 +++++++++ docs/index.md | 2 +- mkdocs.yml | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f13aeff8..6b04d60b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ ![GitHub Repo stars](https://img.shields.io/github/stars/lnccbrown/HSSM) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) - ### Overview HSSM is a Python toolbox that provides a seamless combination of state-of-the-art likelihood approximation methods with the wider ecosystem of probabilistic programming languages. It facilitates flexible hierarchical model building and inference via modern MCMC samplers. HSSM is user-friendly and provides the ability to rigorously estimate the impact of neural and other trial-by-trial covariates through parameter-wise mixed-effects models for a large variety of cognitive process models. HSSM is a BRAINSTORM project in collaboration with the Center for Computation and Visualization and the Center for Computational Brain Science within the Carney Institute at Brown University. @@ -28,7 +27,7 @@ HSSM is a Python toolbox that provides a seamless combination of state-of-the-ar - Native ArviZ support for plotting and other convenience functions to aid the Bayesian workflow. - Utilizes the ONNX format for translation of differentiable likelihood approximators across backends. -### Official documentation link can be found [here](https://lnccbrown.github.io/HSSM/). +### [Official documentation](https://lnccbrown.github.io/HSSM/). ## Installation diff --git a/docs/changelog.md b/docs/changelog.md index 770a03f9..d641dcc2 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,15 @@ ## 0.1.x +### 0.1.5 + +We fixed the errors in v0.1.4. Sorry for the convenience! If you have accidentally +downloaded v0.1.4, please make sure that you update hssm to the current version. + +- We made Cython dependencies of this package available via pypi. We have also built +wheels for (almost) all platforms so there is no need to build these Cython +dependencies. + ### 0.1.4 - Added support of `blackbox` likelihoods for `ddm` and `ddm_sdv` models. diff --git a/docs/index.md b/docs/index.md index 63d4508b..e5f16404 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,7 +17,7 @@ HSSM is a Python toolbox that provides a seamless combination of state-of-the-ar **License**: HSSM is licensed under [Copyright 2023, Brown University, Providence, RI](../LICENSE) -**Version**: 0.1.4 +**Version**: 0.1.5 - Allows approximate hierarchical Bayesian inference via various likelihood approximators. - Estimate impact of neural and other trial-by-trial covariates via native hierarchical mixed-regression support. diff --git a/mkdocs.yml b/mkdocs.yml index 6bed7798..d2ada41b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,6 +34,8 @@ plugins: - getting_started/getting_started.ipynb - tutorials/main_tutorial.ipynb - tutorials/likelihoods.ipynb + - .ipynb_checkpoints/*.ipynb + allow_errors: false - mkdocstrings: default_handler: python handlers: From 6abe69c39a97bdaec515bfe0a7d7f88230100cd9 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Fri, 8 Sep 2023 16:04:12 -0400 Subject: [PATCH 10/14] remove build.py --- build.py | 65 -------------------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 build.py diff --git a/build.py b/build.py deleted file mode 100644 index 4dca5390..00000000 --- a/build.py +++ /dev/null @@ -1,65 +0,0 @@ -# noqa: D100 -import os -import platform -import shutil -from distutils.core import Distribution, Extension - -import numpy as np # noqa -from Cython.Build import build_ext, cythonize - -cython_dir = "src/hssm/likelihoods/hddm_wfpt" - -try: - if platform.system() == "Darwin": - ext1 = Extension( - "wfpt", - ["src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"], - language="c++", - extra_compile_args=["-stdlib=libc++"], - include_dirs=[np.get_include()], - extra_link_args=["-stdlib=libc++", "-mmacosx-version-min=10.9"], - ) - else: - ext1 = Extension( - "wfpt", - ["src/hssm/likelihoods/hddm_wfpt/wfpt.pyx"], - language="c++", - include_dirs=[np.get_include()], - ) - - ext_modules = cythonize( - [ - ext1, - Extension( - "cdfdif_wrapper", - [ - "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.pyx", - "src/hssm/likelihoods/hddm_wfpt/cdfdif.c", - ], - include_dirs=[np.get_include()], - ), - ], - include_path=[cython_dir], - compiler_directives={"language_level": "3", "linetrace": True}, - ) - -except ImportError: - ext_modules = [ - Extension("wfpt", ["src/hssm/likelihoods/hddm_wfpt/wfpt.cpp"], language="c++"), - Extension( - "cdfdif_wrapper", - [ - "src/hssm/likelihoods/hddm_wfpt/cdfdif_wrapper.c", - "src/hssm/likelihoods/hddm_wfpt/cdfdif.c", - ], - ), - ] - -dist = Distribution({"ext_modules": ext_modules}) -cmd = build_ext(dist) -cmd.ensure_finalized() -cmd.run() - -for output in cmd.get_outputs(): - relative_extension = os.path.relpath(output, cmd.build_lib) - shutil.copyfile(output, relative_extension) From 967a32ecec584323a28d5c688404254836502023 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Fri, 8 Sep 2023 16:04:30 -0400 Subject: [PATCH 11/14] bump version in __init__.py --- src/hssm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hssm/__init__.py b/src/hssm/__init__.py index 3d8b6f64..36439518 100644 --- a/src/hssm/__init__.py +++ b/src/hssm/__init__.py @@ -17,7 +17,7 @@ handler = logging.StreamHandler(stream=sys.stdout) _logger.addHandler(handler) -__version__ = "0.1.4" +__version__ = "0.1.5" __all__ = [ "HSSM", From 8a4ee5e4a1d891738432775134922123d9b09a12 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Fri, 8 Sep 2023 16:32:08 -0400 Subject: [PATCH 12/14] revert changes to blackbox.py --- src/hssm/likelihoods/blackbox.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hssm/likelihoods/blackbox.py b/src/hssm/likelihoods/blackbox.py index c8c1a7ee..d68e9a07 100644 --- a/src/hssm/likelihoods/blackbox.py +++ b/src/hssm/likelihoods/blackbox.py @@ -3,8 +3,7 @@ from __future__ import annotations import numpy as np - -from .hddm_wfpt import wfpt +from hddm_wfpt import wfpt def hddm_to_hssm(func): From 3f821c13d590b025aa7991441bcf1a5bb2255608 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Fri, 8 Sep 2023 16:32:27 -0400 Subject: [PATCH 13/14] single source of version --- docs/index.md | 2 -- pyproject.toml | 11 ++++------- src/hssm/__init__.py | 3 ++- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/index.md b/docs/index.md index e5f16404..f95722de 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,8 +17,6 @@ HSSM is a Python toolbox that provides a seamless combination of state-of-the-ar **License**: HSSM is licensed under [Copyright 2023, Brown University, Providence, RI](../LICENSE) -**Version**: 0.1.5 - - Allows approximate hierarchical Bayesian inference via various likelihood approximators. - Estimate impact of neural and other trial-by-trial covariates via native hierarchical mixed-regression support. - Extensible for users to add novel models with corresponding likelihoods. diff --git a/pyproject.toml b/pyproject.toml index ad3a9a7c..46271a52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "HSSM" -version = "0.1.4" -description = "" +version = "0.1.5" +description = "Bayesian inference for hierarchical sequential sampling models." authors = [ "Alexander Fengler ", "Paul Xu ", @@ -28,6 +28,7 @@ huggingface-hub = "^0.15.1" onnxruntime = "^1.15.0" bambi = "^0.12.0" numpyro = "^0.12.1" +hddm-wfpt = "^0.1.1" [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" @@ -176,10 +177,6 @@ convention = "numpy" [tool.mypy] ignore_missing_imports = true -[tool.poetry.build] -generate-setup-file = false -script = "build.py" - [build-system] -requires = ["poetry-core", "Cython", "numpy"] +requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/src/hssm/__init__.py b/src/hssm/__init__.py index 36439518..382d3a8d 100644 --- a/src/hssm/__init__.py +++ b/src/hssm/__init__.py @@ -1,5 +1,6 @@ """HSSM - Hierarchical Sequential Sampling Models.""" +import importlib.metadata import logging import sys @@ -17,7 +18,7 @@ handler = logging.StreamHandler(stream=sys.stdout) _logger.addHandler(handler) -__version__ = "0.1.5" +__version__ = importlib.metadata.version(__package__ or __name__) __all__ = [ "HSSM", From 14714165f780e6797bf16f3122fc75457a356b23 Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Fri, 8 Sep 2023 17:08:29 -0400 Subject: [PATCH 14/14] limit pymc version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 46271a52..b4b8bdaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ keywords = ["HSSM", "sequential sampling models", "bayesian", "bayes", "mcmc"] [tool.poetry.dependencies] python = ">=3.9,<3.12" -pymc = ">=5.6.0,<5.8.0" +pymc = ">=5.6.0,<5.7.0" scipy = "1.10.1" arviz = "^0.14.0" numpy = "^1.23.4"