[Python-modules-commits] [python-numpy] 01/14: Import python-numpy_1.11.1.orig.tar.gz
Ondřej Nový
onovy at moszumanska.debian.org
Mon Jul 11 06:57:46 UTC 2016
This is an automated email from the git hooks/post-receive script.
onovy pushed a commit to branch master
in repository python-numpy.
commit 65b53424c5ee36f6f9d7e0801f3b8a0cc89128f6
Author: Ondřej Nový <onovy at debian.org>
Date: Mon Jul 11 07:53:21 2016 +0200
Import python-numpy_1.11.1.orig.tar.gz
---
PKG-INFO | 2 +-
doc/release/1.11.1-notes.rst | 3 +
numpy/distutils/misc_util.py | 12 +-
numpy/distutils/system_info.py | 2 +-
numpy/distutils/tests/test_misc_util.py | 9 +-
numpy/random/mtrand/mtrand.c | 893 ++++++++++++++++----------------
numpy/random/mtrand/mtrand.pyx | 6 +-
numpy/random/tests/test_regression.py | 29 ++
numpy/version.py | 8 +-
setup.py | 2 +-
10 files changed, 501 insertions(+), 465 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 0e97d49..90c3fc0 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: numpy
-Version: 1.11.1rc1
+Version: 1.11.1
Summary: NumPy: array processing for numbers, strings, records, and objects.
Home-page: http://www.numpy.org
Author: NumPy Developers
diff --git a/doc/release/1.11.1-notes.rst b/doc/release/1.11.1-notes.rst
index 072f01e..37a6e30 100644
--- a/doc/release/1.11.1-notes.rst
+++ b/doc/release/1.11.1-notes.rst
@@ -26,3 +26,6 @@ Fixes Merged
- #7671 BUG: Boolean assignment no GIL release when transfer needs API.
- #7676 BUG: Fix handling of right edge of final histogram bin.
- #7680 BUG: Fix np.clip bug NaN handling for Visual Studio 2015.
+- #7724 BUG: Fix segfaults in np.random.shuffle.
+- #7731 MAINT: Change mkl_info.dir_env_var from MKL to MKLROOT.
+- #7737 BUG: Fix issue on OS X with Python 3.x, npymath.ini not installed.
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
index 79b6f25..8136f8f 100644
--- a/numpy/distutils/misc_util.py
+++ b/numpy/distutils/misc_util.py
@@ -126,13 +126,13 @@ def allpath(name):
return os.path.join(*splitted)
def rel_path(path, parent_path):
- """Return path relative to parent_path.
- """
- pd = os.path.abspath(parent_path)
- apath = os.path.abspath(path)
- if len(apath)<len(pd):
+ """Return path relative to parent_path."""
+ # Use realpath to avoid issues with symlinked dirs (see gh-7707)
+ pd = os.path.realpath(os.path.abspath(parent_path))
+ apath = os.path.realpath(os.path.abspath(path))
+ if len(apath) < len(pd):
return path
- if apath==pd:
+ if apath == pd:
return ''
if pd == apath[:len(pd)]:
assert apath[len(pd)] in [os.sep], repr((path, apath[len(pd)]))
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 459a2c4..b1734f7 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -960,7 +960,7 @@ class djbfft_info(system_info):
class mkl_info(system_info):
section = 'mkl'
- dir_env_var = 'MKL'
+ dir_env_var = 'MKLROOT'
_lib_mkl = ['mkl', 'vml', 'guide']
def get_mkl_rootdir(self):
diff --git a/numpy/distutils/tests/test_misc_util.py b/numpy/distutils/tests/test_misc_util.py
index c50b948..3e97b6f 100644
--- a/numpy/distutils/tests/test_misc_util.py
+++ b/numpy/distutils/tests/test_misc_util.py
@@ -4,7 +4,7 @@ from __future__ import division, absolute_import, print_function
from os.path import join, sep, dirname
from numpy.distutils.misc_util import (
- appendpath, minrelpath, gpaths, get_shared_lib_extension
+ appendpath, minrelpath, gpaths, get_shared_lib_extension, get_info
)
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal
@@ -75,5 +75,12 @@ class TestSharedExtension(TestCase):
# just check for no crash
assert_(get_shared_lib_extension(is_python_ext=True))
+
+def test_installed_npymath_ini():
+ # Regression test for gh-7707. If npymath.ini wasn't installed, then this
+ # will give an error.
+ info = get_info('npymath')
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/random/mtrand/mtrand.c b/numpy/random/mtrand/mtrand.c
index fa9500c..8ddf25d 100644
--- a/numpy/random/mtrand/mtrand.c
+++ b/numpy/random/mtrand/mtrand.c
@@ -1303,7 +1303,7 @@ static char __pyx_k_RandomState_multinomial_line_472[] = "RandomState.multinomia
static char __pyx_k_RandomState_negative_binomial_li[] = "RandomState.negative_binomial (line 4022)";
static char __pyx_k_RandomState_noncentral_chisquare[] = "RandomState.noncentral_chisquare (line 2529)";
static char __pyx_k_RandomState_noncentral_f_line_23[] = "RandomState.noncentral_f (line 2352)";
-static char __pyx_k_RandomState_permutation_line_503[] = "RandomState.permutation (line 5037)";
+static char __pyx_k_RandomState_permutation_line_504[] = "RandomState.permutation (line 5041)";
static char __pyx_k_RandomState_random_integers_line[] = "RandomState.random_integers (line 1682)";
static char __pyx_k_RandomState_random_sample_line_1[] = "RandomState.random_sample (line 1101)";
static char __pyx_k_RandomState_standard_cauchy_line[] = "RandomState.standard_cauchy (line 2626)";
@@ -1350,7 +1350,7 @@ static PyObject *__pyx_kp_u_RandomState_noncentral_chisquare;
static PyObject *__pyx_kp_u_RandomState_noncentral_f_line_23;
static PyObject *__pyx_kp_u_RandomState_normal_line_1812;
static PyObject *__pyx_kp_u_RandomState_pareto_line_2893;
-static PyObject *__pyx_kp_u_RandomState_permutation_line_503;
+static PyObject *__pyx_kp_u_RandomState_permutation_line_504;
static PyObject *__pyx_kp_u_RandomState_poisson_line_4118;
static PyObject *__pyx_kp_u_RandomState_power_line_3106;
static PyObject *__pyx_kp_u_RandomState_rand_line_1581;
@@ -34055,7 +34055,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
* x_ptr = <char*><size_t>x.ctypes.data
* stride = x.strides[0] # <<<<<<<<<<<<<<
* itemsize = x.dtype.itemsize
- * buf = np.empty_like(x[0]) # GC'd at function exit
+ * # As the array x could contain python objects we use a buffer
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_strides); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
@@ -34070,8 +34070,8 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
* x_ptr = <char*><size_t>x.ctypes.data
* stride = x.strides[0]
* itemsize = x.dtype.itemsize # <<<<<<<<<<<<<<
- * buf = np.empty_like(x[0]) # GC'd at function exit
- * buf_ptr = <char*><size_t>buf.ctypes.data
+ * # As the array x could contain python objects we use a buffer
+ * # of bytes for the swaps to avoid leaving one of the objects
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
@@ -34082,96 +34082,89 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_itemsize = __pyx_t_8;
- /* "mtrand.pyx":5002
- * stride = x.strides[0]
- * itemsize = x.dtype.itemsize
- * buf = np.empty_like(x[0]) # GC'd at function exit # <<<<<<<<<<<<<<
+ /* "mtrand.pyx":5006
+ * # within the buffer and erroneously decrementing it's refcount
+ * # when the function exits.
+ * buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit # <<<<<<<<<<<<<<
* buf_ptr = <char*><size_t>buf.ctypes.data
* with self.lock:
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_npy_intp(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- }
- }
- if (!__pyx_t_10) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_buf = __pyx_t_4;
- __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_buf = __pyx_t_11;
+ __pyx_t_11 = 0;
- /* "mtrand.pyx":5003
- * itemsize = x.dtype.itemsize
- * buf = np.empty_like(x[0]) # GC'd at function exit
+ /* "mtrand.pyx":5007
+ * # when the function exits.
+ * buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit
* buf_ptr = <char*><size_t>buf.ctypes.data # <<<<<<<<<<<<<<
* with self.lock:
* # We trick gcc into providing a specialized implementation for
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_buf_ptr = ((char *)((size_t)__pyx_t_7));
- /* "mtrand.pyx":5004
- * buf = np.empty_like(x[0]) # GC'd at function exit
+ /* "mtrand.pyx":5008
+ * buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit
* buf_ptr = <char*><size_t>buf.ctypes.data
* with self.lock: # <<<<<<<<<<<<<<
* # We trick gcc into providing a specialized implementation for
* # the most common case, yielding a ~33% performance improvement.
*/
/*with:*/ {
- __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_11);
+ __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_9 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(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_4, function);
+ __Pyx_DECREF_SET(__pyx_t_11, function);
}
}
- if (__pyx_t_11) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ if (__pyx_t_9) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else {
- __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
- __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/*try:*/ {
{
__Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
@@ -34180,7 +34173,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
__Pyx_XGOTREF(__pyx_t_15);
/*try:*/ {
- /* "mtrand.pyx":5008
+ /* "mtrand.pyx":5012
* # the most common case, yielding a ~33% performance improvement.
* # Note that apparently, only one branch can ever be specialized.
* if itemsize == sizeof(npy_intp): # <<<<<<<<<<<<<<
@@ -34190,18 +34183,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(npy_intp))) != 0);
if (__pyx_t_2) {
- /* "mtrand.pyx":5009
+ /* "mtrand.pyx":5013
* # Note that apparently, only one branch can ever be specialized.
* if itemsize == sizeof(npy_intp):
* self._shuffle_raw(n, sizeof(npy_intp), stride, x_ptr, buf_ptr) # <<<<<<<<<<<<<<
* else:
* self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)
*/
- __pyx_t_9 = __pyx_f_6mtrand_11RandomState__shuffle_raw(__pyx_v_self, __pyx_v_n, (sizeof(npy_intp)), __pyx_v_stride, __pyx_v_x_ptr, __pyx_v_buf_ptr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5009; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __pyx_f_6mtrand_11RandomState__shuffle_raw(__pyx_v_self, __pyx_v_n, (sizeof(npy_intp)), __pyx_v_stride, __pyx_v_x_ptr, __pyx_v_buf_ptr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5013; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "mtrand.pyx":5008
+ /* "mtrand.pyx":5012
* # the most common case, yielding a ~33% performance improvement.
* # Note that apparently, only one branch can ever be specialized.
* if itemsize == sizeof(npy_intp): # <<<<<<<<<<<<<<
@@ -34211,7 +34204,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
goto __pyx_L19;
}
- /* "mtrand.pyx":5011
+ /* "mtrand.pyx":5015
* self._shuffle_raw(n, sizeof(npy_intp), stride, x_ptr, buf_ptr)
* else:
* self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr) # <<<<<<<<<<<<<<
@@ -34219,14 +34212,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
* # Multidimensional ndarrays require a bounce buffer.
*/
/*else*/ {
- __pyx_t_9 = __pyx_f_6mtrand_11RandomState__shuffle_raw(__pyx_v_self, __pyx_v_n, __pyx_v_itemsize, __pyx_v_stride, __pyx_v_x_ptr, __pyx_v_buf_ptr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5011; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __pyx_f_6mtrand_11RandomState__shuffle_raw(__pyx_v_self, __pyx_v_n, __pyx_v_itemsize, __pyx_v_stride, __pyx_v_x_ptr, __pyx_v_buf_ptr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L19:;
- /* "mtrand.pyx":5004
- * buf = np.empty_like(x[0]) # GC'd at function exit
+ /* "mtrand.pyx":5008
+ * buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit
* buf_ptr = <char*><size_t>buf.ctypes.data
* with self.lock: # <<<<<<<<<<<<<<
* # We trick gcc into providing a specialized implementation for
@@ -34240,37 +34233,37 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
__pyx_L11_error:;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
/*except:*/ {
__Pyx_AddTraceback("mtrand.RandomState.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_4, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyTuple_Pack(3, __pyx_t_9, __pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
__Pyx_GOTREF(__pyx_t_16);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_16);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__pyx_t_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ if (__pyx_t_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
__pyx_t_6 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_6) {
- __Pyx_GIVEREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_11);
- __Pyx_ErrRestore(__pyx_t_9, __pyx_t_4, __pyx_t_11);
- __pyx_t_9 = 0; __pyx_t_4 = 0; __pyx_t_11 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_ErrRestore(__pyx_t_4, __pyx_t_11, __pyx_t_9);
+ __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_9 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L12_exception_handled;
}
__pyx_L13_except_error:;
@@ -34292,7 +34285,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
if (__pyx_t_12) {
__pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__165, NULL);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
}
@@ -34317,89 +34310,89 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
goto __pyx_L3;
}
- /* "mtrand.pyx":5012
+ /* "mtrand.pyx":5016
* else:
* self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)
* elif isinstance(x, np.ndarray) and x.ndim > 1 and x.size: # <<<<<<<<<<<<<<
* # Multidimensional ndarrays require a bounce buffer.
* buf = np.empty_like(x[0])
*/
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_x, __pyx_t_11); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_2 = PyObject_IsInstance(__pyx_v_x, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = (__pyx_t_2 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_6 = __pyx_t_5;
goto __pyx_L24_bool_binop_done;
}
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_ndim); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_9 = PyObject_RichCompare(__pyx_t_11, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_5) {
} else {
__pyx_t_6 = __pyx_t_5;
goto __pyx_L24_bool_binop_done;
}
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_6 = __pyx_t_5;
__pyx_L24_bool_binop_done:;
if (__pyx_t_6) {
- /* "mtrand.pyx":5014
+ /* "mtrand.pyx":5018
* elif isinstance(x, np.ndarray) and x.ndim > 1 and x.size:
* # Multidimensional ndarrays require a bounce buffer.
* buf = np.empty_like(x[0]) # <<<<<<<<<<<<<<
* with self.lock:
* for i in reversed(range(1, n)):
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_11);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
+ if (CYTHON_COMPILING_IN_CPYTHON && 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_9);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_3) {
- __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_buf = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_buf = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "mtrand.pyx":5015
+ /* "mtrand.pyx":5019
* # Multidimensional ndarrays require a bounce buffer.
* buf = np.empty_like(x[0])
* with self.lock: # <<<<<<<<<<<<<<
@@ -34407,29 +34400,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
* j = rk_interval(i, self.internal_state)
*/
/*with:*/ {
- __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
+ __Pyx_GOTREF(__pyx_t_4);
__pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (__pyx_t_10) {
- __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else {
- __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
}
- __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
/*try:*/ {
{
__Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
@@ -34438,7 +34431,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
__Pyx_XGOTREF(__pyx_t_13);
/*try:*/ {
- /* "mtrand.pyx":5016
+ /* "mtrand.pyx":5020
* buf = np.empty_like(x[0])
* with self.lock:
* for i in reversed(range(1, n)): # <<<<<<<<<<<<<<
@@ -34448,7 +34441,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
for (__pyx_t_8 = __pyx_v_n-1; __pyx_t_8 >= 1; __pyx_t_8-=1) {
__pyx_v_i = __pyx_t_8;
- /* "mtrand.pyx":5017
+ /* "mtrand.pyx":5021
* with self.lock:
* for i in reversed(range(1, n)):
* j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<<
@@ -34457,41 +34450,41 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
*/
__pyx_v_j = rk_interval(__pyx_v_i, __pyx_v_self->internal_state);
- /* "mtrand.pyx":5018
+ /* "mtrand.pyx":5022
* for i in reversed(range(1, n)):
* j = rk_interval(i, self.internal_state)
* buf[...] = x[j] # <<<<<<<<<<<<<<
* x[j] = x[i]
* x[i] = buf
*/
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L31_error;};
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(PyObject_SetItem(__pyx_v_buf, Py_Ellipsis, __pyx_t_11) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5022; __pyx_clineno = __LINE__; goto __pyx_L31_error;};
+ __Pyx_GOTREF(__pyx_t_9);
+ if (unlikely(PyObject_SetItem(__pyx_v_buf, Py_Ellipsis, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5022; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "mtrand.pyx":5019
+ /* "mtrand.pyx":5023
* j = rk_interval(i, self.internal_state)
* buf[...] = x[j]
* x[j] = x[i] # <<<<<<<<<<<<<<
* x[i] = buf
* else:
*/
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L31_error;};
- __Pyx_GOTREF(__pyx_t_11);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_11, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L31_error;};
+ __Pyx_GOTREF(__pyx_t_9);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_9, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "mtrand.pyx":5020
+ /* "mtrand.pyx":5024
* buf[...] = x[j]
* x[j] = x[i]
* x[i] = buf # <<<<<<<<<<<<<<
* else:
* # Untyped path.
*/
- if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_v_buf, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_v_buf, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
}
- /* "mtrand.pyx":5015
+ /* "mtrand.pyx":5019
* # Multidimensional ndarrays require a bounce buffer.
* buf = np.empty_like(x[0])
* with self.lock: # <<<<<<<<<<<<<<
@@ -34505,37 +34498,37 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
goto __pyx_L38_try_end;
__pyx_L31_error:;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
/*except:*/ {
__Pyx_AddTraceback("mtrand.RandomState.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_9, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_4, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = PyTuple_Pack(3, __pyx_t_11, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_4, NULL);
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = PyTuple_Pack(3, __pyx_t_9, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_11, NULL);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
__Pyx_GOTREF(__pyx_t_16);
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_16);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__pyx_t_6 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
+ if (__pyx_t_6 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
__pyx_t_5 = ((!(__pyx_t_6 != 0)) != 0);
if (__pyx_t_5) {
- __Pyx_GIVEREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_ErrRestore(__pyx_t_11, __pyx_t_9, __pyx_t_10);
- __pyx_t_11 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
+ __Pyx_ErrRestore(__pyx_t_9, __pyx_t_4, __pyx_t_10);
+ __pyx_t_9 = 0; __pyx_t_4 = 0; __pyx_t_10 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L32_exception_handled;
}
@@ -34558,7 +34551,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
if (__pyx_t_12) {
__pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__166, NULL);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
@@ -34573,7 +34566,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
__pyx_L44:;
}
- /* "mtrand.pyx":5012
+ /* "mtrand.pyx":5016
* else:
* self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)
* elif isinstance(x, np.ndarray) and x.ndim > 1 and x.size: # <<<<<<<<<<<<<<
@@ -34583,7 +34576,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
goto __pyx_L3;
}
- /* "mtrand.pyx":5023
+ /* "mtrand.pyx":5027
* else:
* # Untyped path.
* with self.lock: # <<<<<<<<<<<<<<
@@ -34592,28 +34585,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
*/
/*else*/ {
/*with:*/ {
- __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L45_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_11);
+ __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L45_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_9 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_9)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- if (__pyx_t_11) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L45_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ if (__pyx_t_9) {
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L45_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else {
- __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L45_error;}
+ __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L45_error;}
}
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
/*try:*/ {
{
@@ -34623,7 +34616,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
__Pyx_XGOTREF(__pyx_t_15);
/*try:*/ {
- /* "mtrand.pyx":5024
+ /* "mtrand.pyx":5028
* # Untyped path.
* with self.lock:
* for i in reversed(range(1, n)): # <<<<<<<<<<<<<<
@@ -34633,7 +34626,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
for (__pyx_t_8 = __pyx_v_n-1; __pyx_t_8 >= 1; __pyx_t_8-=1) {
__pyx_v_i = __pyx_t_8;
- /* "mtrand.pyx":5025
+ /* "mtrand.pyx":5029
* with self.lock:
* for i in reversed(range(1, n)):
* j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<<
@@ -34642,24 +34635,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
*/
__pyx_v_j = rk_interval(__pyx_v_i, __pyx_v_self->internal_state);
- /* "mtrand.pyx":5026
+ /* "mtrand.pyx":5030
* for i in reversed(range(1, n)):
* j = rk_interval(i, self.internal_state)
* x[i], x[j] = x[j], x[i] # <<<<<<<<<<<<<<
*
* cdef inline _shuffle_raw(self, npy_intp n, npy_intp itemsize,
*/
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L49_error;};
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L49_error;};
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L49_error;};
- __Pyx_GOTREF(__pyx_t_9);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_10, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L49_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L49_error;};
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_10, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L49_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_9, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L49_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_4, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L49_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- /* "mtrand.pyx":5023
+ /* "mtrand.pyx":5027
* else:
* # Untyped path.
* with self.lock: # <<<<<<<<<<<<<<
@@ -34673,38 +34666,38 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
goto __pyx_L56_try_end;
__pyx_L49_error:;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
/*except:*/ {
__Pyx_AddTraceback("mtrand.RandomState.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_11 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_4 = PyTuple_Pack(3, __pyx_t_9, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_4, NULL);
+ __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_11, NULL);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
__Pyx_GOTREF(__pyx_t_16);
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_16);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
+ if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
__pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
if (__pyx_t_6) {
- __Pyx_GIVEREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_10);
- __Pyx_XGIVEREF(__pyx_t_11);
- __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
- __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_ErrRestore(__pyx_t_4, __pyx_t_10, __pyx_t_9);
+ __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L51_except_error;}
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L50_exception_handled;
}
__pyx_L51_except_error:;
@@ -34726,7 +34719,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
if (__pyx_t_12) {
__pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__167, NULL);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
}
@@ -34769,7 +34762,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
return __pyx_r;
}
-/* "mtrand.pyx":5028
+/* "mtrand.pyx":5032
* x[i], x[j] = x[j], x[i]
*
* cdef inline _shuffle_raw(self, npy_intp n, npy_intp itemsize, # <<<<<<<<<<<<<<
@@ -34785,7 +34778,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
npy_intp __pyx_t_1;
__Pyx_RefNannySetupContext("_shuffle_raw", 0);
- /* "mtrand.pyx":5031
+ /* "mtrand.pyx":5035
* npy_intp stride, char* data, char* buf):
* cdef npy_intp i, j
* for i in reversed(range(1, n)): # <<<<<<<<<<<<<<
@@ -34795,7 +34788,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
for (__pyx_t_1 = __pyx_v_n-1; __pyx_t_1 >= 1; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "mtrand.pyx":5032
+ /* "mtrand.pyx":5036
* cdef npy_intp i, j
* for i in reversed(range(1, n)):
* j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<<
@@ -34804,7 +34797,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
*/
__pyx_v_j = rk_interval(__pyx_v_i, __pyx_v_self->internal_state);
- /* "mtrand.pyx":5033
+ /* "mtrand.pyx":5037
* for i in reversed(range(1, n)):
* j = rk_interval(i, self.internal_state)
* string.memcpy(buf, data + j * stride, itemsize) # <<<<<<<<<<<<<<
@@ -34813,7 +34806,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
*/
memcpy(__pyx_v_buf, (__pyx_v_data + (__pyx_v_j * __pyx_v_stride)), __pyx_v_itemsize);
- /* "mtrand.pyx":5034
+ /* "mtrand.pyx":5038
* j = rk_interval(i, self.internal_state)
* string.memcpy(buf, data + j * stride, itemsize)
* string.memcpy(data + j * stride, data + i * stride, itemsize) # <<<<<<<<<<<<<<
@@ -34822,7 +34815,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
*/
memcpy((__pyx_v_data + (__pyx_v_j * __pyx_v_stride)), (__pyx_v_data + (__pyx_v_i * __pyx_v_stride)), __pyx_v_itemsize);
- /* "mtrand.pyx":5035
+ /* "mtrand.pyx":5039
* string.memcpy(buf, data + j * stride, itemsize)
* string.memcpy(data + j * stride, data + i * stride, itemsize)
* string.memcpy(data + i * stride, buf, itemsize) # <<<<<<<<<<<<<<
@@ -34832,7 +34825,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
memcpy((__pyx_v_data + (__pyx_v_i * __pyx_v_stride)), __pyx_v_buf, __pyx_v_itemsize);
}
- /* "mtrand.pyx":5028
+ /* "mtrand.pyx":5032
* x[i], x[j] = x[j], x[i]
*
* cdef inline _shuffle_raw(self, npy_intp n, npy_intp itemsize, # <<<<<<<<<<<<<<
@@ -34847,7 +34840,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
return __pyx_r;
}
-/* "mtrand.pyx":5037
+/* "mtrand.pyx":5041
* string.memcpy(data + i * stride, buf, itemsize)
*
* def permutation(self, object x): # <<<<<<<<<<<<<<
@@ -34885,16 +34878,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("permutation", 0);
- /* "mtrand.pyx":5073
+ /* "mtrand.pyx":5077
*
* """
* if isinstance(x, (int, long, np.integer)): # <<<<<<<<<<<<<<
* arr = np.arange(x)
* else:
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = PyInt_Check(__pyx_v_x);
@@ -34919,16 +34912,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
__pyx_t_5 = (__pyx_t_3 != 0);
if (__pyx_t_5) {
- /* "mtrand.pyx":5074
+ /* "mtrand.pyx":5078
* """
... 1208 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-numpy.git
More information about the Python-modules-commits
mailing list