summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/__init__.py30
-rw-r--r--numpy/_import_tools.py3
-rw-r--r--numpy/core/SConscript86
-rw-r--r--numpy/core/blasdot/_dotblas.c10
-rw-r--r--numpy/core/code_generators/docstrings.py37
-rw-r--r--numpy/core/code_generators/generate_umath.py8
-rw-r--r--numpy/core/code_generators/numpy_api_order.txt1
-rw-r--r--numpy/core/code_generators/ufunc_api_order.txt3
-rw-r--r--numpy/core/fromnumeric.py2
-rw-r--r--numpy/core/include/numpy/fenv/fenv.h12
-rw-r--r--numpy/core/include/numpy/ndarrayobject.h29
-rw-r--r--numpy/core/include/numpy/ufuncobject.h24
-rw-r--r--numpy/core/include/numpy/utils.h19
-rw-r--r--numpy/core/memmap.py36
-rw-r--r--numpy/core/numeric.py14
-rw-r--r--numpy/core/numerictypes.py22
-rw-r--r--numpy/core/records.py26
-rw-r--r--numpy/core/setup.py104
-rw-r--r--numpy/core/src/_isnan.c46
-rw-r--r--numpy/core/src/_signbit.c2
-rw-r--r--numpy/core/src/_sortmodule.c.src12
-rw-r--r--numpy/core/src/arraymethods.c4
-rw-r--r--numpy/core/src/arrayobject.c311
-rw-r--r--numpy/core/src/arraytypes.inc.src100
-rw-r--r--numpy/core/src/math_c99.inc.src264
-rw-r--r--numpy/core/src/multiarraymodule.c159
-rw-r--r--numpy/core/src/scalarmathmodule.c.src61
-rw-r--r--numpy/core/src/scalartypes.inc.src437
-rw-r--r--numpy/core/src/ufuncobject.c601
-rw-r--r--numpy/core/src/umathmodule.c.src2199
-rw-r--r--numpy/core/tests/test_memmap.py17
-rw-r--r--numpy/core/tests/test_multiarray.py20
-rw-r--r--numpy/core/tests/test_regression.py30
-rw-r--r--numpy/core/tests/test_scalarmath.py2
-rw-r--r--numpy/core/tests/test_ufunc.py1
-rw-r--r--numpy/core/tests/test_umath.py27
-rw-r--r--numpy/distutils/command/build.py3
-rw-r--r--numpy/distutils/command/build_ext.py6
-rw-r--r--numpy/distutils/command/config.py70
-rw-r--r--numpy/distutils/command/install.py37
-rw-r--r--numpy/distutils/command/scons.py19
-rw-r--r--numpy/distutils/conv_template.py41
-rw-r--r--numpy/distutils/fcompiler/__init__.py2
-rw-r--r--numpy/distutils/tests/test_misc_util.py13
-rw-r--r--numpy/doc/CAPI.txt313
-rw-r--r--numpy/doc/DISTUTILS.txt546
-rw-r--r--numpy/doc/EXAMPLE_DOCSTRING.txt104
-rw-r--r--numpy/doc/HOWTO_BUILD_DOCS.txt71
-rw-r--r--numpy/doc/HOWTO_DOCUMENT.txt430
-rw-r--r--numpy/doc/README.txt15
-rw-r--r--numpy/doc/__init__.py29
-rw-r--r--numpy/doc/basics.py (renamed from numpy/doc/reference/basics.py)0
-rw-r--r--numpy/doc/broadcasting.py (renamed from numpy/doc/reference/broadcasting.py)0
-rw-r--r--numpy/doc/creation.py (renamed from numpy/doc/reference/creation.py)0
-rw-r--r--numpy/doc/cython/MANIFEST2
-rw-r--r--numpy/doc/cython/Makefile37
-rw-r--r--numpy/doc/cython/README.txt20
-rw-r--r--numpy/doc/cython/c_numpy.pxd136
-rw-r--r--numpy/doc/cython/c_python.pxd62
-rw-r--r--numpy/doc/cython/numpyx.pyx127
-rwxr-xr-xnumpy/doc/cython/run_test.py3
-rwxr-xr-xnumpy/doc/cython/setup.py49
-rw-r--r--numpy/doc/example.py125
-rw-r--r--numpy/doc/glossary.py (renamed from numpy/doc/reference/glossary.py)0
-rw-r--r--numpy/doc/howtofind.py (renamed from numpy/doc/reference/howtofind.py)0
-rw-r--r--numpy/doc/html/api-objects.txt4
-rw-r--r--numpy/doc/html/crarr.pngbin340 -> 0 bytes
-rw-r--r--numpy/doc/html/epydoc.css322
-rw-r--r--numpy/doc/html/epydoc.js293
-rw-r--r--numpy/doc/html/example-module.html316
-rw-r--r--numpy/doc/html/example-pysrc.html204
-rw-r--r--numpy/doc/html/frames.html17
-rw-r--r--numpy/doc/html/help.html268
-rw-r--r--numpy/doc/html/identifier-index.html180
-rw-r--r--numpy/doc/html/index.html17
-rw-r--r--numpy/doc/html/module-tree.html101
-rw-r--r--numpy/doc/html/redirect.html38
-rw-r--r--numpy/doc/html/toc-everything.html33
-rw-r--r--numpy/doc/html/toc-example-module.html33
-rw-r--r--numpy/doc/html/toc.html33
-rw-r--r--numpy/doc/indexing.py (renamed from numpy/doc/reference/indexing.py)0
-rw-r--r--numpy/doc/internals.py (renamed from numpy/doc/reference/internals.py)0
-rw-r--r--numpy/doc/io.py (renamed from numpy/doc/reference/io.py)0
-rw-r--r--numpy/doc/jargon.py (renamed from numpy/doc/reference/jargon.py)0
-rw-r--r--numpy/doc/methods_vs_functions.py (renamed from numpy/doc/reference/methods_vs_functions.py)0
-rw-r--r--numpy/doc/misc.py (renamed from numpy/doc/reference/misc.py)0
-rw-r--r--numpy/doc/newdtype_example/example.py16
-rw-r--r--numpy/doc/newdtype_example/floatint.c153
-rw-r--r--numpy/doc/newdtype_example/floatint/__init__.py0
-rw-r--r--numpy/doc/newdtype_example/setup.py12
-rw-r--r--numpy/doc/npy-format.txt294
-rw-r--r--numpy/doc/pep_buffer.txt869
-rw-r--r--numpy/doc/performance.py (renamed from numpy/doc/reference/performance.py)0
-rw-r--r--numpy/doc/pyrex/MANIFEST2
-rw-r--r--numpy/doc/pyrex/Makefile9
-rw-r--r--numpy/doc/pyrex/README.txt3
-rw-r--r--numpy/doc/pyrex/c_numpy.pxd125
-rw-r--r--numpy/doc/pyrex/c_python.pxd20
-rw-r--r--numpy/doc/pyrex/notes3
-rw-r--r--numpy/doc/pyrex/numpyx.c1037
-rw-r--r--numpy/doc/pyrex/numpyx.pyx101
-rwxr-xr-xnumpy/doc/pyrex/run_test.py3
-rw-r--r--numpy/doc/pyrex/setup.py48
-rw-r--r--numpy/doc/records.txt87
-rw-r--r--numpy/doc/reference/__init__.py12
-rw-r--r--numpy/doc/structured_arrays.py (renamed from numpy/doc/reference/structured_arrays.py)0
-rw-r--r--numpy/doc/subclassing.py291
-rw-r--r--numpy/doc/swig/Makefile36
-rw-r--r--numpy/doc/swig/README130
-rw-r--r--numpy/doc/swig/doc/Makefile51
-rw-r--r--numpy/doc/swig/doc/numpy_swig.html1244
-rw-r--r--numpy/doc/swig/doc/numpy_swig.pdfbin168839 -> 0 bytes
-rw-r--r--numpy/doc/swig/doc/numpy_swig.txt950
-rw-r--r--numpy/doc/swig/doc/testing.html482
-rw-r--r--numpy/doc/swig/doc/testing.pdfbin72439 -> 0 bytes
-rw-r--r--numpy/doc/swig/doc/testing.txt173
-rw-r--r--numpy/doc/swig/numpy.i1634
-rw-r--r--numpy/doc/swig/pyfragments.swg174
-rw-r--r--numpy/doc/swig/test/Array.i107
-rw-r--r--numpy/doc/swig/test/Array1.cxx131
-rw-r--r--numpy/doc/swig/test/Array1.h55
-rw-r--r--numpy/doc/swig/test/Array2.cxx168
-rw-r--r--numpy/doc/swig/test/Array2.h63
-rw-r--r--numpy/doc/swig/test/Farray.cxx122
-rw-r--r--numpy/doc/swig/test/Farray.h56
-rw-r--r--numpy/doc/swig/test/Farray.i73
-rw-r--r--numpy/doc/swig/test/Fortran.cxx24
-rw-r--r--numpy/doc/swig/test/Fortran.h21
-rw-r--r--numpy/doc/swig/test/Fortran.i36
-rw-r--r--numpy/doc/swig/test/Makefile34
-rw-r--r--numpy/doc/swig/test/Matrix.cxx112
-rw-r--r--numpy/doc/swig/test/Matrix.h52
-rw-r--r--numpy/doc/swig/test/Matrix.i45
-rw-r--r--numpy/doc/swig/test/Tensor.cxx131
-rw-r--r--numpy/doc/swig/test/Tensor.h52
-rw-r--r--numpy/doc/swig/test/Tensor.i49
-rw-r--r--numpy/doc/swig/test/Vector.cxx100
-rw-r--r--numpy/doc/swig/test/Vector.h58
-rw-r--r--numpy/doc/swig/test/Vector.i47
-rwxr-xr-xnumpy/doc/swig/test/setup.py66
-rwxr-xr-xnumpy/doc/swig/test/testArray.py283
-rwxr-xr-xnumpy/doc/swig/test/testFarray.py158
-rw-r--r--numpy/doc/swig/test/testFortran.py169
-rwxr-xr-xnumpy/doc/swig/test/testMatrix.py361
-rwxr-xr-xnumpy/doc/swig/test/testTensor.py401
-rwxr-xr-xnumpy/doc/swig/test/testVector.py380
-rw-r--r--numpy/doc/ufuncs.py (renamed from numpy/doc/reference/ufuncs.py)0
-rw-r--r--numpy/doc/ufuncs.txt103
-rw-r--r--numpy/f2py/auxfuncs.py2
-rw-r--r--numpy/f2py/cb_rules.py3
-rw-r--r--numpy/f2py/cfuncs.py4
-rw-r--r--numpy/f2py/common_rules.py4
-rwxr-xr-xnumpy/f2py/crackfortran.py3
-rwxr-xr-xnumpy/f2py/doc/collectinput.py1
-rwxr-xr-xnumpy/f2py/f2py2e.py7
-rw-r--r--numpy/f2py/f2py_testing.py3
-rw-r--r--numpy/f2py/f90mod_rules.py4
-rw-r--r--numpy/f2py/func2subr.py3
-rw-r--r--numpy/f2py/use_rules.py5
-rw-r--r--numpy/fft/fftpack_litemodule.c12
-rw-r--r--numpy/fft/tests/test_fftpack.py1
-rw-r--r--numpy/fft/tests/test_helper.py1
-rw-r--r--numpy/lib/_datasource.py50
-rw-r--r--numpy/lib/arraysetops.py1
-rw-r--r--numpy/lib/format.py3
-rw-r--r--numpy/lib/index_tricks.py2
-rw-r--r--numpy/lib/io.py11
-rw-r--r--numpy/lib/scimath.py16
-rw-r--r--numpy/lib/setup.py1
-rw-r--r--numpy/lib/src/_compiled_base.c18
-rw-r--r--numpy/lib/tests/test__datasource.py3
-rw-r--r--numpy/lib/tests/test_format.py8
-rw-r--r--numpy/lib/tests/test_function_base.py1
-rw-r--r--numpy/lib/tests/test_io.py31
-rw-r--r--numpy/lib/tests/test_ufunclike.py6
-rw-r--r--numpy/lib/twodim_base.py2
-rw-r--r--numpy/lib/ufunclike.py36
-rw-r--r--numpy/lib/utils.py25
-rw-r--r--numpy/linalg/lapack_litemodule.c36
-rw-r--r--numpy/linalg/linalg.py15
-rw-r--r--numpy/ma/bench.py6
-rw-r--r--numpy/ma/core.py525
-rw-r--r--numpy/ma/extras.py14
-rw-r--r--numpy/ma/mrecords.py160
-rw-r--r--numpy/ma/tests/test_core.py409
-rw-r--r--numpy/ma/tests/test_extras.py67
-rw-r--r--numpy/ma/tests/test_mrecords.py102
-rw-r--r--numpy/ma/tests/test_old_ma.py2
-rw-r--r--numpy/ma/tests/test_subclassing.py70
-rw-r--r--numpy/ma/testutils.py27
-rw-r--r--numpy/ma/timer_comparison.py76
-rw-r--r--numpy/numarray/_capi.c31
-rw-r--r--numpy/numarray/alter_code2.py3
-rw-r--r--numpy/numarray/functions.py18
-rw-r--r--numpy/numarray/numerictypes.py3
-rw-r--r--numpy/numarray/session.py2
-rw-r--r--numpy/numarray/util.py19
-rw-r--r--numpy/oldnumeric/arrayfns.py27
-rw-r--r--numpy/oldnumeric/compat.py2
-rw-r--r--numpy/oldnumeric/mlab.py12
-rw-r--r--numpy/oldnumeric/rng.py12
-rw-r--r--numpy/random/info.py85
-rw-r--r--numpy/random/mtrand/distributions.c33
-rw-r--r--numpy/random/mtrand/distributions.h2
-rw-r--r--numpy/random/mtrand/mtrand.c6956
-rw-r--r--numpy/random/mtrand/mtrand.pyx82
-rw-r--r--numpy/random/tests/test_random.py6
-rw-r--r--numpy/setup.py1
-rw-r--r--numpy/testing/decorators.py45
-rw-r--r--numpy/testing/noseclasses.py71
-rw-r--r--numpy/testing/nosetester.py46
-rw-r--r--numpy/testing/parametric.py6
-rw-r--r--numpy/testing/tests/test_utils.py4
-rw-r--r--numpy/testing/utils.py43
-rw-r--r--numpy/tests/test_ctypeslib.py4
-rw-r--r--numpy/version.py2
216 files changed, 7980 insertions, 21605 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py
index 66f80040c..119cb44cf 100644
--- a/numpy/__init__.py
+++ b/numpy/__init__.py
@@ -36,14 +36,17 @@ To search for objects of which the documentation contains keywords, do::
>>> np.lookfor('keyword')
+Topical documentation is available under the ``doc`` sub-module::
+
+ >>> from numpy import doc
+ >>> help(doc)
+
Available subpackages
---------------------
-core
- Defines a multi-dimensional array and useful procedures
- for Numerical computation.
+doc
+ Topical documentation on broadcasting, indexing, etc.
lib
- Basic functions used by several sub-packages and useful
- to have in the main name-space.
+ Basic functions used by several sub-packages.
random
Core Random Tools
linalg
@@ -52,26 +55,16 @@ fft
Core FFT routines
testing
Numpy testing tools
-
-The following sub-packages must be explicitly imported:
-
f2py
Fortran to Python Interface Generator.
distutils
Enhancements to distutils with support for
Fortran compilers support and more.
-Global symbols from subpackages
--------------------------------
-Do not import directly from `core` and `lib`: those functions
-have been imported into the `numpy` namespace.
-
-Utility tools
--------------
+Utilities
+---------
test
Run numpy unittests
-pkgload
- Load numpy packages
show_config
Show numpy build configuration
dual
@@ -147,7 +140,6 @@ else:
import random
import ctypeslib
import ma
- import doc
# Make these accessible from numpy name-space
# but not imported in from numpy import *
@@ -159,4 +151,4 @@ else:
'show_config'])
__all__.extend(core.__all__)
__all__.extend(lib.__all__)
- __all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma', 'doc'])
+ __all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma'])
diff --git a/numpy/_import_tools.py b/numpy/_import_tools.py
index b06fbff7e..38bf712fe 100644
--- a/numpy/_import_tools.py
+++ b/numpy/_import_tools.py
@@ -1,8 +1,5 @@
-
import os
import sys
-import imp
-from glob import glob
__all__ = ['PackageLoader']
diff --git a/numpy/core/SConscript b/numpy/core/SConscript
index d950ec99b..569c33bba 100644
--- a/numpy/core/SConscript
+++ b/numpy/core/SConscript
@@ -1,4 +1,4 @@
-# Last Change: Tue Aug 05 12:00 PM 2008 J
+# Last Change: Fri Oct 03 04:00 PM 2008 J
# vim:syntax=python
import os
import sys
@@ -131,43 +131,60 @@ numpyconfig_sym.append(('MATHLIB', ','.join(mlib)))
#----------------------------------
# Function to check:
mfuncs = ('expl', 'expf', 'log1p', 'expm1', 'asinh', 'atanhf', 'atanhl',
- 'isnan', 'isinf', 'rint')
+ 'isnan', 'isinf', 'rint', 'trunc')
# Set value to 1 for each defined function (in math lib)
mfuncs_defined = dict([(f, 0) for f in mfuncs])
-# TODO: checklib vs checkfunc ?
-def check_func(f):
- """Check that f is available in mlib, and add the symbol appropriately. """
- st = config.CheckDeclaration(f, language = 'C', includes = "#include <math.h>")
- if st:
- st = config.CheckFunc(f, language = 'C')
- if st:
- mfuncs_defined[f] = 1
- else:
- mfuncs_defined[f] = 0
-
-for f in mfuncs:
- check_func(f)
-
-if mfuncs_defined['expl'] == 1:
- config.Define('HAVE_LONGDOUBLE_FUNCS',
- comment = 'Define to 1 if long double funcs are available')
-if mfuncs_defined['expf'] == 1:
- config.Define('HAVE_FLOAT_FUNCS',
- comment = 'Define to 1 if long double funcs are available')
-if mfuncs_defined['asinh'] == 1:
- config.Define('HAVE_INVERSE_HYPERBOLIC',
- comment = 'Define to 1 if inverse hyperbolic funcs are '\
- 'available')
-if mfuncs_defined['atanhf'] == 1:
- config.Define('HAVE_INVERSE_HYPERBOLIC_FLOAT',
- comment = 'Define to 1 if inverse hyperbolic float funcs '\
- 'are available')
-if mfuncs_defined['atanhl'] == 1:
- config.Define('HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE',
- comment = 'Define to 1 if inverse hyperbolic long double '\
- 'funcs are available')
+# Check for mandatory funcs: we barf if a single one of those is not there
+mandatory_funcs = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs",
+"floor", "ceil", "sqrt", "log10", "log", "exp", "asin", "acos", "atan", "fmod",
+'modf', 'frexp', 'ldexp']
+
+if not config.CheckFuncsAtOnce(mandatory_funcs):
+ raise SystemError("One of the required function to build numpy is not"
+ " available (the list is %s)." % str(mandatory_funcs))
+
+# Standard functions which may not be available and for which we have a
+# replacement implementation
+#
+def check_funcs(funcs):
+ # Use check_funcs_once first, and if it does not work, test func per
+ # func. Return success only if all the functions are available
+ st = config.CheckFuncsAtOnce(funcs)
+ if not st:
+ # Global check failed, check func per func
+ for f in funcs:
+ st = config.CheckFunc(f, language = 'C')
+
+# XXX: we do not test for hypot because python checks for it (HAVE_HYPOT in
+# python.h... I wish they would clean their public headers someday)
+optional_stdfuncs = ["expm1", "log1p", "acosh", "asinh", "atanh",
+ "rint", "trunc"]
+
+check_funcs(optional_stdfuncs)
+
+# C99 functions: float and long double versions
+c99_funcs = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs", "floor",
+ "ceil", "rint", "trunc", "sqrt", "log10", "log", "exp",
+ "expm1", "asin", "acos", "atan", "asinh", "acosh", "atanh",
+ "hypot", "atan2", "pow", "fmod", "modf", 'frexp', 'ldexp']
+
+for prec in ['l', 'f']:
+ fns = [f + prec for f in c99_funcs]
+ check_funcs(fns)
+
+# Normally, isnan and isinf are macro (C99), but some platforms only have
+# func, or both func and macro version. Check for macro only, and define
+# replacement ones if not found.
+# Note: including Python.h is necessary because it modifies some math.h
+# definitions
+for f in ["isnan", "isinf", "signbit", "isfinite"]:
+ includes = """\
+#include <Python.h>
+#include <math.h>
+"""
+ config.CheckDeclaration(f, includes=includes)
#-------------------------------------------------------
# Define the function PyOS_ascii_strod if not available
@@ -234,6 +251,7 @@ env.Append(BUILDERS = {'GenerateMultiarrayApi' : array_api_gen_bld,
# Generate generated code
#------------------------
scalartypes_src = env.GenerateFromTemplate(pjoin('src', 'scalartypes.inc.src'))
+math_c99_src = env.GenerateFromTemplate(pjoin('src', 'math_c99.inc.src'))
arraytypes_src = env.GenerateFromTemplate(pjoin('src', 'arraytypes.inc.src'))
sortmodule_src = env.GenerateFromTemplate(pjoin('src', '_sortmodule.c.src'))
umathmodule_src = env.GenerateFromTemplate(pjoin('src', 'umathmodule.c.src'))
diff --git a/numpy/core/blasdot/_dotblas.c b/numpy/core/blasdot/_dotblas.c
index d71468bb5..c75fb9ecc 100644
--- a/numpy/core/blasdot/_dotblas.c
+++ b/numpy/core/blasdot/_dotblas.c
@@ -80,7 +80,7 @@ static Bool altered=FALSE;
static char doc_alterdot[] = "alterdot() changes all dot functions to use blas.";
static PyObject *
-dotblas_alterdot(PyObject *dummy, PyObject *args)
+dotblas_alterdot(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyArray_Descr *descr;
@@ -115,7 +115,7 @@ dotblas_alterdot(PyObject *dummy, PyObject *args)
static char doc_restoredot[] = "restoredot() restores dots to defaults.";
static PyObject *
-dotblas_restoredot(PyObject *dummy, PyObject *args)
+dotblas_restoredot(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyArray_Descr *descr;
@@ -203,7 +203,7 @@ static char doc_matrixproduct[] = \
"dimension of b.\nNB: The first argument is not conjugated.";
static PyObject *
-dotblas_matrixproduct(PyObject *dummy, PyObject *args)
+dotblas_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyObject *op1, *op2;
PyArrayObject *ap1 = NULL, *ap2 = NULL, *ret = NULL;
@@ -798,7 +798,7 @@ static char doc_innerproduct[] = \
"not conjugated.";
static PyObject *
-dotblas_innerproduct(PyObject *dummy, PyObject *args)
+dotblas_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyObject *op1, *op2;
PyArrayObject *ap1, *ap2, *ret;
@@ -1046,7 +1046,7 @@ dotblas_innerproduct(PyObject *dummy, PyObject *args)
static char doc_vdot[] = "vdot(a,b)\nReturns the dot product of a and b for scalars and vectors\nof floating point and complex types. The first argument, a, is conjugated.";
-static PyObject *dotblas_vdot(PyObject *dummy, PyObject *args) {
+static PyObject *dotblas_vdot(PyObject *NPY_UNUSED(dummy), PyObject *args) {
PyObject *op1, *op2;
PyArrayObject *ap1=NULL, *ap2=NULL, *ret=NULL;
int l;
diff --git a/numpy/core/code_generators/docstrings.py b/numpy/core/code_generators/docstrings.py
index 7271a509d..7c5aeae26 100644
--- a/numpy/core/code_generators/docstrings.py
+++ b/numpy/core/code_generators/docstrings.py
@@ -476,7 +476,8 @@ add_newdoc('numpy.core.umath', 'bitwise_and',
each element is first converted to its binary representation (which works
just like the decimal system, only now we're using 2 instead of 10):
- .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\\n y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i,
+ .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\
+ y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i,
where ``W`` is the bit-width of the type (i.e., 8 for a byte or uint8),
and each :math:`a_i` and :math:`b_j` is either 0 or 1. For example, 13
@@ -540,7 +541,8 @@ add_newdoc('numpy.core.umath', 'bitwise_or',
each element is first converted to its binary representation (which works
just like the decimal system, only now we're using 2 instead of 10):
- .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\\n y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i,
+ .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\
+ y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i,
where ``W`` is the bit-width of the type (i.e., 8 for a byte or uint8),
and each :math:`a_i` and :math:`b_j` is either 0 or 1. For example, 13
@@ -591,7 +593,8 @@ add_newdoc('numpy.core.umath', 'bitwise_or',
>>> np.bitwise_or(np.array([2, 5, 255]), np.array([4, 4, 4]))
array([ 6, 5, 255])
- >>> np.bitwise_or(np.array([2, 5, 255, 2147483647L], dtype=np.int32), \\\n... np.array([4, 4, 4, 2147483647L], dtype=np.int32))
+ >>> np.bitwise_or(np.array([2, 5, 255, 2147483647L], dtype=np.int32),
+ ... np.array([4, 4, 4, 2147483647L], dtype=np.int32))
array([ 6, 5, 255, 2147483647])
>>> np.bitwise_or([True, True], [False, True])
array([ True, True], dtype=bool)
@@ -606,7 +609,8 @@ add_newdoc('numpy.core.umath', 'bitwise_xor',
each element is first converted to its binary representation (which works
just like the decimal system, only now we're using 2 instead of 10):
- .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\\n y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i,
+ .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\
+ y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i,
where ``W`` is the bit-width of the type (i.e., 8 for a byte or uint8),
and each :math:`a_i` and :math:`b_j` is either 0 or 1. For example, 13
@@ -685,6 +689,31 @@ add_newdoc('numpy.core.umath', 'ceil',
""")
+add_newdoc('numpy.core.umath', 'trunc',
+ """
+ Return the truncated value of the input, element-wise.
+
+ The truncated value of the scalar `x` is the nearest integer `i`, such
+ that i is not larger than x amplitude
+
+ Parameters
+ ----------
+ x : array_like
+ Input data.
+
+ Returns
+ -------
+ y : {ndarray, scalar}
+ The truncated value of each element in `x`.
+
+ Examples
+ --------
+ >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
+ >>> np.ceil(a)
+ array([-1., -1., -0., 0., 1., 1., 2.])
+
+ """)
+
add_newdoc('numpy.core.umath', 'conjugate',
"""
Return the complex conjugate, element-wise.
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py
index ba57d53e0..d831ceda9 100644
--- a/numpy/core/code_generators/generate_umath.py
+++ b/numpy/core/code_generators/generate_umath.py
@@ -673,10 +673,10 @@ def make_ufuncs(funcdict):
mlist = []
docstring = textwrap.dedent(uf.docstring).strip()
docstring = docstring.encode('string-escape').replace(r'"', r'\"')
- # Split the docstring because some compilers (like MS) do not like big
- # string literal in C code. We split at endlines because textwrap.wrap
- # do not play well with \n
- docstring = '\\n\"\"'.join(docstring.split(r"\n"))
+ # Split the docstring because some compilers (like MS) do not like big
+ # string literal in C code. We split at endlines because textwrap.wrap
+ # do not play well with \n
+ docstring = '\\n\"\"'.join(docstring.split(r"\n"))
mlist.append(\
r"""f = PyUFunc_FromFuncAndData(%s_functions, %s_data, %s_signatures, %d,
%d, %d, %s, "%s",
diff --git a/numpy/core/code_generators/numpy_api_order.txt b/numpy/core/code_generators/numpy_api_order.txt
index bebc5312f..ff629d6e4 100644
--- a/numpy/core/code_generators/numpy_api_order.txt
+++ b/numpy/core/code_generators/numpy_api_order.txt
@@ -170,3 +170,4 @@ PyArray_SearchsideConverter
PyArray_CheckAxis
PyArray_OverflowMultiplyList
PyArray_CompareString
+PyArray_MultiIterFromObjects
diff --git a/numpy/core/code_generators/ufunc_api_order.txt b/numpy/core/code_generators/ufunc_api_order.txt
index 88b042e2d..d80f30ec8 100644
--- a/numpy/core/code_generators/ufunc_api_order.txt
+++ b/numpy/core/code_generators/ufunc_api_order.txt
@@ -1,3 +1,6 @@
+# The functions in the ufunc C API. They are defined
+# here so that the order is set. Append new functions
+# to the end of the list.
PyUFunc_FromFuncAndData
PyUFunc_RegisterLoopForType
PyUFunc_GenericFunction
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 073614495..f3e9f9b5d 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1617,12 +1617,14 @@ def prod(a, axis=None, dtype=None, out=None):
>>> x = np.array([1, 2, 3], dtype=np.uint8)
>>> np.prod(x).dtype == np.uint
+ True
If `x` is of a signed integer type, then the output type
is the default platform integer:
>>> x = np.array([1, 2, 3], dtype=np.int8)
>>> np.prod(x).dtype == np.int
+ True
"""
try:
diff --git a/numpy/core/include/numpy/fenv/fenv.h b/numpy/core/include/numpy/fenv/fenv.h
index a1371770f..70b3d83f8 100644
--- a/numpy/core/include/numpy/fenv/fenv.h
+++ b/numpy/core/include/numpy/fenv/fenv.h
@@ -68,9 +68,9 @@ extern const fenv_t npy__fe_dfl_env;
#define __fldcw(__cw) __asm __volatile("fldcw %0" : : "m" (__cw))
#define __fldenv(__env) __asm __volatile("fldenv %0" : : "m" (__env))
#define __fnclex() __asm __volatile("fnclex")
-#define __fnstenv(__env) __asm("fnstenv %0" : "=m" (*(__env)))
-#define __fnstcw(__cw) __asm("fnstcw %0" : "=m" (*(__cw)))
-#define __fnstsw(__sw) __asm("fnstsw %0" : "=am" (*(__sw)))
+#define __fnstenv(__env) __asm __volatile("fnstenv %0" : "=m" (*(__env)))
+#define __fnstcw(__cw) __asm __volatile("fnstcw %0" : "=m" (*(__cw)))
+#define __fnstsw(__sw) __asm __volatile("fnstsw %0" : "=am" (*(__sw)))
#define __fwait() __asm __volatile("fwait")
static __inline int
@@ -91,7 +91,7 @@ feclearexcept(int __excepts)
static __inline int
fegetexceptflag(fexcept_t *__flagp, int __excepts)
{
- int __status;
+ __uint16_t __status;
__fnstsw(&__status);
*__flagp = __status & __excepts;
@@ -123,7 +123,7 @@ feraiseexcept(int __excepts)
static __inline int
fetestexcept(int __excepts)
{
- int __status;
+ __uint16_t __status;
__fnstsw(&__status);
return (__status & __excepts);
@@ -187,7 +187,7 @@ fesetenv(const fenv_t *__envp)
static __inline int
feupdateenv(const fenv_t *__envp)
{
- int __status;
+ __uint16_t __status;
__fnstsw(&__status);
__fldenv(*__envp);
diff --git a/numpy/core/include/numpy/ndarrayobject.h b/numpy/core/include/numpy/ndarrayobject.h
index df8adaee0..50f4c8442 100644
--- a/numpy/core/include/numpy/ndarrayobject.h
+++ b/numpy/core/include/numpy/ndarrayobject.h
@@ -23,6 +23,8 @@ extern "C" CONFUSE_EMACS
#define NPY_ALLOW_THREADS 0
#endif
+#include "utils.h"
+
/* There are several places in the code where an array of dimensions is
* allocated statically. This is the size of that static allocation.
*
@@ -38,12 +40,25 @@ extern "C" CONFUSE_EMACS
#define NPY_FAIL 0
#define NPY_SUCCEED 1
- /* Helpful to distinguish what is installed */
-#define NPY_VERSION 0x0100000B
+/* Binary compatibility version number. This number is increased
+ whenever the C-API is changed such that binary compatibility is
+ broken, i.e. whenever a recompile of extension modules is
+ needed. */
+#define NPY_VERSION 0x01000009
+
+/* Minor API version. This number is increased whenever a change is
+ made to the C-API -- whether it breaks binary compatibility or not.
+ Some changes, such as adding a function pointer to the end of the
+ function table, can be made without breaking binary compatibility.
+ In this case, only the NPY_FEATURE_VERSION (*not* NPY_VERSION)
+ would be increased. Whenever binary compatibility is broken, both
+ NPY_VERSION and NPY_FEATURE_VERSION should be increased.
+ */
+#define NPY_FEATURE_VERSION 0x00000001
- /* Some platforms don't define bool, long long, or long double.
- Handle that here.
- */
+/* Some platforms don't define bool, long long, or long double.
+ Handle that here.
+*/
#define NPY_BYTE_FMT "hhd"
#define NPY_UBYTE_FMT "hhu"
@@ -1176,7 +1191,7 @@ typedef struct {
NPY_NEEDS_INIT | NPY_NEEDS_PYAPI)
#define PyDataType_FLAGCHK(dtype, flag) \
- (((dtype)->flags & (flag)) == (flag))
+ (((dtype)->hasobject & (flag)) == (flag))
#define PyDataType_REFCHK(dtype) \
PyDataType_FLAGCHK(dtype, NPY_ITEM_REFCOUNT)
@@ -1192,7 +1207,7 @@ typedef struct _PyArray_Descr {
char type; /* unique-character representing this type */
char byteorder; /* '>' (big), '<' (little), '|'
(not-applicable), or '=' (native). */
- int flags; /* non-zero if it has object arrays
+ char hasobject; /* non-zero if it has object arrays
in fields */
int type_num; /* number representing this type */
int elsize; /* element size for this type */
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index a2ee4b495..96934b820 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -19,20 +19,6 @@ typedef struct {
void *ptr;
PyObject *obj;
PyObject *userloops;
-
- /* generalized ufunc */
- int core_enabled; /* 0 for scalar ufunc; 1 for generalized ufunc */
- int core_num_dim_ix; /* number of distinct dimension names in
- signature */
-
- /* dimension indices of input/output argument k are stored in
- core_dim_ixs[core_offsets[k]..core_offsets[k]+core_num_dims[k]-1] */
- int *core_num_dims; /* numbers of core dimensions of each argument */
- int *core_dim_ixs; /* dimension indices in a flatted form; indices
- are in the range of [0,core_num_dim_ix) */
- int *core_offsets; /* positions of 1st core dimensions of each
- argument in core_dim_ixs */
- char *core_signature; /* signature string for printing purpose */
} PyUFuncObject;
#include "arrayobject.h"
@@ -136,11 +122,6 @@ typedef struct {
int notimplemented; /* The loop caused notimplemented */
int objfunc; /* This loop calls object functions
(an inner-loop function with argument types */
-
- /* generalized ufunc */
- npy_intp *core_dim_sizes; /* stores sizes of core dimensions;
- contains 1 + core_num_dim_ix elements */
- npy_intp *core_strides; /* strides of loop and core dimensions */
} PyUFuncLoopObject;
/* Could make this more clever someday */
@@ -282,11 +263,6 @@ typedef struct _loop1d_info {
| ((SW_INVALID & fpstatus) ? UFUNC_FPE_INVALID : 0); \
}
-#define isnan(x) (_isnan((double)(x)))
-#define isinf(x) ((_fpclass((double)(x)) == _FPCLASS_PINF) || \
- (_fpclass((double)(x)) == _FPCLASS_NINF))
-#define isfinite(x) (_finite((double) x))
-
/* Solaris --------------------------------------------------------*/
/* --------ignoring SunOS ieee_flags approach, someone else can
** deal with that! */
diff --git a/numpy/core/include/numpy/utils.h b/numpy/core/include/numpy/utils.h
new file mode 100644
index 000000000..eb9fb5aa7
--- /dev/null
+++ b/numpy/core/include/numpy/utils.h
@@ -0,0 +1,19 @@
+#ifndef __NUMPY_UTILS_HEADER__
+#define __NUMPY_UTILS_HEADER__
+
+#ifndef __COMP_NPY_UNUSED
+ #if defined(__GNUC__)
+ #define __COMP_NPY_UNUSED __attribute__ ((__unused__))
+ # elif defined(__ICC)
+ #define __COMP_NPY_UNUSED __attribute__ ((__unused__))
+ #else
+ #define __COMP_NPY_UNUSED
+ #endif
+#endif
+
+/* Use this to tag a variable as not used. It will remove unused variable
+ * warning on support platforms (see __COM_NPY_UNUSED) and mangle the variable
+ * to avoid accidental use */
+#define NPY_UNUSED(x) (__NPY_UNUSED_TAGGED ## x) __COMP_NPY_UNUSED
+
+#endif
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py
index 3a9a345dc..5bc314efc 100644
--- a/numpy/core/memmap.py
+++ b/numpy/core/memmap.py
@@ -1,6 +1,5 @@
__all__ = ['memmap']
-import mmap
import warnings
from numeric import uint8, ndarray, dtype
@@ -75,6 +74,14 @@ class memmap(ndarray):
Given a memmap ``fp``, ``isinstance(fp, numpy.ndarray)`` returns
``True``.
+ Notes
+ -----
+
+ Memory-mapped arrays use the the Python memory-map object which
+ (prior to Python 2.5) does not allow files to be larger than a
+ certain size depending on the platform. This size is always < 2GB
+ even on 64-bit systems.
+
Examples
--------
>>> data = np.arange(12, dtype='float32')
@@ -165,6 +172,8 @@ class memmap(ndarray):
__array_priority__ = -100.0
def __new__(subtype, filename, dtype=uint8, mode='r+', offset=0,
shape=None, order='C'):
+ # Import here to minimize 'import numpy' overhead
+ import mmap
try:
mode = mode_equivalents[mode]
except KeyError:
@@ -219,10 +228,6 @@ class memmap(ndarray):
self = ndarray.__new__(subtype, shape, dtype=descr, buffer=mm,
offset=offset, order=order)
self._mmap = mm
- self._offset = offset
- self._mode = mode
- self._size = size
- self._name = filename
return self
def __array_finalize__(self, obj):
@@ -244,33 +249,26 @@ class memmap(ndarray):
def _close(self):
"""Close the memmap file. Only do this when deleting the object."""
if self.base is self._mmap:
+ # The python mmap probably causes flush on close, but
+ # we put this here for safety
+ self._mmap.flush()
self._mmap.close()
self._mmap = None
- # DEV NOTE: This error is raised on the deletion of each row
- # in a view of this memmap. Python traps exceptions in
- # __del__ and prints them to stderr. Suppressing this for now
- # until memmap code is cleaned up and and better tested for
- # numpy v1.1 Objects that do not have a python mmap instance
- # as their base data array, should not do anything in the
- # close anyway.
- #elif self._mmap is not None:
- #raise ValueError, "Cannot close a memmap that is being used " \
- # "by another object."
-
def close(self):
"""Close the memmap file. Does nothing."""
warnings.warn("``close`` is deprecated on memmap arrays. Use del",
DeprecationWarning)
def __del__(self):
- if self._mmap is not None:
+ # We first check if we are the owner of the mmap, rather than
+ # a view, so deleting a view does not call _close
+ # on the parent mmap
+ if self._mmap is self.base:
try:
# First run tell() to see whether file is open
self._mmap.tell()
except ValueError:
pass
else:
- # flush any changes to disk, even if it's a view
- self.flush()
self._close()
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index 449754f87..a6570c0c0 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -571,13 +571,15 @@ def convolve(a,v,mode='full'):
array([ 2.5])
"""
- a,v = array(a,ndmin=1),array(v,ndmin=1)
+ a,v = array(a, ndmin=1),array(v, ndmin=1)
if (len(v) > len(a)):
a, v = v, a
- assert len(a) > 0, 'a cannot be empty'
- assert len(v) > 0, 'v cannot be empty'
+ if len(a) == 0 :
+ raise ValueError('a cannot be empty')
+ if len(v) == 0 :
+ raise ValueError('v cannot be empty')
mode = _mode_from_name(mode)
- return multiarray.correlate(a,asarray(v)[::-1],mode)
+ return multiarray.correlate(a, v[::-1], mode)
inner = multiarray.inner
dot = multiarray.dot
@@ -763,7 +765,7 @@ def tensordot(a, b, axes=2):
>>> b = np.arange(24.).reshape(4,3,2)
>>> c = np.tensordot(a,b, axes=([1,0],[0,1]))
>>> c.shape
- (5,2)
+ (5, 2)
>>> c
array([[ 4400., 4730.],
[ 4532., 4874.],
@@ -772,7 +774,7 @@ def tensordot(a, b, axes=2):
[ 4928., 5306.]])
>>> # A slower but equivalent way of computing the same...
- >>> c = zeros((5,2))
+ >>> c = np.zeros((5,2))
>>> for i in range(5):
... for j in range(2):
... for k in range(3):
diff --git a/numpy/core/numerictypes.py b/numpy/core/numerictypes.py
index ad555f2e0..8a89f40c6 100644
--- a/numpy/core/numerictypes.py
+++ b/numpy/core/numerictypes.py
@@ -88,9 +88,22 @@ from __builtin__ import bool, int, long, float, complex, object, unicode, str
# String-handling utilities to avoid locale-dependence.
-import string
-LOWER_TABLE = string.maketrans(string.ascii_uppercase, string.ascii_lowercase)
-UPPER_TABLE = string.maketrans(string.ascii_lowercase, string.ascii_uppercase)
+# "import string" is costly to import!
+# Construct the translation tables directly
+# "A" = chr(65), "a" = chr(97)
+_all_chars = map(chr, range(256))
+_ascii_upper = _all_chars[65:65+26]
+_ascii_lower = _all_chars[97:97+26]
+LOWER_TABLE="".join(_all_chars[:65] + _ascii_lower + _all_chars[65+26:])
+UPPER_TABLE="".join(_all_chars[:97] + _ascii_upper + _all_chars[97+26:])
+
+#import string
+# assert (string.maketrans(string.ascii_uppercase, string.ascii_lowercase) == \
+# LOWER_TABLE)
+# assert (string.maketrnas(string_ascii_lowercase, string.ascii_uppercase) == \
+# UPPER_TABLE)
+#LOWER_TABLE = string.maketrans(string.ascii_uppercase, string.ascii_lowercase)
+#UPPER_TABLE = string.maketrans(string.ascii_lowercase, string.ascii_uppercase)
def english_lower(s):
""" Apply English case rules to convert ASCII strings to all lower case.
@@ -571,9 +584,6 @@ ScalarType = tuple(ScalarType)
for key in _sctype2char_dict.keys():
cast[key] = lambda x, k=key : array(x, copy=False).astype(k)
-
-_unicodesize = array('u','U1').itemsize
-
# Create the typestring lookup dictionary
_typestr = _typedict()
for key in _sctype2char_dict.keys():
diff --git a/numpy/core/records.py b/numpy/core/records.py
index 6f94c3e9f..1d5b85b97 100644
--- a/numpy/core/records.py
+++ b/numpy/core/records.py
@@ -448,16 +448,22 @@ class recarray(ndarray):
else:
return self.setfield(val, *res)
- def view(self, obj):
- try:
- if issubclass(obj, ndarray):
- return ndarray.view(self, obj)
- except TypeError:
- pass
- dtype = sb.dtype(obj)
- if dtype.fields is None:
- return self.__array__().view(dtype)
- return ndarray.view(self, obj)
+ def view(self, dtype=None, type=None):
+ if dtype is None:
+ return ndarray.view(self, type)
+ elif type is None:
+ try:
+ if issubclass(dtype, ndarray):
+ return ndarray.view(self, dtype)
+ except TypeError:
+ pass
+ dtype = sb.dtype(dtype)
+ if dtype.fields is None:
+ return self.__array__().view(dtype)
+ return ndarray.view(self, dtype)
+ else:
+ return ndarray.view(self, dtype, type)
+
def fromarrays(arrayList, dtype=None, shape=None, formats=None,
names=None, titles=None, aligned=False, byteorder=None):
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 8131317a8..b64c6909c 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -5,19 +5,6 @@ from os.path import join
from numpy.distutils import log
from distutils.dep_util import newer
-FUNCTIONS_TO_CHECK = [
- ('expl', 'HAVE_LONGDOUBLE_FUNCS'),
- ('expf', 'HAVE_FLOAT_FUNCS'),
- ('log1p', 'HAVE_LOG1P'),
- ('expm1', 'HAVE_EXPM1'),
- ('asinh', 'HAVE_INVERSE_HYPERBOLIC'),
- ('atanhf', 'HAVE_INVERSE_HYPERBOLIC_FLOAT'),
- ('atanhl', 'HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE'),
- ('isnan', 'HAVE_ISNAN'),
- ('isinf', 'HAVE_ISINF'),
- ('rint', 'HAVE_RINT'),
- ]
-
def is_npy_no_signal():
"""Return True if the NPY_NO_SIGNAL symbol must be defined in configuration
header."""
@@ -48,6 +35,75 @@ def is_npy_no_smp():
nosmp = 0
return nosmp == 1
+def check_math_capabilities(config, moredefs, mathlibs):
+ def check_func(func_name):
+ return config.check_func(func_name, libraries=mathlibs,
+ decl=True, call=True)
+
+ def check_funcs_once(funcs_name):
+ decl = dict([(f, True) for f in funcs_name])
+ st = config.check_funcs_once(funcs_name, libraries=mathlibs,
+ decl=decl, call=decl)
+ if st:
+ moredefs.extend([name_to_defsymb(f) for f in funcs_name])
+ return st
+
+ def check_funcs(funcs_name):
+ # Use check_funcs_once first, and if it does not work, test func per
+ # func. Return success only if all the functions are available
+ if not check_funcs_once(funcs_name):
+ # Global check failed, check func per func
+ for f in funcs_name:
+ if check_func(f):
+ moredefs.append(name_to_defsymb(f))
+ return 0
+ else:
+ return 1
+
+ def name_to_defsymb(name):
+ return "HAVE_%s" % name.upper()
+
+ #use_msvc = config.check_decl("_MSC_VER")
+
+ # Mandatory functions: if not found, fail the build
+ mandatory_funcs = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs",
+ "floor", "ceil", "sqrt", "log10", "log", "exp", "asin",
+ "acos", "atan", "fmod", 'modf', 'frexp', 'ldexp']
+
+ if not check_funcs_once(mandatory_funcs):
+ raise SystemError("One of the required function to build numpy is not"
+ " available (the list is %s)." % str(mandatory_funcs))
+
+ # Standard functions which may not be available and for which we have a
+ # replacement implementation
+ # XXX: we do not test for hypot because python checks for it (HAVE_HYPOT in
+ # python.h... I wish they would clean their public headers someday)
+ optional_stdfuncs = ["expm1", "log1p", "acosh", "asinh", "atanh",
+ "rint", "trunc"]
+
+ check_funcs(optional_stdfuncs)
+
+ # C99 functions: float and long double versions
+ c99_funcs = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs", "floor",
+ "ceil", "rint", "trunc", "sqrt", "log10", "log", "exp",
+ "expm1", "asin", "acos", "atan", "asinh", "acosh", "atanh",
+ "hypot", "atan2", "pow", "fmod", "modf", 'frexp', 'ldexp']
+
+ for prec in ['l', 'f']:
+ fns = [f + prec for f in c99_funcs]
+ check_funcs(fns)
+
+ # Normally, isnan and isinf are macro (C99), but some platforms only have
+ # func, or both func and macro version. Check for macro only, and define
+ # replacement ones if not found.
+ # Note: including Python.h is necessary because it modifies some math.h
+ # definitions
+ for f in ["isnan", "isinf", "signbit", "isfinite"]:
+ st = config.check_decl(f, headers = ["Python.h", "math.h"])
+ if st:
+ moredefs.append(name_to_defsymb("decl_%s" % f))
+
+
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.system_info import get_info, default_lib_dirs
@@ -105,14 +161,7 @@ def configuration(parent_package='',top_path=None):
ext.libraries.extend(mathlibs)
moredefs.append(('MATHLIB',','.join(mathlibs)))
- def check_func(func_name):
- return config_cmd.check_func(func_name,
- libraries=mathlibs, decl=False,
- headers=['math.h'])
-
- for func_name, defsymbol in FUNCTIONS_TO_CHECK:
- if check_func(func_name):
- moredefs.append(defsymbol)
+ check_math_capabilities(config_cmd, moredefs, mathlibs)
if is_npy_no_signal():
moredefs.append('__NPY_PRIVATE_NO_SIGNAL')
@@ -135,6 +184,17 @@ def configuration(parent_package='',top_path=None):
target_f.write('#define %s\n' % (d))
else:
target_f.write('#define %s %s\n' % (d[0],d[1]))
+
+ # Keep those for backward compatibility for now
+ target_f.write("""
+#ifdef HAVE_EXPL
+#define HAVE_LONGDOUBLE_FUNCS
+#endif
+
+#ifdef HAVE_EXPF
+#define HAVE_FLOAT_FUNCS
+#endif
+""")
target_f.close()
print 'File:',target
target_f = open(target)
@@ -263,7 +323,6 @@ def configuration(parent_package='',top_path=None):
join('src','scalartypes.inc.src'),
join('src','arraytypes.inc.src'),
join('src','_signbit.c'),
- join('src','_isnan.c'),
join('src','ucsnarrow.c'),
join('include','numpy','*object.h'),
'include/numpy/fenv/fenv.c',
@@ -297,6 +356,7 @@ def configuration(parent_package='',top_path=None):
generate_ufunc_api,
join('src','scalartypes.inc.src'),
join('src','arraytypes.inc.src'),
+ join('src','math_c99.inc.src'),
],
depends = [join('src','ufuncobject.c'),
generate_umath_py,
diff --git a/numpy/core/src/_isnan.c b/numpy/core/src/_isnan.c
deleted file mode 100644
index bff6e0a49..000000000
--- a/numpy/core/src/_isnan.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Adapted from cephes */
-
-static int
-isnan(double x)
-{
- union
- {
- double d;
- unsigned short s[4];
- unsigned int i[2];
- } u;
-
- u.d = x;
-
-#if SIZEOF_INT == 4
-
-#ifdef WORDS_BIGENDIAN /* defined in pyconfig.h */
- if( ((u.i[0] & 0x7ff00000) == 0x7ff00000)
- && (((u.i[0] & 0x000fffff) != 0) || (u.i[1] != 0)))
- return 1;
-#else
- if( ((u.i[1] & 0x7ff00000) == 0x7ff00000)
- && (((u.i[1] & 0x000fffff) != 0) || (u.i[0] != 0)))
- return 1;
-#endif
-
-#else /* SIZEOF_INT != 4 */
-
-#ifdef WORDS_BIGENDIAN
- if( (u.s[0] & 0x7ff0) == 0x7ff0)
- {
- if( ((u.s[0] & 0x000f) | u.s[1] | u.s[2] | u.s[3]) != 0 )
- return 1;
- }
-#else
- if( (u.s[3] & 0x7ff0) == 0x7ff0)
- {
- if( ((u.s[3] & 0x000f) | u.s[2] | u.s[1] | u.s[0]) != 0 )
- return 1;
- }
-#endif
-
-#endif /* SIZEOF_INT */
-
- return 0;
-}
diff --git a/numpy/core/src/_signbit.c b/numpy/core/src/_signbit.c
index 2be3649fd..3074c2716 100644
--- a/numpy/core/src/_signbit.c
+++ b/numpy/core/src/_signbit.c
@@ -1,7 +1,7 @@
/* Adapted from cephes */
static int
-signbit(double x)
+signbit_d(double x)
{
union
{
diff --git a/numpy/core/src/_sortmodule.c.src b/numpy/core/src/_sortmodule.c.src
index 8e2e742bd..aa2566445 100644
--- a/numpy/core/src/_sortmodule.c.src
+++ b/numpy/core/src/_sortmodule.c.src
@@ -54,7 +54,7 @@
#lessequal=STDC_LE*14,NUMC_LE*3#
**/
static int
-@TYPE@_quicksort(@type@ *start, intp num, void *unused)
+@TYPE@_quicksort(@type@ *start, intp num, void * NPY_UNUSED(unused))
{
@type@ *pl = start;
@type@ *pr = start + num - 1;
@@ -112,7 +112,7 @@ static int
}
static int
-@TYPE@_aquicksort(@type@ *v, intp* tosort, intp num, void *unused)
+@TYPE@_aquicksort(@type@ *v, intp* tosort, intp num, void *NPY_UNUSED(unused))
{
@type@ vp;
intp *pl, *pr, SWAP_temp;
@@ -174,7 +174,7 @@ static int
static int
-@TYPE@_heapsort(@type@ *start, intp n, void *unused)
+@TYPE@_heapsort(@type@ *start, intp n, void *NPY_UNUSED(unused))
{
@type@ tmp, *a;
intp i,j,l;
@@ -220,7 +220,7 @@ static int
}
static int
-@TYPE@_aheapsort(@type@ *v, intp *tosort, intp n, void *unused)
+@TYPE@_aheapsort(@type@ *v, intp *tosort, intp n, void *NPY_UNUSED(unused))
{
intp *a, i,j,l, tmp;
/* The arrays need to be offset by one for heapsort indexing */
@@ -306,7 +306,7 @@ static void
}
static int
-@TYPE@_mergesort(@type@ *start, intp num, void *unused)
+@TYPE@_mergesort(@type@ *start, intp num, void *NPY_UNUSED(unused))
{
@type@ *pl, *pr, *pw;
@@ -365,7 +365,7 @@ static void
}
static int
-@TYPE@_amergesort(@type@ *v, intp *tosort, intp num, void *unused)
+@TYPE@_amergesort(@type@ *v, intp *tosort, intp num, void *NPY_UNUSED(unused))
{
intp *pl, *pr, *pw;
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c
index 8e50bcdf7..7cf409173 100644
--- a/numpy/core/src/arraymethods.c
+++ b/numpy/core/src/arraymethods.c
@@ -1105,7 +1105,7 @@ _setlist_pkl(PyArrayObject *self, PyObject *list)
static PyObject *
-array_reduce(PyArrayObject *self, PyObject *args)
+array_reduce(PyArrayObject *self, PyObject *NPY_UNUSED(args))
{
/* version number of this pickle type. Increment if we need to
change the format. Be sure to handle the old versions in
@@ -2021,7 +2021,7 @@ static PyMethodDef array_methods[] = {
METH_VARARGS | METH_KEYWORDS, NULL},
{"view", (PyCFunction)array_view,
METH_VARARGS | METH_KEYWORDS, NULL},
- {NULL, NULL} /* sentinel */
+ {NULL, NULL, 0, NULL} /* sentinel */
};
#undef _ARET
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index fe789dee9..32d49eaf2 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -3710,7 +3710,7 @@ fast_scalar_power(PyArrayObject *a1, PyObject *o2, int inplace) {
}
static PyObject *
-array_power(PyArrayObject *a1, PyObject *o2, PyObject *modulo)
+array_power(PyArrayObject *a1, PyObject *o2, PyObject *NPY_UNUSED(modulo))
{
/* modulo is ignored! */
PyObject *value;
@@ -3801,7 +3801,7 @@ array_inplace_remainder(PyArrayObject *m1, PyObject *m2)
}
static PyObject *
-array_inplace_power(PyArrayObject *a1, PyObject *o2, PyObject *modulo)
+array_inplace_power(PyArrayObject *a1, PyObject *o2, PyObject *NPY_UNUSED(modulo))
{
/* modulo is ignored! */
PyObject *value;
@@ -6871,7 +6871,7 @@ array_transpose_get(PyArrayObject *self)
--- default sub-class behavior
*/
static PyObject *
-array_finalize_get(PyArrayObject *self)
+array_finalize_get(PyArrayObject *NPY_UNUSED(self))
{
Py_INCREF(Py_None);
return Py_None;
@@ -6880,76 +6880,76 @@ array_finalize_get(PyArrayObject *self)
static PyGetSetDef array_getsetlist[] = {
{"ndim",
(getter)array_ndim_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"flags",
(getter)array_flags_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"shape",
(getter)array_shape_get,
(setter)array_shape_set,
- NULL},
+ NULL, NULL},
{"strides",
(getter)array_strides_get,
(setter)array_strides_set,
- NULL},
+ NULL, NULL},
{"data",
(getter)array_data_get,
(setter)array_data_set,
- NULL},
+ NULL, NULL},
{"itemsize",
(getter)array_itemsize_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"size",
(getter)array_size_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"nbytes",
(getter)array_nbytes_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"base",
(getter)array_base_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"dtype",
(getter)array_descr_get,
(setter)array_descr_set,
- NULL},
+ NULL, NULL},
{"real",
(getter)array_real_get,
(setter)array_real_set,
- NULL},
+ NULL, NULL},
{"imag",
(getter)array_imag_get,
(setter)array_imag_set,
- NULL},
+ NULL, NULL},
{"flat",
(getter)array_flat_get,
(setter)array_flat_set,
- NULL},
+ NULL, NULL},
{"ctypes",
(getter)array_ctypes_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"T",
(getter)array_transpose_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"__array_interface__",
(getter)array_interface_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"__array_struct__",
(getter)array_struct_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"__array_priority__",
(getter)array_priority_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"__array_finalize__",
(getter)array_finalize_get,
- NULL, NULL},
- {NULL, NULL, NULL, NULL}, /* Sentinel */
+ NULL, NULL, NULL},
+ {NULL, NULL, NULL, NULL, NULL}, /* Sentinel */
};
/****************** end of attribute get and set routines *******************/
static PyObject *
-array_alloc(PyTypeObject *type, Py_ssize_t nitems)
+array_alloc(PyTypeObject *type, Py_ssize_t NPY_UNUSED(nitems))
{
PyObject *obj;
/* nitems will always be 0 */
@@ -7017,7 +7017,17 @@ static PyTypeObject PyArray_Type = {
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
- 0 /* tp_weaklist */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
/* The rest of this code is to build the right kind of array from a python */
@@ -9960,7 +9970,7 @@ static PyMappingMethods iter_as_mapping = {
static PyObject *
-iter_array(PyArrayIterObject *it, PyObject *op)
+iter_array(PyArrayIterObject *it, PyObject *NPY_UNUSED(op))
{
PyObject *r;
@@ -10019,7 +10029,7 @@ static PyMethodDef iter_methods[] = {
/* to get array */
{"__array__", (PyCFunction)iter_array, 1, NULL},
{"copy", (PyCFunction)iter_copy, 1, NULL},
- {NULL, NULL} /* sentinel */
+ {NULL, NULL, 0, NULL} /* sentinel */
};
static PyObject *
@@ -10038,7 +10048,7 @@ iter_richcompare(PyArrayIterObject *self, PyObject *other, int cmp_op)
static PyMemberDef iter_members[] = {
{"base", T_OBJECT, offsetof(PyArrayIterObject, ao), RO, NULL},
{"index", T_INT, offsetof(PyArrayIterObject, index), RO, NULL},
- {NULL},
+ {NULL, 0, 0, 0, NULL},
};
static PyObject *
@@ -10062,9 +10072,8 @@ iter_coords_get(PyArrayIterObject *self)
static PyGetSetDef iter_getsets[] = {
{"coords",
(getter)iter_coords_get,
- NULL,
- NULL},
- {NULL, NULL, NULL, NULL},
+ NULL, NULL, NULL},
+ {NULL, NULL, NULL, NULL, NULL},
};
static PyTypeObject PyArrayIter_Type = {
@@ -10100,6 +10109,30 @@ static PyTypeObject PyArrayIter_Type = {
iter_methods, /* tp_methods */
iter_members, /* tp_members */
iter_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
@@ -10783,13 +10816,92 @@ static PyTypeObject PyArrayMapIter_Type = {
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
- 0 /* tp_weaklist */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
/** END of Subscript Iterator **/
+/*
+ NUMPY_API
+ Get MultiIterator from array of Python objects and any additional
+
+ PyObject **mps -- array of PyObjects
+ int n - number of PyObjects in the array
+ int nadd - number of additional arrays to include in the
+ iterator.
+
+ Returns a multi-iterator object.
+ */
+static PyObject *
+PyArray_MultiIterFromObjects(PyObject **mps, int n, int nadd, ...)
+{
+ va_list va;
+ PyArrayMultiIterObject *multi;
+ PyObject *current;
+ PyObject *arr;
+
+ int i, ntot, err=0;
+
+ ntot = n + nadd;
+ if (ntot < 2 || ntot > NPY_MAXARGS) {
+ PyErr_Format(PyExc_ValueError,
+ "Need between 2 and (%d) " \
+ "array objects (inclusive).", NPY_MAXARGS);
+ return NULL;
+ }
+
+ multi = _pya_malloc(sizeof(PyArrayMultiIterObject));
+ if (multi == NULL) return PyErr_NoMemory();
+ PyObject_Init((PyObject *)multi, &PyArrayMultiIter_Type);
+
+ for(i=0; i<ntot; i++) multi->iters[i] = NULL;
+ multi->numiter = ntot;
+ multi->index = 0;
+
+ va_start(va, nadd);
+ for(i=0; i<ntot; i++) {
+ if (i < n) {
+ current = mps[i];
+ }
+ else {
+ current = va_arg(va, PyObject *);
+ }
+ arr = PyArray_FROM_O(current);
+ if (arr==NULL) {
+ err=1; break;
+ }
+ else {
+ multi->iters[i] = (PyArrayIterObject *)PyArray_IterNew(arr);
+ Py_DECREF(arr);
+ }
+ }
+
+ va_end(va);
+
+ if (!err && PyArray_Broadcast(multi) < 0) err=1;
+
+ if (err) {
+ Py_DECREF(multi);
+ return NULL;
+ }
+
+ PyArray_MultiIter_RESET(multi);
+
+ return (PyObject *)multi;
+}
+
/*NUMPY_API
Get MultiIterator,
*/
@@ -10848,7 +10960,7 @@ PyArray_MultiIterNew(int n, ...)
}
static PyObject *
-arraymultiter_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
+arraymultiter_new(PyTypeObject *NPY_UNUSED(subtype), PyObject *args, PyObject *kwds)
{
int n, i;
@@ -10977,24 +11089,24 @@ arraymultiter_iters_get(PyArrayMultiIterObject *self)
static PyGetSetDef arraymultiter_getsetlist[] = {
{"size",
(getter)arraymultiter_size_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"index",
(getter)arraymultiter_index_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"shape",
(getter)arraymultiter_shape_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"iters",
(getter)arraymultiter_iters_get,
- NULL, NULL},
- {NULL, NULL, NULL, NULL},
+ NULL, NULL, NULL},
+ {NULL, NULL, NULL, NULL, NULL},
};
static PyMemberDef arraymultiter_members[] = {
{"numiter", T_INT, offsetof(PyArrayMultiIterObject, numiter),
RO, NULL},
{"nd", T_INT, offsetof(PyArrayMultiIterObject, nd), RO, NULL},
- {NULL},
+ {NULL, 0, 0, 0, NULL},
};
static PyObject *
@@ -11009,7 +11121,7 @@ arraymultiter_reset(PyArrayMultiIterObject *self, PyObject *args)
static PyMethodDef arraymultiter_methods[] = {
{"reset", (PyCFunction) arraymultiter_reset, METH_VARARGS, NULL},
- {NULL, NULL},
+ {NULL, NULL, 0, NULL},
};
static PyTypeObject PyArrayMultiIter_Type = {
@@ -11059,7 +11171,17 @@ static PyTypeObject PyArrayMultiIter_Type = {
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
- 0 /* tp_weaklist */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
/*NUMPY_API*/
@@ -11156,8 +11278,8 @@ static PyMemberDef arraydescr_members[] = {
{"byteorder", T_CHAR, offsetof(PyArray_Descr, byteorder), RO, NULL},
{"itemsize", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL},
{"alignment", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL},
- {"flags", T_UBYTE, offsetof(PyArray_Descr, flags), RO, NULL},
- {NULL},
+ {"flags", T_UBYTE, offsetof(PyArray_Descr, hasobject), RO, NULL},
+ {NULL, 0, 0, 0, NULL},
};
static PyObject *
@@ -11421,43 +11543,43 @@ arraydescr_names_set(PyArray_Descr *self, PyObject *val)
static PyGetSetDef arraydescr_getsets[] = {
{"subdtype",
(getter)arraydescr_subdescr_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"descr",
(getter)arraydescr_protocol_descr_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"str",
(getter)arraydescr_protocol_typestr_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"name",
(getter)arraydescr_typename_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"base",
(getter)arraydescr_base_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"shape",
(getter)arraydescr_shape_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"isbuiltin",
(getter)arraydescr_isbuiltin_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"isnative",
(getter)arraydescr_isnative_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"fields",
(getter)arraydescr_fields_get,
- NULL, NULL},
+ NULL, NULL, NULL},
{"names",
(getter)arraydescr_names_get,
(setter)arraydescr_names_set,
- NULL},
+ NULL, NULL},
{"hasobject",
(getter)arraydescr_hasobject_get,
- NULL, NULL},
- {NULL, NULL, NULL, NULL},
+ NULL, NULL, NULL},
+ {NULL, NULL, NULL, NULL, NULL},
};
static PyObject *
-arraydescr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
+arraydescr_new(PyTypeObject *NPY_UNUSED(subtype), PyObject *args, PyObject *kwds)
{
PyObject *odescr;
PyArray_Descr *descr, *conv;
@@ -11489,7 +11611,7 @@ arraydescr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
/* return a tuple of (callable object, args, state). */
static PyObject *
-arraydescr_reduce(PyArray_Descr *self, PyObject *args)
+arraydescr_reduce(PyArray_Descr *self, PyObject *NPY_UNUSED(args))
{
/* version number of this pickle type. Increment if we need to
change the format. Be sure to handle the old versions in
@@ -11556,7 +11678,7 @@ arraydescr_reduce(PyArray_Descr *self, PyObject *args)
PyTuple_SET_ITEM(state, 5, PyInt_FromLong(elsize));
PyTuple_SET_ITEM(state, 6, PyInt_FromLong(alignment));
- PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->flags));
+ PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->hasobject));
PyTuple_SET_ITEM(ret, 2, state);
return ret;
@@ -11568,8 +11690,7 @@ arraydescr_reduce(PyArray_Descr *self, PyObject *args)
static int
_descr_find_object(PyArray_Descr *self)
{
- if (PyDataType_FLAGCHK(self, NPY_ITEM_HASOBJECT) ||
- self->type_num == PyArray_OBJECT ||
+ if (self->hasobject || self->type_num == PyArray_OBJECT ||
self->kind == 'O')
return NPY_OBJECT_DTYPE_FLAGS;
if (PyDescr_HASFIELDS(self)) {
@@ -11585,7 +11706,7 @@ _descr_find_object(PyArray_Descr *self)
return 0;
}
if (_descr_find_object(new)) {
- new->flags = NPY_OBJECT_DTYPE_FLAGS;
+ new->hasobject = NPY_OBJECT_DTYPE_FLAGS;
return NPY_OBJECT_DTYPE_FLAGS;
}
}
@@ -11716,9 +11837,9 @@ arraydescr_setstate(PyArray_Descr *self, PyObject *args)
self->alignment = alignment;
}
- self->flags = dtypeflags;
+ self->hasobject = dtypeflags;
if (version < 3) {
- self->flags = _descr_find_object(self);
+ self->hasobject = _descr_find_object(self);
}
Py_INCREF(Py_None);
return Py_None;
@@ -11828,7 +11949,7 @@ static PyMethodDef arraydescr_methods[] = {
NULL},
{"newbyteorder", (PyCFunction)arraydescr_newbyteorder, METH_VARARGS,
NULL},
- {NULL, NULL} /* sentinel */
+ {NULL, NULL, 0, NULL} /* sentinel */
};
static PyObject *
@@ -12062,6 +12183,12 @@ static PySequenceMethods descr_as_sequence = {
descr_length,
(binaryfunc)NULL,
descr_repeat,
+ NULL, NULL,
+ NULL, /* sq_ass_item */
+ NULL, /* ssizessizeobjargproc sq_ass_slice */
+ 0, /* sq_contains */
+ 0, /* sq_inplace_concat */
+ 0, /* sq_inplace_repeat */
};
static PyMappingMethods descr_as_mapping = {
@@ -12120,7 +12247,17 @@ static PyTypeObject PyArrayDescr_Type = {
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
- 0 /* tp_weaklist */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
@@ -12282,60 +12419,60 @@ static PyGetSetDef arrayflags_getsets[] = {
{"contiguous",
(getter)arrayflags_contiguous_get,
NULL,
- ""},
+ "", NULL},
{"c_contiguous",
(getter)arrayflags_contiguous_get,
NULL,
- ""},
+ "", NULL},
{"f_contiguous",
(getter)arrayflags_fortran_get,
NULL,
- ""},
+ "", NULL},
{"fortran",
(getter)arrayflags_fortran_get,
NULL,
- ""},
+ "", NULL},
{"updateifcopy",
(getter)arrayflags_updateifcopy_get,
(setter)arrayflags_updateifcopy_set,
- ""},
+ "", NULL},
{"owndata",
(getter)arrayflags_owndata_get,
NULL,
- ""},
+ "", NULL},
{"aligned",
(getter)arrayflags_aligned_get,
(setter)arrayflags_aligned_set,
- ""},
+ "", NULL},
{"writeable",
(getter)arrayflags_writeable_get,
(setter)arrayflags_writeable_set,
- ""},
+ "", NULL},
{"fnc",
(getter)arrayflags_fnc_get,
NULL,
- ""},
+ "", NULL},
{"forc",
(getter)arrayflags_forc_get,
NULL,
- ""},
+ "", NULL},
{"behaved",
(getter)arrayflags_behaved_get,
NULL,
- ""},
+ "", NULL},
{"carray",
(getter)arrayflags_carray_get,
NULL,
- ""},
+ "", NULL},
{"farray",
(getter)arrayflags_farray_get,
NULL,
- ""},
+ "", NULL},
{"num",
(getter)arrayflags_num_get,
NULL,
- ""},
- {NULL, NULL, NULL, NULL},
+ "", NULL},
+ {NULL, NULL, NULL, NULL, NULL},
};
static PyObject *
@@ -12489,7 +12626,7 @@ static PyMappingMethods arrayflags_as_mapping = {
static PyObject *
-arrayflags_new(PyTypeObject *self, PyObject *args, PyObject *kwds)
+arrayflags_new(PyTypeObject *NPY_UNUSED(self), PyObject *args, PyObject *NPY_UNUSED(kwds))
{
PyObject *arg=NULL;
if (!PyArg_UnpackTuple(args, "flagsobj", 0, 1, &arg))
@@ -12550,5 +12687,15 @@ static PyTypeObject PyArrayFlags_Type = {
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
- 0 /* tp_weaklist */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src
index 23a6ed167..764bad1f4 100644
--- a/numpy/core/src/arraytypes.inc.src
+++ b/numpy/core/src/arraytypes.inc.src
@@ -664,11 +664,11 @@ fail:
#from=BYTE*13,UBYTE*13,SHORT*13,USHORT*13,INT*13,UINT*13,LONG*13,ULONG*13,LONGLONG*13,ULONGLONG*13,FLOAT*13,DOUBLE*13,LONGDOUBLE*13,CFLOAT*13,CDOUBLE*13,CLONGDOUBLE*13#
#totyp=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*16#
#fromtyp=byte*13, ubyte*13, short*13, ushort*13, int*13, uint*13, long*13, ulong*13, longlong*13, ulonglong*13, float*13, double*13, longdouble*13, float*13, double*13, longdouble*13#
-#incr= ip++*169,ip+=2*39#
+#incr= (ip++)*169,(ip+=2)*39#
*/
static void
@from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n,
- PyArrayObject *aip, PyArrayObject *aop)
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = (@totyp@)*ip;
@@ -683,7 +683,7 @@ static void
*/
static void
@from@_to_BOOL(register @fromtyp@ *ip, register Bool *op, register intp n,
- PyArrayObject *aip, PyArrayObject *aop)
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = (Bool)(*ip++ != FALSE);
@@ -697,7 +697,7 @@ static void
*/
static void
@from@_to_BOOL(register @fromtyp@ *ip, register Bool *op, register intp n,
- PyArrayObject *aip, PyArrayObject *aop)
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op = (Bool)(((*ip).real != FALSE) || ((*ip).imag != FALSE));
@@ -712,7 +712,7 @@ static void
*/
static void
BOOL_to_@to@(register Bool *ip, register @totyp@ *op, register intp n,
- PyArrayObject *aip, PyArrayObject *aop)
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = (@totyp@)(*ip++ != FALSE);
@@ -729,7 +729,7 @@ BOOL_to_@to@(register Bool *ip, register @totyp@ *op, register intp n,
*/
static void
@from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n,
- PyArrayObject *aip, PyArrayObject *aop)
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = (@totyp@)*ip++;
@@ -748,7 +748,7 @@ static void
*/
static void
@from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n,
- PyArrayObject *aip, PyArrayObject *aop)
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
n <<= 1;
while (n--) {
@@ -766,7 +766,7 @@ static void
*/
static void
@from@_to_OBJECT(@fromtyp@ *ip, PyObject **op, intp n, PyArrayObject *aip,
- PyArrayObject *aop)
+ PyArrayObject *NPY_UNUSED(aop))
{
register intp i;
int skip=@skip@;
@@ -777,6 +777,26 @@ static void
}
/**end repeat**/
+#define _NPY_UNUSEDBOOL NPY_UNUSED
+#define _NPY_UNUSEDBYTE NPY_UNUSED
+#define _NPY_UNUSEDUBYTE NPY_UNUSED
+#define _NPY_UNUSEDSHORT NPY_UNUSED
+#define _NPY_UNUSEDUSHORT NPY_UNUSED
+#define _NPY_UNUSEDINT NPY_UNUSED
+#define _NPY_UNUSEDUINT NPY_UNUSED
+#define _NPY_UNUSEDLONG NPY_UNUSED
+#define _NPY_UNUSEDULONG NPY_UNUSED
+#define _NPY_UNUSEDLONGLONG NPY_UNUSED
+#define _NPY_UNUSEDULONGLONG NPY_UNUSED
+#define _NPY_UNUSEDFLOAT NPY_UNUSED
+#define _NPY_UNUSEDDOUBLE NPY_UNUSED
+#define _NPY_UNUSEDLONGDOUBLE NPY_UNUSED
+#define _NPY_UNUSEDCFLOAT NPY_UNUSED
+#define _NPY_UNUSEDCDOUBLE NPY_UNUSED
+#define _NPY_UNUSEDCLONGDOUBLE NPY_UNUSED
+#define _NPY_UNUSEDSTRING
+#define _NPY_UNUSEDVOID
+#define _NPY_UNUSEDUNICODE
/**begin repeat
#to=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE, STRING, UNICODE, VOID#
@@ -784,7 +804,7 @@ static void
#skip= 1*17, aip->descr->elsize*3#
*/
static void
-OBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *aip,
+OBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *_NPY_UNUSED@to@(aip),
PyArrayObject *aop)
{
register intp i;
@@ -883,7 +903,7 @@ static void
#format="hd","hu","d","u","ld","lu",LONGLONG_FMT,ULONGLONG_FMT,"f","lf","Lf"#
*/
static int
-@fname@_scan (FILE *fp, @type@ *ip, void *ignore, PyArray_Descr *ignore2)
+@fname@_scan (FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignored))
{
return fscanf(fp, "%"@format@, ip);
}
@@ -897,7 +917,7 @@ static int
#format="d","u"#
*/
static int
-@fname@_scan (FILE *fp, @type@ *ip, void *ignore, PyArray_Descr *ignore2)
+@fname@_scan (FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignore2))
{
@btype@ temp;
int num;
@@ -908,7 +928,7 @@ static int
/**end repeat**/
static int
-BOOL_scan (FILE *fp, Bool *ip, void *ignore, PyArray_Descr *ignore2)
+BOOL_scan (FILE *fp, Bool *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignore2))
{
int temp;
int num;
@@ -932,7 +952,7 @@ BOOL_scan (FILE *fp, Bool *ip, void *ignore, PyArray_Descr *ignore2)
#btype=(long,ulong)*5#
*/
static int
-@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *ignore)
+@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore))
{
@btype@ result;
@@ -948,7 +968,7 @@ static int
*/
#if (PY_VERSION_HEX >= 0x02040000) || defined(PyOS_ascii_strtod)
static int
-@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *ignore)
+@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore))
{
double result;
@@ -980,7 +1000,7 @@ static int
*/
static void
@fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride,
- intp n, int swap, void *arr)
+ intp n, int swap, void *NPY_UNUSED(arr))
{
if (src != NULL) {
if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) {
@@ -997,7 +1017,7 @@ static void
}
static void
-@fname@_copyswap (void *dst, void *src, int swap, void *arr)
+@fname@_copyswap (void *dst, void *src, int swap, void *NPY_UNUSED(arr))
{
if (src != NULL) /* copy first if needed */
@@ -1067,7 +1087,7 @@ static void
*/
static void
@fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, intp n,
- int swap, void *arr)
+ int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
{
if (src != NULL) {
if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) {
@@ -1082,7 +1102,7 @@ static void
}
static void
-@fname@_copyswap (void *dst, void *src, int swap, void *arr)
+@fname@_copyswap (void *dst, void *src, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
{
if (src != NULL) /* copy first if needed */
memcpy(dst, src, sizeof(@type@));
@@ -1101,7 +1121,7 @@ static void
*/
static void
@fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, intp n,
- int swap, void *arr)
+ int swap, void *NPY_UNUSED(arr))
{
if (src != NULL) { /* copy first if needed */
@@ -1123,7 +1143,7 @@ static void
}
static void
-@fname@_copyswap (void *dst, void *src, int swap, void *arr)
+@fname@_copyswap (void *dst, void *src, int swap, void *NPY_UNUSED(arr))
{
if (src != NULL) /* copy first if needed */
memcpy(dst, src, sizeof(@type@));
@@ -1225,7 +1245,7 @@ static void
#define __ALIGNED(obj, sz) ((((size_t) obj) % (sz))==0)
static void
OBJECT_copyswapn (PyObject **dst, intp dstride, PyObject **src, intp sstride,
- register intp n, int swap, void *arr)
+ register intp n, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
{
register intp i;
if (src != NULL) {
@@ -1258,7 +1278,7 @@ OBJECT_copyswapn (PyObject **dst, intp dstride, PyObject **src, intp sstride,
}
static void
-OBJECT_copyswap(PyObject **dst, PyObject **src, int swap, void *arr)
+OBJECT_copyswap(PyObject **dst, PyObject **src, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
{
if (src != NULL) {
@@ -1279,7 +1299,7 @@ OBJECT_copyswap(PyObject **dst, PyObject **src, int swap, void *arr)
/* ignore swap */
static void
STRING_copyswapn (char *dst, intp dstride, char *src, intp sstride,
- intp n, int swap, PyArrayObject *arr)
+ intp n, int NPY_UNUSED(swap), PyArrayObject *arr)
{
if (src != NULL && arr != NULL) {
int itemsize = arr->descr->elsize;
@@ -1422,7 +1442,7 @@ UNICODE_copyswapn (char *dst, intp dstride, char *src, intp sstride,
static void
-STRING_copyswap (char *dst, char *src, int swap, PyArrayObject *arr)
+STRING_copyswap(char *dst, char *src, int NPY_UNUSED(swap), PyArrayObject *arr)
{
if (src != NULL && arr != NULL) {
memcpy(dst, src, arr->descr->elsize);
@@ -1633,7 +1653,7 @@ VOID_nonzero (char *ip, PyArrayObject *ap)
/****************** compare **********************************/
static int
-BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *ap)
+BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *NPY_UNUSED(ap))
{
return (*ip1 ? (*ip2 ? 0 : 1) : (*ip2 ? -1 : 0));
}
@@ -1644,7 +1664,7 @@ BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *ap)
*/
static int
-@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap)
+@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *NPY_UNUSED(ap))
{
return *ip1 < *ip2 ? -1 : *ip1 == *ip2 ? 0 : 1;
}
@@ -1658,7 +1678,7 @@ static int
*/
static int
-@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap)
+@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *NPY_UNUSED(ap))
{
if (*ip1 == *ip2) {
return ip1[1]<ip2[1] ? -1 : (ip1[1] == ip2[1] ? 0 : 1);
@@ -1670,7 +1690,7 @@ static int
/**end repeat**/
static int
-OBJECT_compare(PyObject **ip1, PyObject **ip2, PyArrayObject *ap)
+OBJECT_compare(PyObject **ip1, PyObject **ip2, PyArrayObject *NPY_UNUSED(ap))
{
if ((*ip1 == NULL) || (*ip2 == NULL)) {
if (ip1 == ip2) return 1;
@@ -1795,7 +1815,7 @@ finish:
*/
static int
-@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip)
+@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip))
{
register intp i;
@type@ mp=*ip;
@@ -1813,7 +1833,7 @@ static int
/**end repeat**/
static int
-OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *aip)
+OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip))
{
register intp i;
PyObject *mp=ip[0]; *max_ind=0;
@@ -1865,7 +1885,7 @@ static int
static void
BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
- void *ignore)
+ void *NPY_UNUSED(ignore))
{
register Bool tmp=FALSE;
register intp i;
@@ -1885,7 +1905,7 @@ BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
*/
static void
@name@_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
- void *ignore)
+ void *NPY_UNUSED(ignore))
{
register @out@ tmp=(@out@)0;
register intp i;
@@ -1903,7 +1923,7 @@ static void
#type= float, double, longdouble#
*/
static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2,
- char *op, intp n, void *ignore)
+ char *op, intp n, void *NPY_UNUSED(ignore))
{
@type@ tmpr=(@type@)0.0, tmpi=(@type@)0.0;
intp i;
@@ -1920,7 +1940,7 @@ static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2,
static void
OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
- void *ignore)
+ void *NPY_UNUSED(ignore))
{
intp i;
PyObject *tmp1, *tmp2, *tmp=NULL;
@@ -1955,7 +1975,7 @@ OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
/* this requires buffer to be filled with objects or NULL */
static void
-OBJECT_fill(PyObject **buffer, intp length, void *ignored)
+OBJECT_fill(PyObject **buffer, intp length, void *NPY_UNUSED(ignored))
{
intp i;
PyObject *start = buffer[0];
@@ -1983,7 +2003,7 @@ finish:
#typ=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble#
*/
static void
-@NAME@_fill(@typ@ *buffer, intp length, void *ignored)
+@NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignored))
{
register intp i;
@typ@ start = buffer[0];
@@ -2000,7 +2020,7 @@ static void
#typ=cfloat,cdouble,clongdouble#
*/
static void
-@NAME@_fill(@typ@ *buffer, intp length, void *ignored)
+@NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignore))
{
register intp i;
@typ@ start;
@@ -2023,7 +2043,7 @@ static void
/* this requires buffer to be filled with objects or NULL */
static void
-OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *ignored)
+OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *NPY_UNUSED(ignored))
{
intp i;
PyObject *val = *value;
@@ -2038,7 +2058,7 @@ OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *ig
#typ=Bool,byte,ubyte#
*/
static void
-@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *ignored)
+@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored))
{
memset(buffer, *value, length);
}
@@ -2049,7 +2069,7 @@ static void
#typ=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble,cfloat,cdouble,clongdouble#
*/
static void
-@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *ignored)
+@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored))
{
register intp i;
@typ@ val = *value;
diff --git a/numpy/core/src/math_c99.inc.src b/numpy/core/src/math_c99.inc.src
new file mode 100644
index 000000000..14399f699
--- /dev/null
+++ b/numpy/core/src/math_c99.inc.src
@@ -0,0 +1,264 @@
+/*
+ * vim:syntax=c
+ * A small module to implement missing C99 math capabilities required by numpy
+ *
+ * Please keep this independant of python !
+ */
+
+/*
+ *****************************************************************************
+ ** BASIC MATH FUNCTIONS **
+ *****************************************************************************
+ */
+
+/* Original code by Konrad Hinsen. */
+#ifndef HAVE_EXPM1
+double expm1(double x)
+{
+ double u = exp(x);
+ if (u == 1.0) {
+ return x;
+ } else if (u-1.0 == -1.0) {
+ return -1;
+ } else {
+ return (u-1.0) * x/log(u);
+ }
+}
+#endif
+
+#ifndef HAVE_LOG1P
+double log1p(double x)
+{
+ double u = 1. + x;
+ if (u == 1.0) {
+ return x;
+ } else {
+ return log(u) * x / (u-1.);
+ }
+}
+#endif
+
+#ifndef HAVE_HYPOT
+double hypot(double x, double y)
+{
+ double yx;
+
+ x = fabs(x);
+ y = fabs(y);
+ if (x < y) {
+ double temp = x;
+ x = y;
+ y = temp;
+ }
+ if (x == 0.)
+ return 0.;
+ else {
+ yx = y/x;
+ return x*sqrt(1.+yx*yx);
+ }
+}
+#endif
+
+#ifndef HAVE_ACOSH
+double acosh(double x)
+{
+ return 2*log(sqrt((x+1.0)/2)+sqrt((x-1.0)/2));
+}
+#endif
+
+#ifndef HAVE_ASINH
+double asinh(double xx)
+{
+ double x, d;
+ int sign;
+ if (xx < 0.0) {
+ sign = -1;
+ x = -xx;
+ }
+ else {
+ sign = 1;
+ x = xx;
+ }
+ if (x > 1e8) {
+ d = x;
+ } else {
+ d = sqrt(x*x + 1);
+ }
+ return sign*log1p(x*(1.0 + x/(d+1)));
+}
+#endif
+
+#ifndef HAVE_ATANH
+static double atanh(double x)
+{
+ return 0.5*log1p(2.0*x/(1.0-x));
+}
+#endif
+
+#ifndef HAVE_RINT
+double rint(double x)
+{
+ double y, r;
+
+ y = floor(x);
+ r = x - y;
+
+ if (r > 0.5) goto rndup;
+
+ /* Round to nearest even */
+ if (r==0.5) {
+ r = y - 2.0*floor(0.5*y);
+ if (r==1.0) {
+ rndup:
+ y+=1.0;
+ }
+ }
+ return y;
+}
+#endif
+
+#ifndef HAVE_TRUNC
+double trunc(double x)
+{
+ if (x < 0) {
+ return ceil(x);
+ }
+ else {
+ return floor(x);
+ }
+
+}
+#endif
+
+/*
+ *****************************************************************************
+ ** IEEE 754 FPU HANDLING **
+ *****************************************************************************
+ */
+#if !defined(HAVE_DECL_ISNAN)
+ # define isnan(x) ((x) != (x))
+#endif
+
+/* VS 2003 with /Ox optimizes (x)-(x) to 0, which is not IEEE compliant. So we
+ * force (x) + (-x), which seems to work. */
+#if !defined(HAVE_DECL_ISFINITE)
+ # define isfinite(x) !isnan((x) + (-x))
+#endif
+
+#if !defined(HAVE_DECL_ISINF)
+#define isinf(x) (!isfinite(x) && !isnan(x))
+#endif
+
+#if !defined(HAVE_DECL_SIGNBIT)
+ #include "_signbit.c"
+ # define signbit(x) \
+ (sizeof (x) == sizeof (long double) ? signbit_ld (x) \
+ : sizeof (x) == sizeof (double) ? signbit_d (x) \
+ : signbit_f (x))
+
+static int signbit_f (float x)
+{
+ return signbit_d((double)x);
+}
+
+static int signbit_ld (long double x)
+{
+ return signbit_d((double)x);
+}
+#endif
+
+/*
+ * if C99 extensions not available then define dummy functions that use the
+ * double versions for
+ *
+ * sin, cos, tan
+ * sinh, cosh, tanh,
+ * fabs, floor, ceil, rint, trunc
+ * sqrt, log10, log, exp, expm1
+ * asin, acos, atan,
+ * asinh, acosh, atanh
+ *
+ * hypot, atan2, pow, fmod, modf
+ *
+ * We assume the above are always available in their double versions.
+ *
+ * NOTE: some facilities may be available as macro only instead of functions.
+ * For simplicity, we define our own functions and undef the macros. We could
+ * instead test for the macro, but I am lazy to do that for now.
+ */
+
+/*
+ * One value argument function
+ */
+
+/**begin repeat
+
+ #kind=(sin,cos,tan,sinh,cosh,tanh,fabs,floor,ceil,rint,trunc,sqrt,log10,log,exp,expm1,asin,acos,atan,asinh,acosh,atanh,log1p)*2#
+ #KIND=(SIN,COS,TAN,SINH,COSH,TANH,FABS,FLOOR,CEIL,RINT,TRUNC,SQRT,LOG10,LOG,EXP,EXPM1,ASIN,ACOS,ATAN,ASINH,ACOSH,ATANH,LOG1P)*2#
+ #typ=longdouble*23, float*23#
+ #c=l*23,f*23#
+ #C=L*23,F*23#
+ #TYPE=LONGDOUBLE*23, FLOAT*23#
+*/
+
+#ifndef HAVE_@KIND@@C@
+#ifdef @kind@@c@
+#undef @kind@@c@
+#endif
+@typ@ @kind@@c@(@typ@ x)
+{
+ return (@typ@) @kind@((double)x);
+}
+#endif
+/**end repeat**/
+
+/*
+ * Two values arguments function
+ */
+
+/**begin repeat
+
+ #kind=(atan2,hypot,pow,fmod)*2#
+ #KIND=(ATAN2,HYPOT,POW,FMOD)*2#
+ #typ=longdouble*4, float*4#
+ #c=l*4,f*4#
+ #C=L*4,F*4#
+ #TYPE=LONGDOUBLE*4,FLOAT*4#
+*/
+#ifndef HAVE_@KIND@@C@
+#ifdef @kind@@c@
+#undef @kind@@c@
+#endif
+@typ@ @kind@@c@(@typ@ x, @typ@ y)
+{
+ return (@typ@) @kind@((double)x, (double) y);
+}
+#endif
+/**end repeat**/
+
+/*
+ * One value - one pointer argument function
+ */
+
+/**begin repeat
+ #kind=modf*2#
+ #KIND=MODF*2#
+ #c=l,f#
+ #C=L,F#
+ #typ=longdouble, float#
+ #TYPE=LONGDOUBLE, FLOAT#
+*/
+#ifndef HAVE_@KIND@@C@
+#ifdef modf@c@
+#undef modf@c@
+#endif
+@typ@ modf@c@(@typ@ x, @typ@ *iptr)
+{
+ double nx, niptr, y;
+ nx = (double) x;
+ y = modf(nx, &niptr);
+ *iptr = (@typ@) niptr;
+ return (@typ@) y;
+}
+#endif
+/**end repeat**/
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c
index b556b3c5c..53ce89a94 100644
--- a/numpy/core/src/multiarraymodule.c
+++ b/numpy/core/src/multiarraymodule.c
@@ -515,7 +515,11 @@ _attempt_nocopy_reshape(PyArrayObject *self, int newnd, intp* newdims,
for (oi=0; oi<oldnd; oi++) op*=olddims[oi];
if (np != op) return 0; /* different total sizes; no hope */
- if (np == 0) return 1;
+
+ /* the current code does not handle 0-sized arrays, so give up */
+ if (np == 0) {
+ return 0;
+ }
oi = 0;
oj = 1;
@@ -2195,6 +2199,7 @@ PyArray_CanCoerceScalar(int thistype, int neededtype,
}
}
+/* Raises error when len(op) == 0 */
/*NUMPY_API*/
static PyArrayObject **
@@ -2208,6 +2213,9 @@ PyArray_ConvertToCommonType(PyObject *op, int *retn)
NPY_SCALARKIND scalarkind=NPY_NOSCALAR, intypekind=NPY_NOSCALAR;
*retn = n = PySequence_Length(op);
+ if (n == 0) {
+ PyErr_SetString(PyExc_ValueError, "0-length sequence.");
+ }
if (PyErr_Occurred()) {*retn = 0; return NULL;}
mps = (PyArrayObject **)PyDataMem_NEW(n*sizeof(PyArrayObject *));
@@ -2318,50 +2326,40 @@ static PyObject *
PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *ret,
NPY_CLIPMODE clipmode)
{
- intp *sizes, offset;
int n, elsize;
- intp i, m;
+ intp i;
char *ret_data;
PyArrayObject **mps, *ap;
- intp *self_data, mi;
+ PyArrayMultiIterObject *multi=NULL;
+ intp mi;
int copyret=0;
ap = NULL;
/* Convert all inputs to arrays of a common type */
+ /* Also makes them C-contiguous */
mps = PyArray_ConvertToCommonType(op, &n);
if (mps == NULL) return NULL;
- sizes = (intp *)_pya_malloc(n*sizeof(intp));
- if (sizes == NULL) goto fail;
-
- ap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)ip,
- PyArray_INTP,
- 0, 0);
- if (ap == NULL) goto fail;
-
- /* Check the dimensions of the arrays */
for(i=0; i<n; i++) {
if (mps[i] == NULL) goto fail;
- if (ap->nd < mps[i]->nd) {
- PyErr_SetString(PyExc_ValueError,
- "too many dimensions");
- goto fail;
- }
- if (!PyArray_CompareLists(ap->dimensions+(ap->nd-mps[i]->nd),
- mps[i]->dimensions, mps[i]->nd)) {
- PyErr_SetString(PyExc_ValueError,
- "array dimensions must agree");
- goto fail;
- }
- sizes[i] = PyArray_NBYTES(mps[i]);
}
+ ap = (PyArrayObject *)PyArray_FROM_OT((PyObject *)ip, NPY_INTP);
+
+ if (ap == NULL) goto fail;
+
+ /* Broadcast all arrays to each other, index array at the end. */
+ multi = (PyArrayMultiIterObject *)\
+ PyArray_MultiIterFromObjects((PyObject **)mps, n, 1, ap);
+ if (multi == NULL) goto fail;
+
+ /* Set-up return array */
if (!ret) {
Py_INCREF(mps[0]->descr);
ret = (PyArrayObject *)PyArray_NewFromDescr(ap->ob_type,
mps[0]->descr,
- ap->nd,
- ap->dimensions,
+ multi->nd,
+ multi->dimensions,
NULL, NULL, 0,
(PyObject *)ap);
}
@@ -2369,8 +2367,10 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *ret,
PyArrayObject *obj;
int flags = NPY_CARRAY | NPY_UPDATEIFCOPY | NPY_FORCECAST;
- if (PyArray_SIZE(ret) != PyArray_SIZE(ap)) {
- PyErr_SetString(PyExc_TypeError,
+ if ((PyArray_NDIM(ret) != multi->nd) ||
+ !PyArray_CompareLists(PyArray_DIMS(ret), multi->dimensions,
+ multi->nd)) {
+ PyErr_SetString(PyExc_TypeError,
"invalid shape for output array.");
ret = NULL;
goto fail;
@@ -2391,12 +2391,10 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *ret,
if (ret == NULL) goto fail;
elsize = ret->descr->elsize;
- m = PyArray_SIZE(ret);
- self_data = (intp *)ap->data;
ret_data = ret->data;
- for (i=0; i<m; i++) {
- mi = *self_data;
+ while (PyArray_MultiIter_NOTDONE(multi)) {
+ mi = *((intp *)PyArray_MultiIter_DATA(multi, n));
if (mi < 0 || mi >= n) {
switch(clipmode) {
case NPY_RAISE:
@@ -2418,17 +2416,16 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *ret,
break;
}
}
- offset = i*elsize;
- if (offset >= sizes[mi]) {offset = offset % sizes[mi]; }
- memmove(ret_data, mps[mi]->data+offset, elsize);
- ret_data += elsize; self_data++;
+ memmove(ret_data, PyArray_MultiIter_DATA(multi, mi), elsize);
+ ret_data += elsize;
+ PyArray_MultiIter_NEXT(multi);
}
PyArray_INCREF(ret);
+ Py_DECREF(multi);
for(i=0; i<n; i++) Py_XDECREF(mps[i]);
Py_DECREF(ap);
PyDataMem_FREE(mps);
- _pya_free(sizes);
if (copyret) {
PyObject *obj;
obj = ret->base;
@@ -2439,10 +2436,10 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *ret,
return (PyObject *)ret;
fail:
+ Py_XDECREF(multi);
for(i=0; i<n; i++) Py_XDECREF(mps[i]);
Py_XDECREF(ap);
PyDataMem_FREE(mps);
- _pya_free(sizes);
PyArray_XDECREF_ERR(ret);
return NULL;
}
@@ -4180,7 +4177,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
}
static PyObject *
-array_putmask(PyObject *module, PyObject *args, PyObject *kwds)
+array_putmask(PyObject *NPY_UNUSED(module), PyObject *args, PyObject *kwds)
{
PyObject *mask, *values;
PyObject *array;
@@ -4704,7 +4701,7 @@ _use_inherit(PyArray_Descr *type, PyObject *newobj, int *errflag)
new->names = conv->names;
Py_XINCREF(new->names);
}
- new->flags = conv->flags;
+ new->hasobject = conv->hasobject;
Py_DECREF(conv);
*errflag = 0;
return new;
@@ -4783,7 +4780,7 @@ _convert_from_tuple(PyObject *obj)
PyDimMem_FREE(shape.ptr);
newdescr->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));
newdescr->subarray->base = type;
- newdescr->flags = type->flags;
+ newdescr->hasobject = type->hasobject;
Py_INCREF(val);
newdescr->subarray->shape = val;
Py_XDECREF(newdescr->fields);
@@ -4873,7 +4870,7 @@ _convert_from_array_descr(PyObject *obj, int align)
"two fields with the same name");
goto fail;
}
- dtypeflags |= (conv->flags & NPY_FROM_FIELDS);
+ dtypeflags |= (conv->hasobject & NPY_FROM_FIELDS);
tup = PyTuple_New((title == NULL ? 2 : 3));
PyTuple_SET_ITEM(tup, 0, (PyObject *)conv);
if (align) {
@@ -4902,7 +4899,7 @@ _convert_from_array_descr(PyObject *obj, int align)
new->fields = fields;
new->names = nameslist;
new->elsize = totalsize;
- new->flags=dtypeflags;
+ new->hasobject=dtypeflags;
if (maxalign > 1) {
totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign;
}
@@ -4955,7 +4952,7 @@ _convert_from_list(PyObject *obj, int align)
Py_DECREF(key);
goto fail;
}
- dtypeflags |= (conv->flags & NPY_FROM_FIELDS);
+ dtypeflags |= (conv->hasobject & NPY_FROM_FIELDS);
PyTuple_SET_ITEM(tup, 0, (PyObject *)conv);
if (align) {
int _align;
@@ -4973,7 +4970,7 @@ _convert_from_list(PyObject *obj, int align)
new = PyArray_DescrNewFromType(PyArray_VOID);
new->fields = fields;
new->names = nameslist;
- new->flags=dtypeflags;
+ new->hasobject=dtypeflags;
if (maxalign > 1) {
totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign;
}
@@ -5199,7 +5196,7 @@ _convert_from_dict(PyObject *obj, int align)
}
Py_DECREF(tup);
if ((ret == PY_FAIL) || (newdescr->elsize == 0)) goto fail;
- dtypeflags |= (newdescr->flags & NPY_FROM_FIELDS);
+ dtypeflags |= (newdescr->hasobject & NPY_FROM_FIELDS);
totalsize += newdescr->elsize;
}
@@ -5217,7 +5214,7 @@ _convert_from_dict(PyObject *obj, int align)
}
new->names = names;
new->fields = fields;
- new->flags = dtypeflags;
+ new->hasobject = dtypeflags;
return new;
fail:
@@ -5550,7 +5547,7 @@ PyArray_ByteorderConverter(PyObject *obj, char *endian)
}
*endian = str[0];
if (str[0] != PyArray_BIG && str[0] != PyArray_LITTLE && \
- str[0] != PyArray_NATIVE) {
+ str[0] != PyArray_NATIVE && str[0] != PyArray_IGNORE) {
if (str[0] == 'b' || str[0] == 'B')
*endian = PyArray_BIG;
else if (str[0] == 'l' || str[0] == 'L')
@@ -5700,7 +5697,7 @@ _prepend_ones(PyArrayObject *arr, int nd, int ndmin)
PyArray_ISFORTRAN(op)))
static PyObject *
-_array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws)
+_array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
{
PyObject *op, *ret=NULL;
static char *kwd[]= {"object", "dtype", "copy", "order", "subok",
@@ -5819,7 +5816,7 @@ PyArray_Empty(int nd, intp *dims, PyArray_Descr *type, int fortran)
}
static PyObject *
-array_empty(PyObject *ignored, PyObject *args, PyObject *kwds)
+array_empty(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"shape","dtype","order",NULL};
@@ -5854,7 +5851,7 @@ array_empty(PyObject *ignored, PyObject *args, PyObject *kwds)
numpy scalar objects.
*/
static PyObject *
-array_scalar(PyObject *ignored, PyObject *args, PyObject *kwds)
+array_scalar(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"dtype","obj", NULL};
@@ -5938,7 +5935,7 @@ PyArray_Zeros(int nd, intp *dims, PyArray_Descr *type, int fortran)
}
static PyObject *
-array_zeros(PyObject *ignored, PyObject *args, PyObject *kwds)
+array_zeros(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {"shape","dtype","order",NULL}; /* XXX ? */
PyArray_Descr *typecode=NULL;
@@ -5969,7 +5966,7 @@ array_zeros(PyObject *ignored, PyObject *args, PyObject *kwds)
}
static PyObject *
-array_set_typeDict(PyObject *ignored, PyObject *args)
+array_set_typeDict(PyObject *NPY_UNUSED(ignored), PyObject *args)
{
PyObject *dict;
if (!PyArg_ParseTuple(args, "O", &dict)) return NULL;
@@ -6005,7 +6002,7 @@ fromstr_next_element(char **s, void *dptr, PyArray_Descr *dtype,
static int
fromfile_next_element(FILE **fp, void *dptr, PyArray_Descr *dtype,
- void *stream_data)
+ void *NPY_UNUSED(stream_data))
{
/* the NULL argument is for backwards-compatibility */
return dtype->f->scanfunc(*fp, dptr, NULL, dtype);
@@ -6098,7 +6095,7 @@ fromstr_skip_separator(char **s, const char *sep, const char *end)
}
static int
-fromfile_skip_separator(FILE **fp, const char *sep, void *stream_data)
+fromfile_skip_separator(FILE **fp, const char *sep, void *NPY_UNUSED(stream_data))
{
int result = 0;
const char *sep_start = sep;
@@ -6310,7 +6307,7 @@ PyArray_FromString(char *data, intp slen, PyArray_Descr *dtype,
}
static PyObject *
-array_fromstring(PyObject *ignored, PyObject *args, PyObject *keywds)
+array_fromstring(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
{
char *data;
Py_ssize_t nin=-1;
@@ -6443,7 +6440,7 @@ PyArray_FromFile(FILE *fp, PyArray_Descr *dtype, intp num, char *sep)
}
static PyObject *
-array_fromfile(PyObject *ignored, PyObject *args, PyObject *keywds)
+array_fromfile(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
{
PyObject *file=NULL, *ret;
FILE *fp;
@@ -6582,7 +6579,7 @@ PyArray_FromIter(PyObject *obj, PyArray_Descr *dtype, intp count)
}
static PyObject *
-array_fromiter(PyObject *ignored, PyObject *args, PyObject *keywds)
+array_fromiter(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
{
PyObject *iter;
Py_ssize_t nin=-1;
@@ -6701,7 +6698,7 @@ PyArray_FromBuffer(PyObject *buf, PyArray_Descr *type,
}
static PyObject *
-array_frombuffer(PyObject *ignored, PyObject *args, PyObject *keywds)
+array_frombuffer(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
{
PyObject *obj=NULL;
Py_ssize_t nin=-1, offset=0;
@@ -6724,7 +6721,7 @@ array_frombuffer(PyObject *ignored, PyObject *args, PyObject *keywds)
}
static PyObject *
-array_concatenate(PyObject *dummy, PyObject *args, PyObject *kwds)
+array_concatenate(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyObject *a0;
int axis=0;
@@ -6737,7 +6734,7 @@ array_concatenate(PyObject *dummy, PyObject *args, PyObject *kwds)
return PyArray_Concatenate(a0, axis);
}
-static PyObject *array_innerproduct(PyObject *dummy, PyObject *args) {
+static PyObject *array_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) {
PyObject *b0, *a0;
if (!PyArg_ParseTuple(args, "OO", &a0, &b0)) return NULL;
@@ -6745,7 +6742,7 @@ static PyObject *array_innerproduct(PyObject *dummy, PyObject *args) {
return _ARET(PyArray_InnerProduct(a0, b0));
}
-static PyObject *array_matrixproduct(PyObject *dummy, PyObject *args) {
+static PyObject *array_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) {
PyObject *v, *a;
if (!PyArg_ParseTuple(args, "OO", &a, &v)) return NULL;
@@ -6753,7 +6750,7 @@ static PyObject *array_matrixproduct(PyObject *dummy, PyObject *args) {
return _ARET(PyArray_MatrixProduct(a, v));
}
-static PyObject *array_fastCopyAndTranspose(PyObject *dummy, PyObject *args) {
+static PyObject *array_fastCopyAndTranspose(PyObject *NPY_UNUSED(dummy), PyObject *args) {
PyObject *a0;
if (!PyArg_ParseTuple(args, "O", &a0)) return NULL;
@@ -6761,7 +6758,7 @@ static PyObject *array_fastCopyAndTranspose(PyObject *dummy, PyObject *args) {
return _ARET(PyArray_CopyAndTranspose(a0));
}
-static PyObject *array_correlate(PyObject *dummy, PyObject *args, PyObject *kwds) {
+static PyObject *array_correlate(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) {
PyObject *shape, *a0;
int mode=0;
static char *kwlist[] = {"a", "v", "mode", NULL};
@@ -6991,7 +6988,7 @@ PyArray_ArangeObj(PyObject *start, PyObject *stop, PyObject *step, PyArray_Descr
}
static PyObject *
-array_arange(PyObject *ignored, PyObject *args, PyObject *kws) {
+array_arange(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) {
PyObject *o_start=NULL, *o_stop=NULL, *o_step=NULL;
static char *kwd[]= {"start", "stop", "step", "dtype", NULL};
PyArray_Descr *typecode=NULL;
@@ -7018,7 +7015,7 @@ PyArray_GetNDArrayCVersion(void)
}
static PyObject *
-array__get_ndarray_c_version(PyObject *dummy, PyObject *args, PyObject *kwds)
+array__get_ndarray_c_version(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {NULL};
if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist )) return NULL;
@@ -7027,7 +7024,7 @@ array__get_ndarray_c_version(PyObject *dummy, PyObject *args, PyObject *kwds)
}
static PyObject *
-array__reconstruct(PyObject *dummy, PyObject *args)
+array__reconstruct(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyObject *ret;
@@ -7059,7 +7056,7 @@ array__reconstruct(PyObject *dummy, PyObject *args)
}
static PyObject *
-array_set_string_function(PyObject *dummy, PyObject *args, PyObject *kwds)
+array_set_string_function(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyObject *op=NULL;
int repr=1;
@@ -7081,7 +7078,7 @@ array_set_string_function(PyObject *dummy, PyObject *args, PyObject *kwds)
}
static PyObject *
-array_set_ops_function(PyObject *self, PyObject *args, PyObject *kwds)
+array_set_ops_function(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *kwds)
{
PyObject *oldops=NULL;
@@ -7148,7 +7145,7 @@ PyArray_Where(PyObject *condition, PyObject *x, PyObject *y)
}
static PyObject *
-array_where(PyObject *ignored, PyObject *args)
+array_where(PyObject *NPY_UNUSED(ignored), PyObject *args)
{
PyObject *obj=NULL, *x=NULL, *y=NULL;
@@ -7158,7 +7155,7 @@ array_where(PyObject *ignored, PyObject *args)
}
static PyObject *
-array_lexsort(PyObject *ignored, PyObject *args, PyObject *kwds)
+array_lexsort(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
{
int axis=-1;
PyObject *obj;
@@ -7173,7 +7170,7 @@ array_lexsort(PyObject *ignored, PyObject *args, PyObject *kwds)
#undef _ARET
static PyObject *
-array_can_cast_safely(PyObject *dummy, PyObject *args, PyObject *kwds)
+array_can_cast_safely(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyArray_Descr *d1=NULL;
PyArray_Descr *d2=NULL;
@@ -7204,7 +7201,7 @@ array_can_cast_safely(PyObject *dummy, PyObject *args, PyObject *kwds)
}
static PyObject *
-new_buffer(PyObject *dummy, PyObject *args)
+new_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
int size;
@@ -7215,7 +7212,7 @@ new_buffer(PyObject *dummy, PyObject *args)
}
static PyObject *
-buffer_buffer(PyObject *dummy, PyObject *args, PyObject *kwds)
+buffer_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyObject *obj;
Py_ssize_t offset=0, size=Py_END_OF_BUFFER, n;
@@ -7261,7 +7258,7 @@ _SigSegv_Handler(int signum)
}
static PyObject *
-as_buffer(PyObject *dummy, PyObject *args, PyObject *kwds)
+as_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyObject *mem;
Py_ssize_t size;
@@ -7318,7 +7315,7 @@ as_buffer(PyObject *dummy, PyObject *args, PyObject *kwds)
#undef _test_code
static PyObject *
-format_longfloat(PyObject *dummy, PyObject *args, PyObject *kwds)
+format_longfloat(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyObject *obj;
unsigned int precision;
@@ -7343,7 +7340,7 @@ format_longfloat(PyObject *dummy, PyObject *args, PyObject *kwds)
}
static PyObject *
-compare_chararrays(PyObject *dummy, PyObject *args, PyObject *kwds)
+compare_chararrays(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyObject *array;
PyObject *other;
@@ -7444,7 +7441,7 @@ _PyArray_GetSigintBuf(void)
static PyObject *
-test_interrupt(PyObject *self, PyObject *args)
+test_interrupt(PyObject *NPY_UNUSED(self), PyObject *args)
{
int kind=0;
int a = 0;
@@ -7534,7 +7531,7 @@ static struct PyMethodDef array_module_methods[] = {
METH_VARARGS | METH_KEYWORDS, NULL},
{"test_interrupt", (PyCFunction)test_interrupt,
METH_VARARGS, NULL},
- {NULL, NULL, 0} /* sentinel */
+ {NULL, NULL, 0, NULL} /* sentinel */
};
#include "__multiarray_api.c"
@@ -7549,7 +7546,7 @@ static struct PyMethodDef array_module_methods[] = {
Thus, we call PyType_Ready on the standard Python Types, here.
*/
static int
-setup_scalartypes(PyObject *dict)
+setup_scalartypes(PyObject *NPY_UNUSED(dict))
{
initialize_numeric_types();
diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src
index b6089d0cb..dd86678a3 100644
--- a/numpy/core/src/scalarmathmodule.c.src
+++ b/numpy/core/src/scalarmathmodule.c.src
@@ -14,6 +14,7 @@
/** numarray adapted routines.... **/
+#if SIZEOF_LONGLONG == 64 || SIZEOF_LONGLONG == 128
static int ulonglong_overflow(ulonglong a, ulonglong b)
{
ulonglong ah, al, bh, bl, w, x, y, z;
@@ -50,6 +51,12 @@ static int ulonglong_overflow(ulonglong a, ulonglong b)
#endif
}
+#else
+static int ulonglong_overflow(ulonglong NPY_UNUSED(a), ulonglong NPY_UNUSED(b))
+{
+ return 0;
+}
+#endif
static int slonglong_overflow(longlong a0, longlong b0)
{
@@ -524,6 +531,13 @@ _@name@_convert_to_ctype(PyObject *a, @name@ *arg1)
return -2;
}
+/**end repeat**/
+
+
+/**begin repeat
+ #name=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,cfloat,cdouble#
+**/
+
static int
_@name@_convert2_to_ctypes(PyObject *a, @name@ *arg1,
PyObject *b, @name@ *arg2)
@@ -539,6 +553,27 @@ _@name@_convert2_to_ctypes(PyObject *a, @name@ *arg1,
/**end repeat**/
/**begin repeat
+ #name=longdouble, clongdouble#
+**/
+
+static int
+_@name@_convert2_to_ctypes(PyObject *a, @name@ *arg1,
+ PyObject *b, @name@ *arg2)
+{
+ int ret;
+ ret = _@name@_convert_to_ctype(a, arg1);
+ if (ret < 0) return ret;
+ ret = _@name@_convert_to_ctype(b, arg2);
+ if (ret == -2) ret = -3;
+ if (ret < 0) return ret;
+ return 0;
+}
+
+/**end repeat**/
+
+
+
+/**begin repeat
#name=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong)*13, (float, double, longdouble, cfloat, cdouble, clongdouble)*6, (float, double, longdouble)*2#
#Name=(Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong)*13, (Float, Double, LongDouble, CFloat, CDouble, CLongDouble)*6, (Float, Double, LongDouble)*2#
#oper=add*10, subtract*10, multiply*10, divide*10, remainder*10, divmod*10, floor_divide*10, lshift*10, rshift*10, and*10, or*10, xor*10, true_divide*10, add*6, subtract*6, multiply*6, divide*6, floor_divide*6, true_divide*6, divmod*3, remainder*3#
@@ -569,10 +604,14 @@ static PyObject *
break;
case -1: /* one of them can't be cast safely
must be mixed-types*/
- return PyArray_Type.tp_as_number->nb_@oper@(a,b);
+ return PyArray_Type.tp_as_number->nb_@oper@(a,b);
case -2: /* use default handling */
if (PyErr_Occurred()) return NULL;
return PyGenericArrType_Type.tp_as_number->nb_@oper@(a,b);
+ case -3: /* special case for longdouble and clongdouble
+ because they have a recursive getitem in their dtype */
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
}
#if @fperr@
@@ -633,7 +672,7 @@ static PyObject *
**/
static PyObject *
-@name@_power(PyObject *a, PyObject *b, PyObject *c)
+@name@_power(PyObject *a, PyObject *b, PyObject *NPY_UNUSED(c))
{
PyObject *ret;
@name@ arg1, arg2;
@@ -658,6 +697,10 @@ static PyObject *
case -2: /* use default handling */
if (PyErr_Occurred()) return NULL;
return PyGenericArrType_Type.tp_as_number->nb_power(a,b,NULL);
+ case -3: /* special case for longdouble and clongdouble
+ because they have a recursive getitem in their dtype */
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
}
PyUFunc_clearfperr();
@@ -887,6 +930,10 @@ static PyObject*
case -2: /* use ufunc */
if (PyErr_Occurred()) return NULL;
return PyGenericArrType_Type.tp_richcompare(self, other, cmp_op);
+ case -3: /* special case for longdouble and clongdouble
+ because they have a recursive getitem in their dtype */
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
}
/* here we do the actual calculation with arg1 and arg2 */
@@ -1077,7 +1124,7 @@ static void *saved_tables[9];
char doc_alterpyscalars[] = "";
static PyObject *
-alter_pyscalars(PyObject *dummy, PyObject *args)
+alter_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
int n;
PyObject *obj;
@@ -1112,7 +1159,7 @@ alter_pyscalars(PyObject *dummy, PyObject *args)
char doc_restorepyscalars[] = "";
static PyObject *
-restore_pyscalars(PyObject *dummy, PyObject *args)
+restore_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
int n;
PyObject *obj;
@@ -1146,7 +1193,7 @@ restore_pyscalars(PyObject *dummy, PyObject *args)
char doc_usepythonmath[] = "";
static PyObject *
-use_pythonmath(PyObject *dummy, PyObject *args)
+use_pythonmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
int n;
PyObject *obj;
@@ -1180,7 +1227,7 @@ use_pythonmath(PyObject *dummy, PyObject *args)
char doc_usescalarmath[] = "";
static PyObject *
-use_scalarmath(PyObject *dummy, PyObject *args)
+use_scalarmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
int n;
PyObject *obj;
@@ -1221,7 +1268,7 @@ static struct PyMethodDef methods[] = {
METH_VARARGS, doc_usepythonmath},
{"use_scalarmath", (PyCFunction) use_scalarmath,
METH_VARARGS, doc_usescalarmath},
- {NULL, NULL, 0}
+ {NULL, NULL, 0, NULL}
};
PyMODINIT_FUNC initscalarmath(void) {
diff --git a/numpy/core/src/scalartypes.inc.src b/numpy/core/src/scalartypes.inc.src
index fd47474af..b65f7adbc 100644
--- a/numpy/core/src/scalartypes.inc.src
+++ b/numpy/core/src/scalartypes.inc.src
@@ -24,6 +24,59 @@ static PyTypeObject Py@NAME@ArrType_Type = {
0, /*ob_size*/
"numpy.@name@", /*tp_name*/
sizeof(PyObject), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ /* methods */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ 0, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
/**end repeat**/
@@ -373,7 +426,7 @@ gentype_dealloc(PyObject *v)
static PyObject *
-gentype_power(PyObject *m1, PyObject *m2, PyObject *m3)
+gentype_power(PyObject *m1, PyObject *m2, PyObject *NPY_UNUSED(m3))
{
PyObject *arr, *ret, *arg2;
char *msg="unsupported operand type(s) for ** or pow()";
@@ -770,13 +823,13 @@ gentype_richcompare(PyObject *self, PyObject *other, int cmp_op)
}
static PyObject *
-gentype_ndim_get(PyObject *self)
+gentype_ndim_get(PyObject *NPY_UNUSED(self))
{
return PyInt_FromLong(0);
}
static PyObject *
-gentype_flags_get(PyObject *self)
+gentype_flags_get(PyObject *NPY_UNUSED(self))
{
return PyArray_NewFlagsObject(NULL);
}
@@ -827,7 +880,7 @@ gentype_itemsize_get(PyObject *self)
}
static PyObject *
-gentype_size_get(PyObject *self)
+gentype_size_get(PyObject *NPY_UNUSED(self))
{
return PyInt_FromLong(1);
}
@@ -866,13 +919,13 @@ gentype_struct_get(PyObject *self)
}
static PyObject *
-gentype_priority_get(PyObject *self)
+gentype_priority_get(PyObject *NPY_UNUSED(self))
{
return PyFloat_FromDouble(NPY_SCALAR_PRIORITY);
}
static PyObject *
-gentype_shape_get(PyObject *self)
+gentype_shape_get(PyObject *NPY_UNUSED(self))
{
return PyTuple_New(0);
}
@@ -902,7 +955,7 @@ gentype_typedescr_get(PyObject *self)
static PyObject *
-gentype_base_get(PyObject *self)
+gentype_base_get(PyObject *NPY_UNUSED(self))
{
Py_INCREF(Py_None);
return Py_None;
@@ -1019,72 +1072,89 @@ static PyGetSetDef gentype_getsets[] = {
{"ndim",
(getter)gentype_ndim_get,
(setter) 0,
- "number of array dimensions"},
+ "number of array dimensions",
+ NULL},
{"flags",
(getter)gentype_flags_get,
(setter)0,
- "integer value of flags"},
+ "integer value of flags",
+ NULL},
{"shape",
(getter)gentype_shape_get,
(setter)0,
- "tuple of array dimensions"},
+ "tuple of array dimensions",
+ NULL},
{"strides",
(getter)gentype_shape_get,
(setter) 0,
- "tuple of bytes steps in each dimension"},
+ "tuple of bytes steps in each dimension",
+ NULL},
{"data",
(getter)gentype_data_get,
(setter) 0,
- "pointer to start of data"},
+ "pointer to start of data",
+ NULL},
{"itemsize",
(getter)gentype_itemsize_get,
(setter)0,
- "length of one element in bytes"},
+ "length of one element in bytes",
+ NULL},
{"size",
(getter)gentype_size_get,
(setter)0,
- "number of elements in the gentype"},
+ "number of elements in the gentype",
+ NULL},
{"nbytes",
(getter)gentype_itemsize_get,
(setter)0,
- "length of item in bytes"},
+ "length of item in bytes",
+ NULL},
{"base",
(getter)gentype_base_get,
(setter)0,
- "base object"},
+ "base object",
+ NULL},
{"dtype",
(getter)gentype_typedescr_get,
NULL,
- "get array data-descriptor"},
+ "get array data-descriptor",
+ NULL},
{"real",
(getter)gentype_real_get,
(setter)0,
- "real part of scalar"},
+ "real part of scalar",
+ NULL},
{"imag",
(getter)gentype_imag_get,
(setter)0,
- "imaginary part of scalar"},
+ "imaginary part of scalar",
+ NULL},
{"flat",
(getter)gentype_flat_get,
(setter)0,
- "a 1-d view of scalar"},
+ "a 1-d view of scalar",
+ NULL},
{"T",
(getter)gentype_transpose_get,
(setter)0,
- "transpose"},
+ "transpose",
+ NULL},
{"__array_interface__",
(getter)gentype_interface_get,
NULL,
- "Array protocol: Python side"},
+ "Array protocol: Python side",
+ NULL},
{"__array_struct__",
(getter)gentype_struct_get,
NULL,
- "Array protocol: struct"},
+ "Array protocol: struct",
+ NULL},
{"__array_priority__",
(getter)gentype_priority_get,
NULL,
- "Array priority."},
- {NULL, NULL, NULL, NULL} /* Sentinel */
+ "Array priority.",
+ NULL},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
@@ -1110,7 +1180,7 @@ gentype_getarray(PyObject *scalar, PyObject *args)
static char doc_sc_wraparray[] = "sc.__array_wrap__(obj) return scalar from array";
static PyObject *
-gentype_wraparray(PyObject *scalar, PyObject *args)
+gentype_wraparray(PyObject *NPY_UNUSED(scalar), PyObject *args)
{
PyObject *arr;
@@ -1143,7 +1213,7 @@ gentype_@name@(PyObject *self, PyObject *args)
/**end repeat**/
static PyObject *
-gentype_itemset(PyObject *self, PyObject *args)
+gentype_itemset(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args))
{
PyErr_SetString(PyExc_ValueError, "array-scalars are immutable");
return NULL;
@@ -1230,7 +1300,7 @@ voidtype_getfield(PyVoidScalarObject *self, PyObject *args, PyObject *kwds)
}
static PyObject *
-gentype_setfield(PyObject *self, PyObject *args, PyObject *kwds)
+gentype_setfield(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds))
{
PyErr_SetString(PyExc_TypeError,
"Can't set fields in a non-void array scalar.");
@@ -1296,7 +1366,7 @@ voidtype_setfield(PyVoidScalarObject *self, PyObject *args, PyObject *kwds)
static PyObject *
-gentype_reduce(PyObject *self, PyObject *args)
+gentype_reduce(PyObject *self, PyObject *NPY_UNUSED(args))
{
PyObject *ret=NULL, *obj=NULL, *mod=NULL;
const char *buffer;
@@ -1369,7 +1439,7 @@ fail:
/* ignores everything */
static PyObject *
-gentype_setstate(PyObject *self, PyObject *args)
+gentype_setstate(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args))
{
Py_INCREF(Py_None);
return (Py_None);
@@ -1400,7 +1470,7 @@ gentype_dumps(PyObject *self, PyObject *args)
/* setting flags cannot be done for scalars */
static PyObject *
-gentype_setflags(PyObject *self, PyObject *args, PyObject *kwds)
+gentype_setflags(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds))
{
Py_INCREF(Py_None);
return Py_None;
@@ -1574,7 +1644,7 @@ static PyMethodDef gentype_methods[] = {
{"newbyteorder",
(PyCFunction)gentype_newbyteorder,
METH_VARARGS, NULL},
- {NULL, NULL} /* sentinel */
+ {NULL, NULL, 0, NULL} /* sentinel */
};
@@ -1582,12 +1652,14 @@ static PyGetSetDef voidtype_getsets[] = {
{"flags",
(getter)voidtype_flags_get,
(setter)0,
- "integer value of flags"},
+ "integer value of flags",
+ NULL},
{"dtype",
(getter)voidtype_dtypedescr_get,
(setter)0,
- "dtype object"},
- {NULL, NULL}
+ "dtype object",
+ NULL},
+ {NULL, NULL, NULL, NULL, NULL}
};
static PyMethodDef voidtype_methods[] = {
@@ -1597,7 +1669,7 @@ static PyMethodDef voidtype_methods[] = {
{"setfield",
(PyCFunction)voidtype_setfield,
METH_VARARGS | METH_KEYWORDS, NULL},
- {NULL, NULL}
+ {NULL, NULL, 0, NULL}
};
/************* As_mapping functions for void array scalar ************/
@@ -1757,15 +1829,19 @@ static PySequenceMethods voidtype_as_sequence = {
0, /*sq_repeat*/
(ssizeargfunc)voidtype_item, /*sq_item*/
0, /*sq_slice*/
- (ssizeobjargproc)voidtype_ass_item /*sq_ass_item*/
+ (ssizeobjargproc)voidtype_ass_item, /*sq_ass_item*/
#else
(inquiry)voidtype_length, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
(intargfunc)voidtype_item, /*sq_item*/
0, /*sq_slice*/
- (intobjargproc)voidtype_ass_item /*sq_ass_item*/
+ (intobjargproc)voidtype_ass_item, /*sq_ass_item*/
#endif
+ 0, /* ssq_ass_slice */
+ 0, /* sq_contains */
+ 0, /* sq_inplace_concat */
+ 0, /* sq_inplace_repeat */
};
@@ -1844,6 +1920,59 @@ static PyTypeObject PyGenericArrType_Type = {
0, /*ob_size*/
"numpy.generic", /*tp_name*/
sizeof(PyObject), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ /* methods */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ 0, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
static void
@@ -1889,18 +2018,28 @@ object_arrtype_dealloc(PyObject *v)
/**begin repeat1
#name=byte, short, int, long, longlong, ubyte, ushort, uint, ulong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, object#
#TYPE=BYTE, SHORT, INT, LONG, LONGLONG, UBYTE, USHORT, UINT, ULONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, OBJECT#
-#work=0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,1#
+#work=0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,0#
#default=0*16,1*2,2#
*/
+
+#define _NPY_UNUSED2_1
+#define _NPY_UNUSED2_z
+#define _NPY_UNUSED2_0 NPY_UNUSED
+#define _NPY_UNUSED1_0
+#define _NPY_UNUSED1_1
+#define _NPY_UNUSED1_2 NPY_UNUSED
+
static PyObject *
-@name@_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+@name@_arrtype_new(PyTypeObject *_NPY_UNUSED1_@default@(type), PyObject *args, PyObject *_NPY_UNUSED2_@work@(kwds))
{
PyObject *obj = NULL;
PyObject *robj;
PyObject *arr;
PyArray_Descr *typecode = NULL;
+#if !(@default@ == 2)
int itemsize;
void *dest, *src;
+#endif
/* allow base-class (if any) to do conversion */
/* If successful, this will jump to finish: */
@@ -1923,13 +2062,16 @@ static PyObject *
#elif @default@ == 1
robj = PyArray_Scalar(NULL, typecode, NULL);
#elif @default@ == 2
- obj = Py_None;
- robj = PyArray_Scalar(&obj, typecode, NULL);
+ Py_INCREF(Py_None);
+ robj = Py_None;
#endif
Py_DECREF(typecode);
goto finish;
}
+ /* It is expected at this point that robj is a PyArrayScalar
+ (even for Object Data Type)
+ */
arr = PyArray_FromAny(obj, typecode, 0, 0, FORCECAST, NULL);
if ((arr == NULL) || (PyArray_NDIM(arr) > 0)) {
return arr;
@@ -1939,6 +2081,13 @@ static PyObject *
Py_DECREF(arr);
finish:
+
+#if @default@ == 2 /* In OBJECT case, robj is no longer a
+ PyArrayScalar at this point but the
+ remaining code assumes it is
+ */
+ return robj;
+#else
/* Normal return */
if ((robj == NULL) || (robj->ob_type == type)) {
return robj;
@@ -1972,12 +2121,11 @@ finish:
itemsize = ((PyUnicodeObject *)robj)->length * sizeof(Py_UNICODE);
}
memcpy(dest, src, itemsize);
-#elif @default@ == 2 /* Object arrays */
- memcpy(dest, src, sizeof(void *));
- Py_INCREF(*((PyObject **)dest));
+ /* @default@ == 2 won't get here */
#endif
Py_DECREF(robj);
return obj;
+#endif
}
/**end repeat**/
@@ -1988,7 +2136,7 @@ finish:
/* bool->tp_new only returns Py_True or Py_False */
static PyObject *
-bool_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+bool_arrtype_new(PyTypeObject *NPY_UNUSED(type), PyObject *args, PyObject *NPY_UNUSED(kwds))
{
PyObject *obj=NULL;
PyObject *arr;
@@ -2081,10 +2229,36 @@ static PyNumberMethods bool_arrtype_as_number = {
(binaryfunc)bool_arrtype_and, /* nb_and */
(binaryfunc)bool_arrtype_xor, /* nb_xor */
(binaryfunc)bool_arrtype_or, /* nb_or */
+ 0, /* nb_coerce */
+ 0, /* nb_int */
+ 0, /* nb_long */
+ 0, /* nb_float */
+ 0, /* nb_oct */
+ 0, /* nb_hex */
+ /* Added in release 2.0 */
+ 0, /* nb_inplace_add */
+ 0, /* nb_inplace_subtract */
+ 0, /* nb_inplace_multiply */
+ 0, /* nb_inplace_divide */
+ 0, /* nb_inplace_remainder */
+ 0, /* nb_inplace_power */
+ 0, /* nb_inplace_lshift */
+ 0, /* nb_inplace_rshift */
+ 0, /* nb_inplace_and */
+ 0, /* nb_inplace_xor */
+ 0, /* nb_inplace_or */
+ /* Added in release 2.2 */
+ /* The following require the Py_TPFLAGS_HAVE_CLASS flag */
+ 0, /* nb_floor_divide */
+ 0, /* nb_true_divide */
+ 0, /* nb_inplace_floor_divide */
+ 0, /* nb_inplace_true_divide */
+ /* Added in release 2.5 */
+ 0, /* nb_index */
};
static PyObject *
-void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *NPY_UNUSED(kwds))
{
PyObject *obj, *arr;
ulonglong memu=1;
@@ -2478,6 +2652,40 @@ static PyTypeObject PyObjectArrType_Type = {
(setattrofunc)object_arrtype_setattro, /* tp_setattro */
&object_arrtype_as_buffer, /* tp_as_buffer */
0, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
@@ -2538,6 +2746,57 @@ static PyTypeObject Py@NAME@ArrType_Type = {
0, /*ob_size*/
"numpy.@name@@ex@", /*tp_name*/
sizeof(Py@NAME@ScalarObject), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ 0, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
/**end repeat**/
@@ -2568,6 +2827,57 @@ static PyTypeObject Py@NAME@ArrType_Type = {
0, /*ob_size*/
"numpy.@name@" _THIS_SIZE, /*tp_name*/
sizeof(Py@NAME@ScalarObject), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ 0, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
#undef _THIS_SIZE
@@ -2631,6 +2941,39 @@ static PyTypeObject Py@NAME@ArrType_Type = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT, /*tp_flags*/
"Composed of two " _THIS_SIZE2 " bit floats", /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
#undef _THIS_SIZE1
#undef _THIS_SIZE2
diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c
index 6bc8e664f..eb48a3946 100644
--- a/numpy/core/src/ufuncobject.c
+++ b/numpy/core/src/ufuncobject.c
@@ -795,7 +795,6 @@ PyUFunc_clearfperr()
#define NOBUFFER_REDUCELOOP 2
#define BUFFER_UFUNCLOOP 3
#define BUFFER_REDUCELOOP 3
-#define SIGNATURE_NOBUFFER_UFUNCLOOP 4
static char
@@ -1260,7 +1259,7 @@ PyUFunc_GetPyValues(char *name, int *bufsize, int *errmask, PyObject **errobj)
}
/* Create copies for any arrays that are less than loop->bufsize
- in total size (or core_enabled) and are mis-behaved or in need
+ in total size and are mis-behaved or in need
of casting.
*/
@@ -1288,7 +1287,7 @@ _create_copies(PyUFuncLoopObject *loop, int *arg_types, PyArrayObject **mps)
}
Py_DECREF(atype);
}
- if (size < loop->bufsize || loop->ufunc->core_enabled) {
+ if (size < loop->bufsize) {
if (!(PyArray_ISBEHAVED_RO(mps[i])) || \
PyArray_TYPE(mps[i]) != arg_types[i]) {
ntype = PyArray_DescrFromType(arg_types[i]);
@@ -1329,280 +1328,6 @@ _has_reflected_op(PyObject *op, char *name)
#undef _GETATTR_
-
-/* Return the position of next non-white-space char in the string
-*/
-static int
-_next_non_white_space(const char* str, int offset)
-{
- int ret = offset;
- while (str[ret] == ' ' || str[ret] == '\t') ret++;
- return ret;
-}
-
-static int
-_is_alpha_underscore(char ch)
-{
- return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || ch == '_';
-}
-
-static int
-_is_alnum_underscore(char ch)
-{
- return _is_alpha_underscore(ch) || (ch >= '0' && ch <= '9');
-}
-
-/* Return the ending position of a variable name
-*/
-static int
-_get_end_of_name(const char* str, int offset)
-{
- int ret = offset;
- while (_is_alnum_underscore(str[ret])) ret++;
- return ret;
-}
-
-/* Returns 1 if the dimension names pointed by s1 and s2 are the same,
- otherwise returns 0.
-*/
-static int
-_is_same_name(const char* s1, const char* s2)
-{
- while (_is_alnum_underscore(*s1) && _is_alnum_underscore(*s2)) {
- if (*s1 != *s2) return 0;
- s1++;
- s2++;
- }
- return !_is_alnum_underscore(*s1) && !_is_alnum_underscore(*s2);
-}
-
-/* Sets core_num_dim_ix, core_num_dims, core_dim_ixs, core_offsets,
- and core_signature in PyUFuncObject "self". Returns 0 unless an
- error occured.
-*/
-static int
-_parse_signature(PyUFuncObject *self, const char *signature)
-{
- size_t len;
- char const **var_names;
- int nd = 0; /* number of dimension of the current argument */
- int cur_arg = 0; /* index into core_num_dims&core_offsets */
- int cur_core_dim = 0; /* index into core_dim_ixs */
- int i = 0;
- char *parse_error = NULL;
-
- if (signature == NULL) {
- PyErr_SetString(PyExc_RuntimeError,
- "_parse_signature with NULL signature");
- return -1;
- }
-
- len = strlen(signature);
- self->core_signature = _pya_malloc(sizeof(char) * (len+1));
- if (self->core_signature)
- strcpy(self->core_signature, signature);
-
- /* Allocate sufficient memory to store pointers to all dimension names */
- var_names = _pya_malloc(sizeof(char const*) * len);
- if (var_names == NULL) {
- PyErr_NoMemory();
- return -1;
- }
-
- self->core_enabled = 1;
- self->core_num_dim_ix = 0;
- self->core_num_dims = _pya_malloc(sizeof(int) * self->nargs);
- self->core_dim_ixs = _pya_malloc(sizeof(int) * len); /* shrink this later */
- self->core_offsets = _pya_malloc(sizeof(int) * self->nargs);
- if (self->core_num_dims == NULL || self->core_dim_ixs == NULL ||
- self->core_offsets == NULL) {
- PyErr_NoMemory();
- goto fail;
- }
-
- i = _next_non_white_space(signature, 0);
-
- while (signature[i] != '\0') { /* loop over input/output arguments */
- if (cur_arg == self->nin) {
- /* expect "->" */
- if (signature[i] != '-' || signature[i+1] != '>') {
- parse_error = "expect '->'";
- goto fail;
- }
- i = _next_non_white_space(signature, i+2);
- }
-
- /* parse core dimensions of one argument, e.g. "()", "(i)", or
- "(i,j)" */
- if (signature[i] != '(') {
- parse_error = "expect '('";
- goto fail;
- }
- i = _next_non_white_space(signature, i+1);
- while (signature[i] != ')') { /* loop over core dimensions */
- int j = 0;
- if (!_is_alpha_underscore(signature[i])) {
- parse_error = "expect dimension name";
- goto fail;
- }
- while (j < self->core_num_dim_ix) {
- if (_is_same_name(signature+i, var_names[j])) break;
- j++;
- }
- if (j >= self->core_num_dim_ix) {
- var_names[j] = signature+i;
- self->core_num_dim_ix++;
- }
- self->core_dim_ixs[cur_core_dim] = j;
- cur_core_dim++;
- nd++;
- i = _get_end_of_name(signature, i);
- i = _next_non_white_space(signature, i);
- if (signature[i] != ',' && signature[i] != ')') {
- parse_error = "expect ',' or ')'";
- goto fail;
- }
- if (signature[i] == ',')
- {
- i = _next_non_white_space(signature, i+1);
- if (signature[i] == ')') {
- parse_error = "',' must not be followed by ')'";
- goto fail;
- }
- }
- }
- self->core_num_dims[cur_arg] = nd;
- self->core_offsets[cur_arg] = cur_core_dim-nd;
- cur_arg++;
- nd = 0;
- i = _next_non_white_space(signature, i+1);
-
- if (cur_arg != self->nin && cur_arg != self->nargs) {
- /* The list of input arguments (or output arguments) was
- only read partially */
- if (signature[i] != ',') {
- parse_error = "expect ','";
- goto fail;
- }
- i = _next_non_white_space(signature, i+1);
- }
- }
- if (cur_arg != self->nargs) {
- parse_error = "incomplete signature: not all arguments found";
- goto fail;
- }
- self->core_dim_ixs = _pya_realloc(self->core_dim_ixs,
- sizeof(int) * cur_core_dim);
- /* check for trivial core-signature, e.g. "(),()->()" */
- if (cur_core_dim == 0)
- self->core_enabled = 0;
- _pya_free((void*)var_names);
- return 0;
-fail:
- _pya_free((void*)var_names);
- if (parse_error) {
- char *buf = _pya_malloc(sizeof(char) * (len + 200));
- if (buf) {
- sprintf(buf, "%s at position %d in \"%s\"",
- parse_error, i, signature);
- PyErr_SetString(PyExc_ValueError, signature);
- _pya_free(buf);
- }
- else {
- PyErr_NoMemory();
- }
- }
- return -1;
-}
-
-/* Concatenate the loop and core dimensions of
- PyArrayMultiIterObject's iarg-th argument, to recover a full
- dimension array (used for output arguments).
-*/
-static npy_intp*
-_compute_output_dims(PyUFuncLoopObject *loop, int iarg,
- int *out_nd, npy_intp *tmp_dims)
-{
- int i;
- PyUFuncObject *ufunc = loop->ufunc;
- if (ufunc->core_enabled == 0) {
- /* case of ufunc with trivial core-signature */
- *out_nd = loop->nd;
- return loop->dimensions;
- }
-
- *out_nd = loop->nd + ufunc->core_num_dims[iarg];
- if (*out_nd > NPY_MAXARGS) {
- PyErr_SetString(PyExc_ValueError,
- "dimension of output variable exceeds limit");
- return NULL;
- }
-
- /* copy loop dimensions */
- memcpy(tmp_dims, loop->dimensions, sizeof(npy_intp) * loop->nd);
-
- /* copy core dimension */
- for (i = 0; i < ufunc->core_num_dims[iarg]; i++)
- tmp_dims[loop->nd + i] = loop->core_dim_sizes[1 +
- ufunc->core_dim_ixs[ufunc->core_offsets[iarg]+i]];
- return tmp_dims;
-}
-
-/* Check and set core_dim_sizes and core_strides for the i-th argument.
-*/
-static int
-_compute_dimension_size(PyUFuncLoopObject *loop, PyArrayObject **mps, int i)
-{
- PyUFuncObject *ufunc = loop->ufunc;
- int j = ufunc->core_offsets[i];
- int k = PyArray_NDIM(mps[i]) - ufunc->core_num_dims[i];
- int ind;
- for (ind = 0; ind < ufunc->core_num_dims[i]; ind++, j++, k++) {
- npy_intp dim = k<0 ? 1 : PyArray_DIM(mps[i], k);
- /* First element of core_dim_sizes will be used for looping */
- int dim_ix = ufunc->core_dim_ixs[j] + 1;
- if (loop->core_dim_sizes[dim_ix] == 1) {
- /* broadcast core dimension */
- loop->core_dim_sizes[dim_ix] = dim;
- }
- else if (dim != 1 && dim != loop->core_dim_sizes[dim_ix]) {
- PyErr_SetString(PyExc_ValueError,
- "core dimensions mismatch");
- return -1;
- }
- /* First ufunc->nargs elements will be used for looping */
- loop->core_strides[ufunc->nargs + j] =
- dim == 1 ? 0 : PyArray_STRIDE(mps[i], k);
- }
- return 0;
-}
-
-/* Return a view of array "ap" with "core_nd" dimensions cut from tail. */
-static PyArrayObject *
-_trunc_coredim(PyArrayObject *ap, int core_nd)
-{
- PyArrayObject *ret;
- int nd = ap->nd - core_nd;
- if (nd < 0) nd = 0;
-
- /* The following code is basically taken from PyArray_Transpose */
- Py_INCREF(ap->descr); /* NewFromDescr will steal this reference */
- ret = (PyArrayObject *)
- PyArray_NewFromDescr(ap->ob_type, ap->descr,
- nd, ap->dimensions,
- ap->strides, ap->data, ap->flags,
- (PyObject *)ap);
- if (ret == NULL) return NULL;
-
- /* point at true owner of memory: */
- ret->base = (PyObject *)ap;
- Py_INCREF(ap);
-
- PyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);
-
- return ret;
-}
-
static Py_ssize_t
construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
PyObject *typetup)
@@ -1620,10 +1345,6 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
int flexible = 0;
int object = 0;
- npy_intp temp_dims[NPY_MAXDIMS];
- npy_intp *out_dims;
- int out_nd;
-
/* Check number of arguments */
nargs = PyTuple_Size(args);
if ((nargs < self->nin) || (nargs > self->nargs)) {
@@ -1706,12 +1427,15 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
* FAIL with NotImplemented if the other object has
* the __r<op>__ method and has __array_priority__ as
* an attribute (signalling it can handle ndarray's)
- * and is not already an ndarray
+ * and is not already an ndarray or a subtype of the same type.
*/
if ((arg_types[1] == PyArray_OBJECT) && \
(loop->ufunc->nin==2) && (loop->ufunc->nout == 1)) {
PyObject *_obj = PyTuple_GET_ITEM(args, 1);
- if (!PyArray_CheckExact(_obj) && \
+ if (!PyArray_CheckExact(_obj) &&
+ /* If both are same subtype of object arrays, then proceed */
+ !(_obj->ob_type == (PyTuple_GET_ITEM(args, 0))->ob_type) && \
+
PyObject_HasAttrString(_obj, "__array_priority__") && \
_has_reflected_op(_obj, loop->ufunc->name)) {
loop->notimplemented = 1;
@@ -1727,23 +1451,6 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
return -1;
}
- /* Only use loop dimensions when constructing Iterator:
- * temporarily replace mps[i] (will be recovered below).
- */
- if (self->core_enabled) {
- for (i = 0; i < self->nin; i++) {
- PyArrayObject *ao;
-
- if (_compute_dimension_size(loop, mps, i) < 0)
- return -1;
-
- ao = _trunc_coredim(mps[i], self->core_num_dims[i]);
- if (ao == NULL)
- return -1;
- mps[i] = ao;
- }
- }
-
/* Create Iterators for the Inputs */
for(i = 0; i < self->nin; i++) {
loop->iters[i] = (PyArrayIterObject *) \
@@ -1753,16 +1460,6 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
}
}
-
- /* Recover mps[i]. */
- if (self->core_enabled) {
- for (i = 0; i < self->nin; i++) {
- PyArrayObject *ao = mps[i];
- mps[i] = (PyArrayObject *)mps[i]->base;
- Py_DECREF(ao);
- }
- }
-
/* Broadcast the result */
loop->numiter = self->nin;
if (PyArray_Broadcast((PyArrayMultiIterObject *)loop) < 0) {
@@ -1794,18 +1491,9 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
return -1;
}
}
-
-
- if (self->core_enabled) {
- if (_compute_dimension_size(loop, mps, i) < 0)
- return -1;
- }
- out_dims = _compute_output_dims(loop, i, &out_nd, temp_dims);
- if (!out_dims) return -1;
-
- if (mps[i]->nd != out_nd ||
+ if (mps[i]->nd != loop->nd ||
!PyArray_CompareLists(mps[i]->dimensions,
- out_dims, out_nd)) {
+ loop->dimensions, loop->nd)) {
PyErr_SetString(PyExc_ValueError,
"invalid return array shape");
Py_DECREF(mps[i]);
@@ -1826,12 +1514,9 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
PyArray_Descr *ntype;
if (mps[i] == NULL) {
- out_dims = _compute_output_dims(loop, i, &out_nd, temp_dims);
- if (!out_dims) return -1;
-
mps[i] = (PyArrayObject *)PyArray_New(subtype,
- out_nd,
- out_dims,
+ loop->nd,
+ loop->dimensions,
arg_types[i],
NULL, NULL,
0, 0, NULL);
@@ -1858,7 +1543,7 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
/* still not the same -- or will we have to use buffers?*/
if (mps[i]->descr->type_num != arg_types[i] ||
!PyArray_ISBEHAVED_RO(mps[i])) {
- if (loop->size < loop->bufsize || self->core_enabled) {
+ if (loop->size < loop->bufsize) {
PyObject *new;
/*
* Copy the array to a temporary copy
@@ -1878,35 +1563,14 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
}
}
- if (self->core_enabled) {
- PyArrayObject *ao;
-
- /* computer for all output arguments, and set strides in "loop" */
- if (_compute_dimension_size(loop, mps, i) < 0)
- return -1;
-
- ao = _trunc_coredim(mps[i], self->core_num_dims[i]);
- if (ao == NULL)
- return -1;
- /* Temporarily modify mps[i] for constructing iterator. */
- mps[i] = ao;
- }
-
loop->iters[i] = (PyArrayIterObject *) \
PyArray_IterNew((PyObject *)mps[i]);
if (loop->iters[i] == NULL) {
return -1;
}
-
- /* Recover mps[i]. */
- if (self->core_enabled) {
- PyArrayObject *ao = mps[i];
- mps[i] = (PyArrayObject *)mps[i]->base;
- Py_DECREF(ao);
- }
-
}
+
/*
* If any of different type, or misaligned or swapped
* then must use buffers
@@ -1921,19 +1585,10 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
return nargs;
}
- if (self->core_enabled) {
- loop->meth = SIGNATURE_NOBUFFER_UFUNCLOOP;
- }
-
for(i = 0; i < self->nargs; i++) {
loop->needbuffer[i] = 0;
if (arg_types[i] != mps[i]->descr->type_num ||
!PyArray_ISBEHAVED_RO(mps[i])) {
- if (self->core_enabled) {
- PyErr_SetString(PyExc_RuntimeError,
- "never reached; copy should have been made");
- return -1;
- }
loop->meth = BUFFER_UFUNCLOOP;
loop->needbuffer[i] = 1;
}
@@ -1943,13 +1598,6 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
}
}
-
- if (self->core_enabled && loop->obj) {
- PyErr_SetString(PyExc_TypeError,
- "Object type not allowed in ufunc with signature");
- return -1;
- }
-
if (loop->meth == NO_UFUNCLOOP) {
loop->meth = ONE_UFUNCLOOP;
@@ -1977,11 +1625,8 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
loop->numiter = self->nargs;
- /* Fill in steps */
- if (loop->meth == SIGNATURE_NOBUFFER_UFUNCLOOP && loop->nd == 0) {
- /* Use default core_strides */
- }
- else if (loop->meth != ONE_UFUNCLOOP) {
+ /* Fill in steps */
+ if (loop->meth != ONE_UFUNCLOOP) {
int ldim;
intp minsum;
intp maxdim;
@@ -2050,16 +1695,6 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
}
/*
- * Set looping part of core_dim_sizes and core_strides.
- */
- if (loop->meth == SIGNATURE_NOBUFFER_UFUNCLOOP) {
- loop->core_dim_sizes[0] = maxdim;
- for (i = 0; i < self->nargs; i++) {
- loop->core_strides[i] = loop->steps[i];
- }
- }
-
- /*
* fix up steps where we will be copying data to
* buffers and calculate the ninnerloops and leftover
* values -- if step size is already zero that is not changed...
@@ -2075,8 +1710,8 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
}
}
}
- else if (loop->meth == ONE_UFUNCLOOP) {
- /* uniformly-strided case */
+ else {
+ /* uniformly-strided case ONE_UFUNCLOOP */
for(i = 0; i < self->nargs; i++) {
if (PyArray_SIZE(mps[i]) == 1)
loop->steps[i] = 0;
@@ -2215,10 +1850,6 @@ ufuncloop_dealloc(PyUFuncLoopObject *self)
int i;
if (self->ufunc != NULL) {
- if (self->core_dim_sizes)
- _pya_free(self->core_dim_sizes);
- if (self->core_strides)
- _pya_free(self->core_strides);
for(i = 0; i < self->ufunc->nargs; i++)
Py_XDECREF(self->iters[i]);
if (self->buffer[0]) {
@@ -2259,23 +1890,6 @@ construct_loop(PyUFuncObject *self, PyObject *args, PyObject *kwds, PyArrayObjec
loop->errobj = NULL;
loop->notimplemented = 0;
loop->first = 1;
- loop->core_dim_sizes = NULL;
- loop->core_strides = NULL;
-
- if (self->core_enabled) {
- int num_dim_ix = 1 + self->core_num_dim_ix;
- int nstrides = self->nargs + self->core_offsets[self->nargs-1]
- + self->core_num_dims[self->nargs-1];
- loop->core_dim_sizes = _pya_malloc(sizeof(npy_intp) * num_dim_ix);
- loop->core_strides = _pya_malloc(sizeof(npy_intp) * nstrides);
- if (loop->core_dim_sizes == NULL || loop->core_strides == NULL) {
- PyErr_NoMemory();
- goto fail;
- }
- memset(loop->core_strides, 0, sizeof(npy_intp) * nstrides);
- for (i = 0; i < num_dim_ix; i++)
- loop->core_dim_sizes[i] = 1;
- }
name = self->name ? self->name : "";
@@ -2422,11 +2036,6 @@ PyUFunc_GenericFunction(PyUFuncObject *self, PyObject *args, PyObject *kwds,
ufuncloop_dealloc(loop);
return -2;
}
- if (self->core_enabled && loop->meth != SIGNATURE_NOBUFFER_UFUNCLOOP) {
- PyErr_SetString(PyExc_RuntimeError,
- "illegal loop method for ufunc with signature");
- goto fail;
- }
NPY_LOOP_BEGIN_THREADS;
switch(loop->meth) {
@@ -2449,8 +2058,7 @@ PyUFunc_GenericFunction(PyUFuncObject *self, PyObject *args, PyObject *kwds,
* right type but not contiguous. -- Almost as fast.
*/
/*fprintf(stderr, "NOBUFFER...%d\n", loop->size);*/
-
- while (loop->index < loop->size) {
+ while (loop->index < loop->size) {
for(i = 0; i < self->nargs; i++) {
loop->bufptr[i] = loop->iters[i]->dataptr;
}
@@ -2466,23 +2074,6 @@ PyUFunc_GenericFunction(PyUFuncObject *self, PyObject *args, PyObject *kwds,
}
break;
- case SIGNATURE_NOBUFFER_UFUNCLOOP:
- while (loop->index < loop->size) {
- for(i = 0; i < self->nargs; i++) {
- loop->bufptr[i] = loop->iters[i]->dataptr;
- }
- loop->function((char **)loop->bufptr, loop->core_dim_sizes,
- loop->core_strides, loop->funcdata);
- UFUNC_CHECK_ERROR(loop);
-
- /* Adjust loop pointers */
- for(i = 0; i < self->nargs; i++) {
- PyArray_ITER_NEXT(loop->iters[i]);
- }
- loop->index++;
- }
- break;
-
case BUFFER_UFUNCLOOP: {
PyArray_CopySwapNFunc *copyswapn[NPY_MAXARGS];
PyArrayIterObject **iters=loop->iters;
@@ -2809,12 +2400,6 @@ construct_reduce(PyUFuncObject *self, PyArrayObject **arr, PyArrayObject *out,
/* Reduce type is the type requested of the input
during reduction */
- if (self->core_enabled) {
- PyErr_Format(PyExc_RuntimeError,
- "construct_reduce not allowed on ufunc with signature");
- return NULL;
- }
-
nd = (*arr)->nd;
arg_types[0] = otype;
arg_types[1] = otype;
@@ -3533,12 +3118,6 @@ PyUFunc_GenericReduction(PyUFuncObject *self, PyObject *args,
return NULL;
}
- if (self->core_enabled) {
- PyErr_Format(PyExc_RuntimeError,
- "Reduction not defined on ufunc with signature");
- return NULL;
- }
-
if (self->nin != 2) {
PyErr_Format(PyExc_ValueError,
"%s only supported for binary functions",
@@ -3921,7 +3500,7 @@ fail:
}
static PyObject *
-ufunc_geterr(PyObject *dummy, PyObject *args)
+ufunc_geterr(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyObject *thedict;
PyObject *res;
@@ -3984,7 +3563,7 @@ ufunc_update_use_defaults(void)
#endif
static PyObject *
-ufunc_seterr(PyObject *dummy, PyObject *args)
+ufunc_seterr(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyObject *thedict;
int res;
@@ -4021,7 +3600,7 @@ static char
doc_frompyfunc[] = "frompyfunc(func, nin, nout) take an arbitrary python function that takes nin objects as input and returns nout objects and return a universal function (ufunc). This ufunc always returns PyObject arrays";
static PyObject *
-ufunc_frompyfunc(PyObject *dummy, PyObject *args, PyObject *kwds) {
+ufunc_frompyfunc(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *NPY_UNUSED(kwds)) {
/* Keywords are ignored for now */
PyObject *function, *pyname=NULL;
@@ -4053,14 +3632,6 @@ ufunc_frompyfunc(PyObject *dummy, PyObject *args, PyObject *kwds) {
self->ntypes = 1;
self->check_return = 0;
- /* generalized ufunc */
- self->core_enabled = 0;
- self->core_num_dim_ix = 0;
- self->core_num_dims = NULL;
- self->core_dim_ixs = NULL;
- self->core_offsets = NULL;
- self->core_signature = NULL;
-
pyname = PyObject_GetAttrString(function, "__name__");
if (pyname)
(void) PyString_AsStringAndSize(pyname, &fname, &fname_len);
@@ -4154,18 +3725,6 @@ PyUFunc_FromFuncAndData(PyUFuncGenericFunction *func, void **data,
int nin, int nout, int identity,
char *name, char *doc, int check_return)
{
- return PyUFunc_FromFuncAndDataAndSignature(func, data, types, ntypes,
- nin, nout, identity, name, doc, check_return, NULL);
-}
-
-/*UFUNC_API*/
-static PyObject *
-PyUFunc_FromFuncAndDataAndSignature(PyUFuncGenericFunction *func, void **data,
- char *types, int ntypes,
- int nin, int nout, int identity,
- char *name, char *doc,
- int check_return, const char *signature)
-{
PyUFuncObject *self;
self = _pya_malloc(sizeof(PyUFuncObject));
@@ -4192,18 +3751,6 @@ PyUFunc_FromFuncAndDataAndSignature(PyUFuncGenericFunction *func, void **data,
if (doc == NULL) self->doc = "NULL";
else self->doc = doc;
- /* generalized ufunc */
- self->core_enabled = 0;
- self->core_num_dim_ix = 0;
- self->core_num_dims = NULL;
- self->core_dim_ixs = NULL;
- self->core_offsets = NULL;
- self->core_signature = NULL;
- if (signature != NULL) {
- if (_parse_signature(self, signature) != 0)
- return NULL;
- }
-
return (PyObject *)self;
}
@@ -4368,10 +3915,6 @@ PyUFunc_RegisterLoopForType(PyUFuncObject *ufunc,
static void
ufunc_dealloc(PyUFuncObject *self)
{
- if (self->core_num_dims) _pya_free(self->core_num_dims);
- if (self->core_dim_ixs) _pya_free(self->core_dim_ixs);
- if (self->core_offsets) _pya_free(self->core_offsets);
- if (self->core_signature) _pya_free(self->core_signature);
if (self->ptr) _pya_free(self->ptr);
Py_XDECREF(self->userloops);
Py_XDECREF(self->obj);
@@ -4406,13 +3949,6 @@ ufunc_outer(PyUFuncObject *self, PyObject *args, PyObject *kwds)
PyObject *new_args, *tmp;
PyObject *shape1, *shape2, *newshape;
- if (self->core_enabled) {
- PyErr_Format(PyExc_TypeError,
- "method outer is not allowed in ufunc with non-trivial"\
- " signature");
- return NULL;
- }
-
if(self->nin != 2) {
PyErr_SetString(PyExc_ValueError,
"outer product only supported "\
@@ -4498,13 +4034,13 @@ ufunc_reduceat(PyUFuncObject *self, PyObject *args, PyObject *kwds)
static struct PyMethodDef ufunc_methods[] = {
- {"reduce", (PyCFunction)ufunc_reduce, METH_VARARGS | METH_KEYWORDS },
+ {"reduce", (PyCFunction)ufunc_reduce, METH_VARARGS | METH_KEYWORDS, NULL },
{"accumulate", (PyCFunction)ufunc_accumulate,
- METH_VARARGS | METH_KEYWORDS },
+ METH_VARARGS | METH_KEYWORDS, NULL },
{"reduceat", (PyCFunction)ufunc_reduceat,
- METH_VARARGS | METH_KEYWORDS },
- {"outer", (PyCFunction)ufunc_outer, METH_VARARGS | METH_KEYWORDS },
- {NULL, NULL} /* sentinel */
+ METH_VARARGS | METH_KEYWORDS, NULL },
+ {"outer", (PyCFunction)ufunc_outer, METH_VARARGS | METH_KEYWORDS, NULL},
+ {NULL, NULL, 0, NULL} /* sentinel */
};
@@ -4513,19 +4049,20 @@ static struct PyMethodDef ufunc_methods[] = {
y1,y2,...,yn
*/
static PyObject *
-_makeargs(int num, char *ltr)
+_makeargs(int num, char *ltr, int null_if_none)
{
PyObject *str;
int i;
switch (num) {
case 0:
+ if (null_if_none) return NULL;
return PyString_FromString("");
case 1:
return PyString_FromString(ltr);
}
- str = PyString_FromFormat("%s1,%s2", ltr, ltr);
+ str = PyString_FromFormat("%s1, %s2", ltr, ltr);
for(i = 3; i <= num; ++i) {
- PyString_ConcatAndDel(&str, PyString_FromFormat(",%s%d", ltr, i));
+ PyString_ConcatAndDel(&str, PyString_FromFormat(", %s%d", ltr, i));
}
return str;
}
@@ -4549,17 +4086,26 @@ ufunc_get_doc(PyUFuncObject *self)
/* to automate the first part of it */
/* the doc string shouldn't need the calling convention */
/* construct
- y1,y2,,... = name(x1,x2,...) __doc__
+ name(x1, x2, ...,[ out1, out2, ...])
+
+ __doc__
*/
PyObject *outargs, *inargs, *doc;
- outargs = _makeargs(self->nout, "y");
- inargs = _makeargs(self->nin, "x");
- doc = PyString_FromFormat("%s = %s(%s)\n\n%s",
- PyString_AS_STRING(outargs),
- self->name,
- PyString_AS_STRING(inargs),
- self->doc);
- Py_DECREF(outargs);
+ outargs = _makeargs(self->nout, "out", 1);
+ inargs = _makeargs(self->nin, "x", 0);
+ if (outargs == NULL) {
+ doc = PyString_FromFormat("%s(%s)\n\n%s",
+ self->name,
+ PyString_AS_STRING(inargs),
+ self->doc);
+ } else {
+ doc = PyString_FromFormat("%s(%s[, %s])\n\n%s",
+ self->name,
+ PyString_AS_STRING(inargs),
+ PyString_AS_STRING(outargs),
+ self->doc);
+ Py_DECREF(outargs);
+ }
Py_DECREF(inargs);
return doc;
}
@@ -4640,13 +4186,6 @@ ufunc_get_identity(PyUFuncObject *self)
return Py_None;
}
-static PyObject *
-ufunc_get_signature(PyUFuncObject *self)
-{
- if (!self->core_enabled)
- Py_RETURN_NONE;
- return PyString_FromString(self->core_signature);
-}
#undef _typecharfromnum
@@ -4654,16 +4193,15 @@ ufunc_get_signature(PyUFuncObject *self)
/* static char *Ufunctype__doc__ = NULL; */
static PyGetSetDef ufunc_getset[] = {
- {"__doc__", (getter)ufunc_get_doc, NULL, "documentation string"},
- {"nin", (getter)ufunc_get_nin, NULL, "number of inputs"},
- {"nout", (getter)ufunc_get_nout, NULL, "number of outputs"},
- {"nargs", (getter)ufunc_get_nargs, NULL, "number of arguments"},
- {"ntypes", (getter)ufunc_get_ntypes, NULL, "number of types"},
- {"types", (getter)ufunc_get_types, NULL, "return a list with types grouped input->output"},
- {"__name__", (getter)ufunc_get_name, NULL, "function name"},
- {"identity", (getter)ufunc_get_identity, NULL, "identity value"},
- {"signature",(getter)ufunc_get_signature,NULL, "signature"},
- {NULL, NULL, NULL, NULL}, /* Sentinel */
+ {"__doc__", (getter)ufunc_get_doc, NULL, "documentation string", NULL},
+ {"nin", (getter)ufunc_get_nin, NULL, "number of inputs", NULL},
+ {"nout", (getter)ufunc_get_nout, NULL, "number of outputs", NULL},
+ {"nargs", (getter)ufunc_get_nargs, NULL, "number of arguments", NULL},
+ {"ntypes", (getter)ufunc_get_ntypes, NULL, "number of types", NULL},
+ {"types", (getter)ufunc_get_types, NULL, "return a list with types grouped input->output", NULL},
+ {"__name__", (getter)ufunc_get_name, NULL, "function name", NULL},
+ {"identity", (getter)ufunc_get_identity, NULL, "identity value", NULL},
+ {NULL, NULL, NULL, NULL, NULL}, /* Sentinel */
};
static PyTypeObject PyUFunc_Type = {
@@ -4699,6 +4237,31 @@ static PyTypeObject PyUFunc_Type = {
ufunc_methods, /* tp_methods */
0, /* tp_members */
ufunc_getset, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+ 0, /* tp_del */
+
+#ifdef COUNT_ALLOCS
+ /* these must be last and never explicitly initialized */
+ 0, /* tp_allocs */
+ 0, /* tp_frees */
+ 0, /* tp_maxalloc */
+ 0, /* tp_prev */
+ 0, /* *tp_next */
+#endif
};
/* End of code for ufunc objects */
diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src
index 9096cdbf1..af66c256b 100644
--- a/numpy/core/src/umathmodule.c.src
+++ b/numpy/core/src/umathmodule.c.src
@@ -1,6 +1,10 @@
/* -*- c -*- */
/*
+ * vim:syntax=c
+ */
+
+/*
*****************************************************************************
** INCLUDES **
*****************************************************************************
@@ -13,417 +17,11 @@
#include "config.h"
#include <math.h>
-/*
- *****************************************************************************
- ** BASIC MATH FUNCTIONS **
- *****************************************************************************
- */
-
-/* A whole slew of basic math functions are provided originally
- by Konrad Hinsen. */
-
-#if !defined(__STDC__) && !defined(_MSC_VER)
-extern double fmod (double, double);
-extern double frexp (double, int *);
-extern double ldexp (double, int);
-extern double modf (double, double *);
-#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846264338328
#endif
-
-#if defined(DISTUTILS_USE_SDK)
-/* win32 on AMD64 build architecture */
-/* See also http://projects.scipy.org/scipy/numpy/ticket/164 */
-#ifndef HAVE_FABSF
-#ifdef fabsf
-#undef fabsf
-#endif
-static float fabsf(float x)
-{
- return (float)fabs((double)(x));
-}
-#endif
-#ifndef HAVE_HYPOTF
-static float hypotf(float x, float y)
-{
- return (float)hypot((double)(x), (double)(y));
-}
-#endif
-#ifndef HAVE_RINTF
-#ifndef HAVE_RINT
-static double rint (double x);
-#endif
-static float rintf(float x)
-{
- return (float)rint((double)(x));
-}
-#endif
-#ifndef HAVE_FREXPF
-static float frexpf(float x, int * i)
-{
- return (float)frexp((double)(x), i);
-}
-#endif
-#ifndef HAVE_LDEXPF
-static float ldexpf(float x, int i)
-{
- return (float)ldexp((double)(x), i);
-}
-#endif
-#define tanhf nc_tanhf
-#endif
-
-#ifndef HAVE_INVERSE_HYPERBOLIC
-static double acosh(double x)
-{
- return 2*log(sqrt((x+1.0)/2)+sqrt((x-1.0)/2));
-}
-
-double log1p(double);
-static double asinh(double xx)
-{
- double x, d;
- int sign;
- if (xx < 0.0) {
- sign = -1;
- x = -xx;
- }
- else {
- sign = 1;
- x = xx;
- }
- if (x > 1e8) {
- d = x;
- } else {
- d = sqrt(x*x + 1);
- }
- return sign*log1p(x*(1.0 + x/(d+1)));
-}
-
-static double atanh(double x)
-{
- return 0.5*log1p(2.0*x/(1.0-x));
-}
-#endif
-
-#if !defined(HAVE_INVERSE_HYPERBOLIC_FLOAT)
-#ifdef HAVE_FLOAT_FUNCS
-#ifdef log1pf
-#undef log1pf
-#endif
-#ifdef logf
-#undef logf
-#endif
-#ifdef sqrtf
-#undef sqrtf
-#endif
-float log1pf(float);
-#ifdef DISTUTILS_USE_SDK
-DL_IMPORT(float) logf(float);
-DL_IMPORT(float) sqrtf(float);
-#else
-/* should these be extern?: */
-float logf(float);
-float sqrtf(float);
-#endif
-#ifdef acoshf
-#undef acoshf
-#endif
-static float acoshf(float x)
-{
- return 2*logf(sqrtf((x+1)/2)+sqrtf((x-1)/2));
-}
-
-#ifdef asinhf
-#undef asinhf
-#endif
-static float asinhf(float xx)
-{
- float x, d;
- int sign;
- if (xx < 0) {
- sign = -1;
- x = -xx;
- }
- else {
- sign = 1;
- x = xx;
- }
- if (x > 1e5) {
- d = x;
- } else {
- d = sqrtf(x*x + 1);
- }
- return sign*log1pf(x*(1 + x/(d+1)));
-}
-
-#ifdef atanhf
-#undef atanhf
-#endif
-static float atanhf(float x)
-{
- return log1pf(2*x/(1-x))/2;
-}
-#else
-#ifdef acoshf
-#undef acoshf
-#endif
-static float acoshf(float x)
-{
- return (float)acosh((double)(x));
-}
-
-#ifdef asinhf
-#undef asinhf
-#endif
-static float asinhf(float x)
-{
- return (float)asinh((double)(x));
-}
-
-#ifdef atanhf
-#undef atanhf
-#endif
-static float atanhf(float x)
-{
- return (float)atanh((double)(x));
-}
-#endif
-#endif
-
-
-#if !defined(HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE)
-#ifdef HAVE_LONGDOUBLE_FUNCS
-#ifdef logl
-#undef logl
-#endif
-#ifdef sqrtl
-#undef sqrtl
-#endif
-#ifdef log1pl
-#undef log1pl
-#endif
-longdouble logl(longdouble);
-longdouble sqrtl(longdouble);
-longdouble log1pl(longdouble);
-#ifdef acoshl
-#undef acoshl
-#endif
-static longdouble acoshl(longdouble x)
-{
- return 2*logl(sqrtl((x+1.0)/2)+sqrtl((x-1.0)/2));
-}
-
-#ifdef asinhl
-#undef asinhl
-#endif
-static longdouble asinhl(longdouble xx)
-{
- longdouble x, d;
- int sign;
- if (xx < 0.0) {
- sign = -1;
- x = -xx;
- }
- else {
- sign = 1;
- x = xx;
- }
- if (x > 1e17) {
- d = x;
- } else {
- d = sqrtl(x*x + 1);
- }
- return sign*log1pl(x*(1.0 + x/(d+1)));
-}
-
-#ifdef atanhl
-#undef atanhl
-#endif
-static longdouble atanhl(longdouble x)
-{
- return 0.5*log1pl(2.0*x/(1.0-x));
-}
-
-#else
-
-#ifdef acoshl
-#undef acoshl
-#endif
-static longdouble acoshl(longdouble x)
-{
- return (longdouble)acosh((double)(x));
-}
-
-#ifdef asinhl
-#undef asinhl
-#endif
-static longdouble asinhl(longdouble x)
-{
- return (longdouble)asinh((double)(x));
-}
-
-#ifdef atanhl
-#undef atanhl
-#endif
-static longdouble atanhl(longdouble x)
-{
- return (longdouble)atanh((double)(x));
-}
-
-#endif
-#endif
-
-
-#ifdef HAVE_HYPOT
-#if !defined(NeXT) && !defined(_MSC_VER)
-extern double hypot(double, double);
-#endif
-#else
-static double hypot(double x, double y)
-{
- double yx;
-
- x = fabs(x);
- y = fabs(y);
- if (x < y) {
- double temp = x;
- x = y;
- y = temp;
- }
- if (x == 0.)
- return 0.;
- else {
- yx = y/x;
- return x*sqrt(1.+yx*yx);
- }
-}
-#endif
-
-
-#ifndef HAVE_RINT
-static double
-rint (double x)
-{
- double y, r;
-
- y = floor(x);
- r = x - y;
-
- if (r > 0.5) goto rndup;
-
- /* Round to nearest even */
- if (r==0.5) {
- r = y - 2.0*floor(0.5*y);
- if (r==1.0) {
- rndup:
- y+=1.0;
- }
- }
- return y;
-}
-#endif
-
-
-
-
-
-/* Define isnan, isinf, isfinite, signbit if needed */
-/* Use fpclassify if possible */
-/* isnan, isinf --
- these will use macros and then fpclassify if available before
- defaulting to a dumb convert-to-double version...
-
- isfinite -- define a macro if not already available
- signbit -- if macro available use it, otherwise define a function
- and a dumb convert-to-double version for other types.
-*/
-
-#if defined(fpclassify)
-
-#if !defined(isnan)
-#define isnan(x) (fpclassify(x) == FP_NAN)
-#endif
-#if !defined(isinf)
-#define isinf(x) (fpclassify(x) == FP_INFINITE)
-#endif
-
-#else /* check to see if already have a function like this */
-
-#if !defined(HAVE_ISNAN)
-
-#if !defined(isnan)
-#include "_isnan.c"
-#endif
-#endif /* HAVE_ISNAN */
-
-#if !defined(HAVE_ISINF)
-#if !defined(isinf)
-#define isinf(x) (!isnan((x)) && isnan((x)-(x)))
-#endif
-#endif /* HAVE_ISINF */
-
-#endif /* defined(fpclassify) */
-
-
-/* Define signbit if needed */
-#if !defined(signbit)
-#include "_signbit.c"
-#endif
-
-/* Now defined the extended type macros */
-
-#if !defined(isnan)
-
-#if !defined(HAVE_LONGDOUBLE_FUNCS) || !defined(HAVE_ISNAN)
-#define isnanl(x) isnan((double)(x))
-#endif
-
-#if !defined(HAVE_FLOAT_FUNCS) || !defined(HAVE_ISNAN)
-#define isnanf(x) isnan((double)(x))
-#endif
-
-#else /* !defined(isnan) */
-
-#define isnanl(x) isnan((x))
-#define isnanf(x) isnan((x))
-
-#endif /* !defined(isnan) */
-
-
-#if !defined(isinf)
-
-#if !defined(HAVE_LONGDOUBLE_FUNCS) || !defined(HAVE_ISINF)
-#define isinfl(x) (!isnanl((x)) && isnanl((x)-(x)))
-#endif
-
-#if !defined(HAVE_FLOAT_FUNCS) || !defined(HAVE_ISINF)
-#define isinff(x) (!isnanf((x)) && isnanf((x)-(x)))
-#endif
-
-#else /* !defined(isinf) */
-
-#define isinfl(x) isinf((x))
-#define isinff(x) isinf((x))
-
-#endif /* !defined(isinf) */
-
-
-#if !defined(signbit)
-#define signbitl(x) ((longdouble) signbit((double)(x)))
-#define signbitf(x) ((float) signbit((double) (x)))
-#else
-#define signbitl(x) signbit((x))
-#define signbitf(x) signbit((x))
-#endif
-
-#if !defined(isfinite)
-#define isfinite(x) (!(isinf((x)) || isnan((x))))
-#endif
-#define isfinitef(x) (!(isinff((x)) || isnanf((x))))
-#define isfinitel(x) (!(isinfl((x)) || isnanl((x))))
+#include "math_c99.inc"
float degreesf(float x) {
return x * (float)(180.0/M_PI);
@@ -445,167 +43,61 @@ longdouble radiansl(longdouble x) {
return x * (M_PI/180.0L);
}
-/* First, the C functions that do the real work */
-
-/* if C99 extensions not available then define dummy functions that use the
- double versions for
-
- sin, cos, tan
- sinh, cosh, tanh,
- fabs, floor, ceil, fmod, sqrt, log10, log, exp, fabs
- asin, acos, atan,
- asinh, acosh, atanh
-
- hypot, atan2, pow
-*/
-
-/**begin repeat
-
- #kind=(sin,cos,tan,sinh,cosh,tanh,fabs,floor,ceil,sqrt,log10,log,exp,asin,acos,atan,rint)*2#
- #typ=longdouble*17, float*17#
- #c=l*17,f*17#
- #TYPE=LONGDOUBLE*17, FLOAT*17#
-*/
-
-#ifndef HAVE_@TYPE@_FUNCS
-#ifdef @kind@@c@
-#undef @kind@@c@
-#endif
-@typ@ @kind@@c@(@typ@ x) {
- return (@typ@) @kind@((double)x);
-}
-#endif
-/**end repeat**/
-
-/**begin repeat
-
- #kind=(atan2,hypot,pow,fmod)*2#
- #typ=longdouble*4, float*4#
- #c=l*4,f*4#
- #TYPE=LONGDOUBLE*4,FLOAT*4#
-*/
-#ifndef HAVE_@TYPE@_FUNCS
-#ifdef @kind@@c@
-#undef @kind@@c@
-#endif
-@typ@ @kind@@c@(@typ@ x, @typ@ y) {
- return (@typ@) @kind@((double)x, (double) y);
-}
-#endif
-/**end repeat**/
-
-/**begin repeat
- #kind=modf*2#
- #typ=longdouble, float#
- #c=l,f#
- #TYPE=LONGDOUBLE, FLOAT#
-*/
-#ifndef HAVE_@TYPE@_FUNCS
-#ifdef modf@c@
-#undef modf@c@
-#endif
-@typ@ modf@c@(@typ@ x, @typ@ *iptr) {
- double nx, niptr, y;
- nx = (double) x;
- y = modf(nx, &niptr);
- *iptr = (@typ@) niptr;
- return (@typ@) y;
-}
-#endif
-/**end repeat**/
-
-
+/*
+ *****************************************************************************
+ ** PYTHON OBJECT FUNCTIONS **
+ *****************************************************************************
+ */
-#ifndef HAVE_LOG1P
-double log1p(double x)
+static PyObject *
+Py_square(PyObject *o)
{
- double u = 1. + x;
- if (u == 1.0) {
- return x;
- } else {
- return log(u) * x / (u-1.);
- }
+ return PyNumber_Multiply(o, o);
}
-#endif
-#if !defined(HAVE_LOG1P) || !defined(HAVE_LONGDOUBLE_FUNCS)
-#ifdef log1pl
-#undef log1pl
-#endif
-longdouble log1pl(longdouble x)
+static PyObject *
+Py_get_one(PyObject *NPY_UNUSED(o))
{
- longdouble u = 1. + x;
- if (u == 1.0) {
- return x;
- } else {
- return logl(u) * x / (u-1.);
- }
+ return PyInt_FromLong(1);
}
-#endif
-#if !defined(HAVE_LOG1P) || !defined(HAVE_FLOAT_FUNCS)
-#ifdef log1pf
-#undef log1pf
-#endif
-float log1pf(float x)
+static PyObject *
+Py_reciprocal(PyObject *o)
{
- float u = 1 + x;
- if (u == 1) {
- return x;
- } else {
- return logf(u) * x / (u-1);
- }
-}
-#endif
+ PyObject *one = PyInt_FromLong(1);
+ PyObject *result;
-#ifndef HAVE_EXPM1
-static double expm1(double x)
-{
- double u = exp(x);
- if (u == 1.0) {
- return x;
- } else if (u-1.0 == -1.0) {
- return -1;
- } else {
- return (u-1.0) * x/log(u);
+ if (!one) {
+ return NULL;
}
+ result = PyNumber_Divide(one, o);
+ Py_DECREF(one);
+ return result;
}
-#endif
-#if !defined(HAVE_EXPM1) || !defined(HAVE_LONGDOUBLE_FUNCS)
-#ifdef expml1
-#undef expml1
-#endif
-static longdouble expm1l(longdouble x)
+/**begin repeat
+ * #Kind = Max, Min#
+ * #OP = >=, <=#
+ */
+static PyObject *
+_npy_Object@Kind@(PyObject *i1, PyObject *i2)
{
- longdouble u = expl(x);
- if (u == 1.0) {
- return x;
- } else if (u-1.0 == -1.0) {
- return -1;
- } else {
- return (u-1.0) * x/logl(u);
- }
-}
-#endif
+ PyObject *result;
+ int cmp;
-#if !defined(HAVE_EXPM1) || !defined(HAVE_FLOAT_FUNCS)
-#ifdef expm1f
-#undef expm1f
-#endif
-static float expm1f(float x)
-{
- float u = expf(x);
- if (u == 1) {
- return x;
- } else if (u-1 == -1) {
- return -1;
- } else {
- return (u-1) * x/logf(u);
+ if (PyObject_Cmp(i1, i2, &cmp) < 0) {
+ return NULL;
+ }
+ if (cmp @OP@ 0) {
+ result = i1;
+ }
+ else {
+ result = i2;
}
+ Py_INCREF(result);
+ return result;
}
-#endif
-
+/**end repeat**/
/*
*****************************************************************************
@@ -614,11 +106,12 @@ static float expm1f(float x)
*/
-/* Don't pass structures between functions (only pointers) because how
- structures are passed is compiler dependent and could cause
- segfaults if ufuncobject.c is compiled with a different compiler
- than an extension that makes use of the UFUNC API
-*/
+/*
+ * Don't pass structures between functions (only pointers) because how
+ * structures are passed is compiler dependent and could cause
+ * segfaults if ufuncobject.c is compiled with a different compiler
+ * than an extension that makes use of the UFUNC API
+ */
/**begin repeat
@@ -632,9 +125,10 @@ static c@typ@ nc_half@c@ = {0.5, 0.};
static c@typ@ nc_i@c@ = {0., 1.};
static c@typ@ nc_i2@c@ = {0., 0.5};
/*
- static c@typ@ nc_mi@c@ = {0., -1.};
- static c@typ@ nc_pi2@c@ = {M_PI/2., 0.};
-*/
+ * static c@typ@ nc_mi@c@ = {0., -1.};
+ * static c@typ@ nc_pi2@c@ = {M_PI/2., 0.};
+ */
+
static void
nc_sum@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
@@ -663,7 +157,7 @@ nc_neg@c@(c@typ@ *a, c@typ@ *r)
static void
nc_prod@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
{
- register @typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;
+ @typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;
r->real = ar*br - ai*bi;
r->imag = ar*bi + ai*br;
return;
@@ -673,8 +167,8 @@ static void
nc_quot@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
{
- register @typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;
- register @typ@ d = br*br + bi*bi;
+ @typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;
+ @typ@ d = br*br + bi*bi;
r->real = (ar*br + ai*bi)/d;
r->imag = (ai*br - ar*bi)/d;
return;
@@ -783,8 +277,10 @@ nc_pow@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
return;
}
}
- /* complexobect.c uses an inline version of this formula
- investigate whether this had better performance or accuracy */
+ /*
+ * complexobect.c uses an inline version of this formula
+ * investigate whether this had better performance or accuracy
+ */
nc_log@c@(a, r);
nc_prod@c@(r, b, r);
nc_exp@c@(r, r);
@@ -805,6 +301,10 @@ nc_prodi@c@(c@typ@ *x, c@typ@ *r)
static void
nc_acos@c@(c@typ@ *x, c@typ@ *r)
{
+ /*
+ * return nc_neg(nc_prodi(nc_log(nc_sum(x,nc_prod(nc_i,
+ * nc_sqrt(nc_diff(nc_1,nc_prod(x,x))))))));
+ */
nc_prod@c@(x,x,r);
nc_diff@c@(&nc_1@c@, r, r);
nc_sqrt@c@(r, r);
@@ -814,14 +314,15 @@ nc_acos@c@(c@typ@ *x, c@typ@ *r)
nc_prodi@c@(r, r);
nc_neg@c@(r, r);
return;
- /* return nc_neg(nc_prodi(nc_log(nc_sum(x,nc_prod(nc_i,
- nc_sqrt(nc_diff(nc_1,nc_prod(x,x))))))));
- */
}
static void
nc_acosh@c@(c@typ@ *x, c@typ@ *r)
{
+ /*
+ * return nc_log(nc_sum(x,
+ * nc_prod(nc_sqrt(nc_sum(x,nc_1)), nc_sqrt(nc_diff(x,nc_1)))));
+ */
c@typ@ t;
nc_sum@c@(x, &nc_1@c@, &t);
@@ -832,15 +333,15 @@ nc_acosh@c@(c@typ@ *x, c@typ@ *r)
nc_sum@c@(x, r, r);
nc_log@c@(r, r);
return;
- /*
- return nc_log(nc_sum(x,
- nc_prod(nc_sqrt(nc_sum(x,nc_1)), nc_sqrt(nc_diff(x,nc_1)))));
- */
}
static void
nc_asin@c@(c@typ@ *x, c@typ@ *r)
{
+ /*
+ * return nc_neg(nc_prodi(nc_log(nc_sum(nc_prod(nc_i,x),
+ * nc_sqrt(nc_diff(nc_1,nc_prod(x,x)))))));
+ */
c@typ@ a, *pa=&a;
nc_prod@c@(x, x, r);
nc_diff@c@(&nc_1@c@, r, r);
@@ -851,30 +352,29 @@ nc_asin@c@(c@typ@ *x, c@typ@ *r)
nc_prodi@c@(r, r);
nc_neg@c@(r, r);
return;
- /*
- return nc_neg(nc_prodi(nc_log(nc_sum(nc_prod(nc_i,x),
- nc_sqrt(nc_diff(nc_1,nc_prod(x,x)))))));
- */
}
static void
nc_asinh@c@(c@typ@ *x, c@typ@ *r)
{
+ /*
+ * return nc_log(nc_sum(nc_sqrt(nc_sum(nc_1,nc_prod(x,x))),x));
+ */
nc_prod@c@(x, x, r);
nc_sum@c@(&nc_1@c@, r, r);
nc_sqrt@c@(r, r);
nc_sum@c@(r, x, r);
nc_log@c@(r, r);
return;
- /*
- return nc_log(nc_sum(nc_sqrt(nc_sum(nc_1,nc_prod(x,x))),x));
- */
}
static void
nc_atan@c@(c@typ@ *x, c@typ@ *r)
{
+ /*
+ * return nc_prod(nc_i2,nc_log(nc_quot(nc_sum(nc_i,x),nc_diff(nc_i,x))));
+ */
c@typ@ a, *pa=&a;
nc_diff@c@(&nc_i@c@, x, pa);
nc_sum@c@(&nc_i@c@, x, r);
@@ -882,14 +382,14 @@ nc_atan@c@(c@typ@ *x, c@typ@ *r)
nc_log@c@(r,r);
nc_prod@c@(&nc_i2@c@, r, r);
return;
- /*
- return nc_prod(nc_i2,nc_log(nc_quot(nc_sum(nc_i,x),nc_diff(nc_i,x))));
- */
}
static void
nc_atanh@c@(c@typ@ *x, c@typ@ *r)
{
+ /*
+ * return nc_prod(nc_half,nc_log(nc_quot(nc_sum(nc_1,x),nc_diff(nc_1,x))));
+ */
c@typ@ a, *pa=&a;
nc_diff@c@(&nc_1@c@, x, r);
nc_sum@c@(&nc_1@c@, x, pa);
@@ -897,9 +397,6 @@ nc_atanh@c@(c@typ@ *x, c@typ@ *r)
nc_log@c@(r, r);
nc_prod@c@(&nc_half@c@, r, r);
return;
- /*
- return nc_prod(nc_half,nc_log(nc_quot(nc_sum(nc_1,x),nc_diff(nc_1,x))));
- */
}
static void
@@ -1000,1188 +497,1018 @@ nc_tanh@c@(c@typ@ *x, c@typ@ *r)
*****************************************************************************
*/
+#define OUTPUT_LOOP\
+ char *op = args[1];\
+ intp os = steps[1];\
+ intp n = dimensions[0];\
+ intp i;\
+ for(i = 0; i < n; i++, op += os)
+
+#define UNARY_LOOP\
+ char *ip1 = args[0], *op = args[1];\
+ intp is1 = steps[0], os = steps[1];\
+ intp n = dimensions[0];\
+ intp i;\
+ for(i = 0; i < n; i++, ip1 += is1, op += os)
+
+#define UNARY_LOOP_TWO_OUT\
+ char *ip1 = args[0], *op1 = args[1], *op2 = args[2];\
+ intp is1 = steps[0], os1 = steps[1], os2 = steps[2];\
+ intp n = dimensions[0];\
+ intp i;\
+ for(i = 0; i < n; i++, ip1 += is1, op1 += os1, op2 += os2)
+
+#define BINARY_LOOP\
+ char *ip1 = args[0], *ip2 = args[1], *op = args[2];\
+ intp is1 = steps[0], is2 = steps[1], os = steps[2];\
+ intp n = dimensions[0];\
+ intp i;\
+ for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os)
+
+#define BINARY_LOOP_TWO_OUT\
+ char *ip1 = args[0], *ip2 = args[1], *op1 = args[2], *op2 = args[3];\
+ intp is1 = steps[0], is2 = steps[1], os1 = steps[2], os2 = steps[3];\
+ intp n = dimensions[0];\
+ intp i;\
+ for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op1 += os1, op2 += os2)
+
+/*
+ *****************************************************************************
+ ** BOOLEAN LOOPS **
+ *****************************************************************************
+ */
+
+#define BOOL_invert BOOL_logical_not
+#define BOOL_negative BOOL_logical_not
+#define BOOL_add BOOL_logical_or
+#define BOOL_bitwise_and BOOL_logical_and
+#define BOOL_bitwise_or BOOL_logical_or
+#define BOOL_bitwise_xor BOOL_logical_xor
+#define BOOL_multiply BOOL_logical_and
+#define BOOL_subtract BOOL_logical_xor
/**begin repeat
+ * #kind = equal, not_equal, greater, greater_equal, less, less_equal,
+ * logical_and, logical_or#
+ * #OP = ==, !=, >, >=, <, <=, &&, ||#
+ **/
- #TYPE=(BOOL, BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*2#
- #OP=||, +*13, ^, -*13#
- #kind=add*14, subtract*14#
- #typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*2#
-*/
+static void
+BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ Bool in1 = *((Bool *)ip1) != 0;
+ Bool in2 = *((Bool *)ip2) != 0;
+ *((Bool *)op)= in1 @OP@ in2;
+ }
+}
+/**end repeat**/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+BOOL_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);
+ BINARY_LOOP {
+ Bool in1 = *((Bool *)ip1) != 0;
+ Bool in2 = *((Bool *)ip2) != 0;
+ *((Bool *)op)= (in1 && !in2) || (!in1 && in2);
}
}
+/**begin repeat
+ * #kind = maximum, minimum#
+ * #OP = >, <#
+ **/
+static void
+BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ Bool in1 = *((Bool *)ip1) != 0;
+ Bool in2 = *((Bool *)ip2) != 0;
+ *((Bool *)op) = (in1 @OP@ in2) ? in1 : in2;
+ }
+}
/**end repeat**/
/**begin repeat
-
- #TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*2#
- #OP=+*3,-*3#
- #kind=add*3,subtract*3#
- #typ=(float, double, longdouble)*2#
-*/
+ * #kind = absolute, logical_not#
+ * #OP = !=, ==#
+ **/
+static void
+BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ UNARY_LOOP {
+ Bool in1 = *(Bool *)ip1;
+ *((Bool *)op) = in1 @OP@ 0;
+ }
+}
+/**end repeat**/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+BOOL_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- ((@typ@ *)op)[0]=((@typ@ *)i1)[0] @OP@ ((@typ@ *)i2)[0];
- ((@typ@ *)op)[1]=((@typ@ *)i1)[1] @OP@ ((@typ@ *)i2)[1];
+ OUTPUT_LOOP {
+ *((Bool *)op) = 1;
}
}
-/**end repeat**/
+/*
+ *****************************************************************************
+ ** INTEGER LOOPS
+ *****************************************************************************
+ */
+
+/**begin repeat
+ * #type = byte, short, int, long, longlong#
+ * #TYPE = BYTE, SHORT, INT, LONG, LONGLONG#
+ * #ftype = float, float, double, double, double#
+ */
+
+/**begin repeat1
+ * both signed and unsigned integer types
+ * #s = , u#
+ * #S = , U#
+ */
+
+#define @S@@TYPE@_floor_divide @S@@TYPE@_divide
static void
-BOOL_multiply(char **args, intp *dimensions, intp *steps, void *func) {
- register intp i;
- intp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((Bool *)op) = *((Bool *)i1) && *((Bool *)i2);
+@S@@TYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
+{
+ OUTPUT_LOOP {
+ *((@s@@type@ *)op) = 1;
}
}
-/**begin repeat
+static void
+@S@@TYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
+{
+ UNARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ *((@s@@type@ *)op) = in1*in1;
+ }
+}
- #TYP= BYTE, SHORT, INT, LONG, LONGLONG, UBYTE, USHORT, UINT, ULONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE#
- #typ= byte, short, int, long, longlong, ubyte, ushort, uint, ulong, ulonglong, float, double, longdouble#
-*/
static void
-@TYP@_multiply(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
{
- register intp i;
- intp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((@typ@ *)op) = (*((@typ@ *)i1)) * (*((@typ@ *)i2));
+ UNARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ *((@s@@type@ *)op) = 1.0/in1;
}
}
-/**end repeat**/
+static void
+@S@@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ UNARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ *((@s@@type@ *)op) = in1;
+ }
+}
-/**begin repeat
- #TYP= CFLOAT, CDOUBLE, CLONGDOUBLE#
- #typ= float, double, longdouble#
- #c=f,,l#
-*/
static void
-@TYP@_multiply(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- register @typ@ ar=((c@typ@ *)i1)->real, \
- ai=((c@typ@ *)i1)->imag, \
- br=((c@typ@ *)i2)->real, \
- bi=((c@typ@ *)i2)->imag;
- ((c@typ@ *)op)->real = ar*br - ai*bi;
- ((c@typ@ *)op)->imag = ar*bi + ai*br;
+ UNARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ *((@s@@type@ *)op) = (@s@@type@)(-(@type@)in1);
}
}
static void
-@TYP@_divide(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- register @typ@ ar=((c@typ@ *)i1)->real, \
- ai=((c@typ@ *)i1)->imag, \
- br=((c@typ@ *)i2)->real, \
- bi=((c@typ@ *)i2)->imag;
- register @typ@ d = br*br + bi*bi;
- ((c@typ@ *)op)->real = (ar*br + ai*bi)/d;
- ((c@typ@ *)op)->imag = (ai*br - ar*bi)/d;
+ UNARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ *((Bool *)op) = !in1;
}
}
static void
-@TYP@_floor_divide(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- register @typ@ ar=((c@typ@ *)i1)->real, \
- ai=((c@typ@ *)i1)->imag, \
- br=((c@typ@ *)i2)->real, \
- bi=((c@typ@ *)i2)->imag;
- register @typ@ d = br*br + bi*bi;
- ((c@typ@ *)op)->real = floor@c@((ar*br + ai*bi)/d);
- ((c@typ@ *)op)->imag = 0;
+ UNARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ *((@s@@type@ *)op) = ~in1;
}
}
-#define @TYP@_true_divide @TYP@_divide
-/**end repeat**/
+/**begin repeat2
+ * Arithmetic
+ * #kind = add, subtract, multiply, bitwise_and, bitwise_or, bitwise_xor,
+ * left_shift, right_shift#
+ * #OP = +, -,*, &, |, ^, <<, >>#
+ */
+static void
+@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ const @s@@type@ in2 = *(@s@@type@ *)ip2;
+ *((@s@@type@ *)op) = in1 @OP@ in2;
+ }
+}
+/**end repeat2**/
+/**begin repeat2
+ * #kind = equal, not_equal, greater, greater_equal, less, less_equal,
+ * logical_and, logical_or#
+ * #OP = ==, !=, >, >=, <, <=, &&, ||#
+ */
+static void
+@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ const @s@@type@ in2 = *(@s@@type@ *)ip2;
+ *((Bool *)op) = in1 @OP@ in2;
+ }
+}
+/**end repeat2**/
-/**begin repeat
- #TYP=UBYTE,USHORT,UINT,ULONG,ULONGLONG#
- #typ=ubyte, ushort, uint, ulong, ulonglong#
-*/
static void
-@TYP@_divide(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- if (*((@typ@ *)i2)==0) {
- generate_divbyzero_error();
- *((@typ@ *)op)=0;
- }
- else {
- *((@typ@ *)op)= *((@typ@ *)i1) / *((@typ@ *)i2);
- }
+ BINARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ const @s@@type@ in2 = *(@s@@type@ *)ip2;
+ *((Bool *)op)= (in1 && !in2) || (!in1 && in2);
}
}
-/**end repeat**/
+/**begin repeat2
+ * #kind = maximum, minimum#
+ * #OP = >, <#
+ **/
+static void
+@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ const @s@@type@ in2 = *(@s@@type@ *)ip2;
+ *((@s@@type@ *)op) = (in1 @OP@ in2) ? in1 : in2;
+ }
+}
+/**end repeat2**/
-/**begin repeat
- #TYP=BYTE,SHORT,INT,LONG,LONGLONG#
- #typ=char, short, int, long, longlong#
-*/
static void
-@TYP@_divide(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- @typ@ x, y, tmp;
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- y = *((@typ@ *)i2);
- if (y == 0) {
+ BINARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ const @s@@type@ in2 = *(@s@@type@ *)ip2;
+ if (in2 == 0) {
generate_divbyzero_error();
- *((@typ@ *)op)=0;
+ *((@ftype@ *)op) = 0;
}
else {
- x = *((@typ@ *)i1);
- tmp = x / y;
- if (((x > 0) != (y > 0)) && (x % y != 0)) tmp--;
- *((@typ@ *)op)= tmp;
+ *((@ftype@ *)op) = (@ftype@)in1 / (@ftype@)in2;
}
}
}
-/**end repeat**/
+static void
+@S@@TYPE@_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ const @ftype@ in1 = (@ftype@)*(@s@@type@ *)ip1;
+ const @ftype@ in2 = (@ftype@)*(@s@@type@ *)ip2;
+ *((@s@@type@ *)op) = (@s@@type@) pow(in1, in2);
+ }
+}
-/**begin repeat
- #TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#
- #typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#
- #otyp=float*4, double*6#
-*/
static void
-@TYP@_true_divide(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- if (*((@typ@ *)i2)==0) {
+ BINARY_LOOP {
+ const @s@@type@ in1 = *(@s@@type@ *)ip1;
+ const @s@@type@ in2 = *(@s@@type@ *)ip2;
+ if (in2 == 0) {
generate_divbyzero_error();
- *((@otyp@ *)op)=0;
+ *((@s@@type@ *)op) = 0;
}
else {
- *((@otyp@ *)op)= \
- (@otyp@)((double)*((@typ@ *)i1) / (double)*((@typ@ *)i2));
+ *((@s@@type@ *)op)= in1 % in2;
}
+
}
}
-#define @TYP@_floor_divide @TYP@_divide
-/**end repeat**/
+/**end repeat1**/
-
-/**begin repeat
- #TYP=FLOAT,DOUBLE,LONGDOUBLE#
- #typ=float,double,longdouble#
-*/
static void
-@TYP@_divide(char **args, intp *dimensions, intp *steps, void *func)
+U@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((@typ@ *)op)=*((@typ@ *)i1) / *((@typ@ *)i2);
+ UNARY_LOOP {
+ const u@type@ in1 = *(u@type@ *)ip1;
+ *((u@type@ *)op) = in1;
}
}
-#define @TYP@_true_divide @TYP@_divide
-/**end repeat**/
-
-/**begin repeat
- #TYP=FLOAT,DOUBLE,LONGDOUBLE#
- #typ=float,double,longdouble#
- #c=f,,l#
-*/
static void
-@TYP@_floor_divide(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((@typ@ *)op)=floor@c@(*((@typ@ *)i1) / *((@typ@ *)i2));
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op) = (in1 >= 0) ? in1 : -in1;
}
}
-/**end repeat**/
-/**begin repeat
- #TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#
- #typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#
-*/
static void
-@TYP@_square(char **args, intp *dimensions, intp *steps, void *data)
+U@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- intp i, is1 = steps[0], os = steps[1], n = dimensions[0];
- char *i1 = args[0], *op = args[1];
-
- for (i = 0; i < n; i++, i1 += is1, op += os) {
- @typ@ x = *((@typ@ *)i1);
- *((@typ@ *)op) = x*x;
+ UNARY_LOOP {
+ const u@type@ in1 = *(u@type@ *)ip1;
+ *((u@type@ *)op) = in1 > 0 ? 1 : 0;
}
}
-/**end repeat**/
-/**begin repeat
- #TYP=CFLOAT,CDOUBLE,CLONGDOUBLE#
- #typ=float, double, longdouble#
-*/
static void
-@TYP@_square(char **args, intp *dimensions, intp *steps, void *data)
+@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- intp i, is1 = steps[0], os = steps[1], n = dimensions[0];
- char *i1 = args[0], *op = args[1];
- c@typ@ *x, *y;
- @typ@ xr, xi;
-
- for (i = 0; i < n; i++, i1 += is1, op += os) {
- x = (c@typ@ *)i1;
- y = (c@typ@ *)op;
- xr = x->real;
- xi = x->imag;
- y->real = xr*xr - xi*xi;
- y->imag = 2*xr*xi;
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op) = in1 > 0 ? 1 : (in1 < 0 ? -1 : 0);
}
}
-/**end repeat**/
-static PyObject *
-Py_square(PyObject *o)
-{
- return PyNumber_Multiply(o, o);
-}
-
-
-/**begin repeat
- #TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#
- #typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#
-*/
static void
-@TYP@_reciprocal(char **args, intp *dimensions, intp *steps, void *data)
+@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- intp i, is1 = steps[0], os = steps[1], n = dimensions[0];
- char *i1 = args[0], *op = args[1];
-
- for (i = 0; i < n; i++, i1 += is1, op += os) {
- @typ@ x = *((@typ@ *)i1);
- *((@typ@ *)op) = (@typ@) (1.0 / x);
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ if (in2 == 0) {
+ generate_divbyzero_error();
+ *((@type@ *)op) = 0;
+ }
+ else if (((in1 > 0) != (in2 > 0)) && (in1 % in2 != 0)) {
+ *((@type@ *)op) = in1/in2 - 1;
+ }
+ else {
+ *((@type@ *)op) = in1/in2;
+ }
}
}
-/**end repeat**/
-/**begin repeat
- #TYP=CFLOAT,CDOUBLE,CLONGDOUBLE#
- #typ=float, double, longdouble#
-*/
static void
-@TYP@_reciprocal(char **args, intp *dimensions, intp *steps, void *data)
-{
- intp i, is1 = steps[0], os = steps[1], n = dimensions[0];
- char *i1 = args[0], *op = args[1];
- c@typ@ *x, *y;
- @typ@ xr, xi, r, denom;
-
- for (i = 0; i < n; i++, i1 += is1, op += os) {
- x = (c@typ@ *)i1;
- y = (c@typ@ *)op;
- xr = x->real;
- xi = x->imag;
- if (fabs(xi) <= fabs(xr)) {
- r = xi / xr;
- denom = xr + xi * r;
- y->real = 1 / denom;
- y->imag = -r / denom;
- } else {
- r = xr / xi;
- denom = xr * r + xi;
- y->real = r / denom;
- y->imag = -1 / denom;
+U@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ const u@type@ in1 = *(u@type@ *)ip1;
+ const u@type@ in2 = *(u@type@ *)ip2;
+ if (in2 == 0) {
+ generate_divbyzero_error();
+ *((u@type@ *)op) = 0;
+ }
+ else {
+ *((u@type@ *)op)= in1/in2;
}
}
}
-/**end repeat**/
-
-static PyObject *
-Py_reciprocal(PyObject *o)
+static void
+@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- PyObject *one, *result;
- one = PyInt_FromLong(1);
- if (!one) return NULL;
- result = PyNumber_Divide(one, o);
- Py_DECREF(one);
- return result;
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ if (in2 == 0) {
+ generate_divbyzero_error();
+ *((@type@ *)op) = 0;
+ }
+ else {
+ /* handle mixed case the way Python does */
+ const @type@ rem = in1 % in2;
+ if ((in1 > 0) == (in2 > 0) || rem == 0) {
+ *((@type@ *)op) = rem;
+ }
+ else {
+ *((@type@ *)op) = rem + in2;
+ }
+ }
+ }
}
-static PyObject *
-_npy_ObjectMax(PyObject *i1, PyObject *i2)
+static void
+U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- int cmp;
- PyObject *res;
- if (PyObject_Cmp(i1, i2, &cmp) < 0) return NULL;
-
- if (cmp >= 0) {
- res = i1;
- }
- else {
- res = i2;
+ BINARY_LOOP {
+ const u@type@ in1 = *(u@type@ *)ip1;
+ const u@type@ in2 = *(u@type@ *)ip2;
+ if (in2 == 0) {
+ generate_divbyzero_error();
+ *((@type@ *)op) = 0;
+ }
+ else {
+ *((@type@ *)op) = in1 % in2;
+ }
}
- Py_INCREF(res);
- return res;
}
-static PyObject *
-_npy_ObjectMin(PyObject *i1, PyObject *i2)
-{
- int cmp;
- PyObject *res;
- if (PyObject_Cmp(i1, i2, &cmp) < 0) return NULL;
+/**end repeat**/
- if (cmp <= 0) {
- res = i1;
- }
- else {
- res = i2;
- }
- Py_INCREF(res);
- return res;
-}
+/*
+ *****************************************************************************
+ ** FLOAT LOOPS **
+ *****************************************************************************
+ */
-/* ones_like is defined here because it's used for x**0 */
/**begin repeat
- #TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#
- #typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#
-*/
+ * Float types
+ * #type = float, double, longdouble#
+ * #TYPE = FLOAT, DOUBLE, LONGDOUBLE#
+ * #c = f, , l#
+ * #C = F, , L#
+ */
+
+/**begin repeat1
+ * Arithmetic
+ * # kind = add, subtract, multiply, divide#
+ * # OP = +, -, *, /#
+ */
static void
-@TYP@_ones_like(char **args, intp *dimensions, intp *steps, void *data)
+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- intp i, os = steps[1], n = dimensions[0];
- char *op = args[1];
-
- for (i = 0; i < n; i++, op += os) {
- *((@typ@ *)op) = 1;
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((@type@ *)op) = in1 @OP@ in2;
}
}
-/**end repeat**/
+/**end repeat1**/
-/**begin repeat
- #TYP=CFLOAT,CDOUBLE,CLONGDOUBLE#
- #typ=float, double, longdouble#
-*/
+/**begin repeat1
+ * #kind = equal, not_equal, less, less_equal, greater, greater_equal,
+ * logical_and, logical_or#
+ * #OP = ==, !=, <, <=, >, >=, &&, ||#
+ */
static void
-@TYP@_ones_like(char **args, intp *dimensions, intp *steps, void *data)
+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- intp i, is1 = steps[0], os = steps[1], n = dimensions[0];
- char *i1 = args[0], *op = args[1];
- c@typ@ *y;
-
- for (i = 0; i < n; i++, i1 += is1, op += os) {
- y = (c@typ@ *)op;
- y->real = 1.0;
- y->imag = 0.0;
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((Bool *)op) = in1 @OP@ in2;
}
}
-/**end repeat**/
+/**end repeat1**/
-static PyObject *
-Py_get_one(PyObject *o)
+static void
+@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- return PyInt_FromLong(1);
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((Bool *)op)= (in1 && !in2) || (!in1 && in2);
+ }
}
-
-/**begin repeat
- #TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#
- #typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#
- #btyp=float*4, double*6#
-*/
static void
-@TYP@_power(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, is1=steps[0],is2=steps[1];
- register intp os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- @btyp@ x, y;
-
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- x = (@btyp@)*((@typ@ *)i1);
- y = (@btyp@)*((@typ@ *)i2);
- *((@typ@ *)op) = (@typ@) pow(x,y);
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((Bool *)op) = !in1;
}
}
-/**end repeat**/
-/**begin repeat
- #TYP=UBYTE, BYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE#
- #typ=ubyte, char, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#
-*/
+/**begin repeat1
+ * #kind = isnan, isinf, isfinite, signbit#
+ * #func = isnan, isinf, isfinite, signbit#
+ **/
static void
-@TYP@_conjugate(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, is1=steps[0], os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((@typ@ *)op)=*((@typ@ *)i1);
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((Bool *)op) = @func@(in1) != 0;
}
}
-/**end repeat**/
+/**end repeat1**/
-/**begin repeat
-
- #TYP=CFLOAT, CDOUBLE, CLONGDOUBLE#
- #typ=float, double, longdouble#
-*/
+/**begin repeat1
+ * #kind = maximum, minimum#
+ * #OP = >, <#
+ **/
static void
-@TYP@_conjugate(char **args, intp *dimensions, intp *steps, void *func) {
- register intp i, is1=steps[0], os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
-
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- ((@typ@ *)op)[0]=((@typ@ *)i1)[0];
- ((@typ@ *)op)[1]=-(((@typ@ *)i1)[1]);
+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ /* */
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((@type@ *)op) = in1 @OP@ in2 ? in1 : in2;
}
}
-/**end repeat**/
+/**end repeat1**/
-
-/**begin repeat
-
- #TYPE=BOOL,UBYTE,USHORT,UINT,ULONG,ULONGLONG#
- #typ=Bool, ubyte, ushort, uint, ulong, ulonglong#
-*/
static void
-@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, n;
- intp is1=steps[0], os=steps[1];
- char *i1=args[0], *op=args[1];
-
- n=dimensions[0];
-
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((@typ@ *)op) = *((@typ@*)i1);
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((@type@ *)op) = floor@c@(in1/in2);
}
}
-/**end repeat**/
-/**begin repeat
-
- #TYPE=BYTE,SHORT,INT,LONG,LONGLONG,FLOAT,DOUBLE,LONGDOUBLE#
- #typ=byte, short, int, long, longlong, float, double, longdouble#
-*/
static void
-@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i, n;
- intp is1=steps[0], os=steps[1];
- char *i1=args[0], *op=args[1];
-
- n=dimensions[0];
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((@typ@ *)op) = *((@typ@ *)i1) < 0 ? -*((@typ@ *)i1) : *((@typ@ *)i1);
- *((@typ@ *)op) += 0; /* clear sign-bit */
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ const @type@ res = fmod@c@(in1,in2);
+ if (res && ((in2 < 0) != (res < 0))) {
+ *((@type@ *)op) = res + in2;
+ }
+ else {
+ *((@type@ *)op) = res;
+ }
}
}
-/**end repeat**/
-/**begin repeat
- #TYPE=CFLOAT,CDOUBLE,CLONGDOUBLE#
- #typ= float, double, longdouble#
- #c= f,,l#
-*/
static void
-@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
{
- register intp i, n;
- register intp is1=steps[0], os=steps[1];
- char *i1=args[0], *op=args[1];
- n=dimensions[0];
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((@typ@ *)op) = (@typ@)sqrt@c@(((@typ@ *)i1)[0]*((@typ@ *)i1)[0] + ((@typ@ *)i1)[1]*((@typ@ *)i1)[1]);
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op) = in1*in1;
}
}
-/**end repeat**/
-
-/**begin repeat
- #kind=greater, greater_equal, less, less_equal, equal, not_equal, logical_and, logical_or, bitwise_and, bitwise_or, bitwise_xor#
- #OP=>, >=, <, <=, ==, !=, &&, ||, &, |, ^#
-**/
static void
-BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- Bool in1, in2;
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- in1 = (*((Bool *)i1) != 0);
- in2 = (*((Bool *)i2) != 0);
- *((Bool *)op)= in1 @OP@ in2;
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op) = 1.0/in1;
}
}
-/**end repeat**/
-
-/**begin repeat
-
- #TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*4#
- #OP= >*13, >=*13, <*13, <=*13#
- #typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*4#
- #kind= greater*13, greater_equal*13, less*13, less_equal*13#
-*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((Bool *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);
+ OUTPUT_LOOP {
+ *((@type@ *)op) = 1;
}
}
-/**end repeat**/
-
-
-/**begin repeat
- #TYPE=(CFLOAT,CDOUBLE,CLONGDOUBLE)*4#
- #OP= >*3, >=*3, <*3, <=*3#
- #typ=(cfloat, cdouble, clongdouble)*4#
- #kind= greater*3, greater_equal*3, less*3, less_equal*3#
-*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- if (((@typ@ *)i1)->real == ((@typ@ *)i2)->real)
- *((Bool *)op)=((@typ@ *)i1)->imag @OP@ \
- ((@typ@ *)i2)->imag;
- else
- *((Bool *)op)=((@typ@ *)i1)->real @OP@ \
- ((@typ@ *)i2)->real;
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op) = in1;
}
}
-/**end repeat**/
-
-/**begin repeat
- #TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*4#
- #typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*4#
- #OP= ==*13, !=*13, &&*13, ||*13#
- #kind=equal*13, not_equal*13, logical_and*13, logical_or*13#
-*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((Bool *)op) = *((@typ@ *)i1) @OP@ *((@typ@ *)i2);
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ tmp = (in1 > 0) ? in1 : -in1;
+ /* add 0 to clear -0.0 */
+ *((@type@ *)op) = tmp + 0;
}
}
-/**end repeat**/
-
-
-/**begin repeat
- #TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*4#
- #typ=(float, double, longdouble)*4#
- #OP= ==*3, !=*3, &&*3, ||*3#
- #OP2= &&*3, ||*3, &&*3, ||*3#
- #kind=equal*3, not_equal*3, logical_and*3, logical_or*3#
-*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((Bool *)op) = (*((@typ@ *)i1) @OP@ *((@typ@ *)i2)) @OP2@ (*((@typ@ *)i1+1) @OP@ *((@typ@ *)i2+1));
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op) = -in1;
}
}
-/**end repeat**/
-
-/** OBJECT comparison for OBJECT arrays **/
-
-/**begin repeat
-
- #kind=greater, greater_equal, less, less_equal, equal, not_equal#
- #op=GT, GE, LT, LE, EQ, NE#
-*/
static void
-OBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *func) {
- register intp i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((Bool *)op)=PyObject_RichCompareBool(*((PyObject **)i1),
- *((PyObject **)i2),
- Py_@op@);
+@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ /* */
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ if (in1 > 0) {
+ *((@type@ *)op) = 1;
+ }
+ else if (in1 < 0) {
+ *((@type@ *)op) = -1;
+ }
+ else {
+ *((@type@ *)op) = 0;
+ }
}
}
-/**end repeat**/
-
-/**begin repeat
- #TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#
- #typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#
- #styp=byte, byte, short, short, int, int, long, long, longlong, longlong, float, double, longdouble#
-*/
static void
-@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((@typ@ *)op) = (@typ@) (- (@styp@)*((@typ@ *)i1));
+ UNARY_LOOP_TWO_OUT {
+ const @type@ in1 = *(@type@ *)ip1;
+ *(@type@ *)op1 = modf@c@(in1, (@type@ *)op2);
}
}
-/**end repeat**/
-#define BOOL_negative BOOL_logical_not
-
-#define _SIGN1(x) ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0))
-#define _SIGN2(x) ((x) == 0 ? 0 : 1)
-#define _SIGNC(x) (((x).real > 0) ? 1 : ((x).real < 0 ? -1 : ((x).imag > 0 ? 1 : ((x).imag < 0) ? -1 : 0)))
-/**begin repeat
- #TYPE=BYTE,SHORT,INT,LONG,LONGLONG,FLOAT,DOUBLE,LONGDOUBLE,UBYTE,USHORT,UINT,ULONG,ULONGLONG#
- #typ=byte,short,int,long,longlong,float,double,longdouble,ubyte,ushort,uint,ulong,ulonglong#
- #func=_SIGN1*8,_SIGN2*5#
-*/
+#ifdef HAVE_FREXP@C@
static void
-@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- @typ@ t1;
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- t1 = *((@typ@ *)i1);
- *((@typ@ *)op) = (@typ@) @func@(t1);
+ UNARY_LOOP_TWO_OUT {
+ const @type@ in1 = *(@type@ *)ip1;
+ *(@type@ *)op1 = frexp@c@(in1, (int *)op2);
}
}
-/**end repeat**/
+#endif
-/**begin repeat
- #TYPE=CFLOAT,CDOUBLE,CLONGDOUBLE#
- #typ=cfloat,cdouble,clongdouble#
- #rtyp=float,double,longdouble#
-*/
+#ifdef HAVE_LDEXP@C@
static void
-@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- @typ@ t1;
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- t1 = *((@typ@ *)i1);
- (*((@typ@ *)op)).real = (@rtyp@)_SIGNC(t1);
- (*((@typ@ *)op)).imag = (@rtyp@)0;
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const int in2 = *(int *)ip2;
+ *(@type@ *)op = ldexp@c@(in1, in2);
}
}
-/**end repeat**/
+#endif
-#undef _SIGN1
-#undef _SIGN2
-#undef _SIGNC
+#define @TYPE@_true_divide @TYPE@_divide
+/**end repeat**/
-static void
-OBJECT_sign(char **args, intp *dimensions, intp *steps, void *func)
-{
- register intp i;
- intp is1=steps[0],os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- PyObject *t1, *zero, *res;
- zero = PyInt_FromLong(0);
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- t1 = *((PyObject **)i1);
- res = PyInt_FromLong((long) PyObject_Compare(t1, zero));
- *((PyObject **)op) = res;
- }
- Py_DECREF(zero);
-}
+/*
+ *****************************************************************************
+ ** COMPLEX LOOPS **
+ *****************************************************************************
+ */
/**begin repeat
- #TYPE=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#
- #typ=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#
-*/
+ * complex types
+ * #ctype= cfloat, cdouble, clongdouble#
+ * #CTYPE= CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #type = float, double, longdouble#
+ * #c = f, , l#
+ */
+
+/**begin repeat1
+ * arithmetic
+ * #kind = add, subtract#
+ * #OP = +, -#
+ */
static void
-@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((Bool *)op) = ! *((@typ@ *)i1);
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ ((@type@ *)op)[0] = in1r @OP@ in2r;
+ ((@type@ *)op)[1] = in1i @OP@ in2i;
}
}
-/**end repeat**/
+/**end repeat1**/
-/**begin repeat
- #TYPE=CFLOAT,CDOUBLE,CLONGDOUBLE#
- #typ=cfloat, cdouble, clongdouble#
-*/
static void
-@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((Bool *)op) = ! (((@typ@ *)i1)->real || \
- ((@typ@ *)i1)->imag);
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ ((@type@ *)op)[0] = in1r*in2r - in1i*in2i;
+ ((@type@ *)op)[1] = in1r*in2i + in1i*in2r;
}
}
-/**end repeat**/
-
-
-
-/**begin repeat
- #TYPE=BYTE,SHORT,INT,LONG,LONGLONG#
- #typ=byte, short, int, long, longlong#
- #c=f*2,,,l*1#
-*/
static void
-@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func)
-{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- register @typ@ ix,iy, tmp;
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- ix = *((@typ@ *)i1);
- iy = *((@typ@ *)i2);
- if (iy == 0 || ix == 0) {
- if (iy == 0) generate_divbyzero_error();
- *((@typ@ *)op) = 0;
- }
- else if ((ix > 0) == (iy > 0)) {
- *((@typ@ *)op) = ix % iy;
- }
- else { /* handle mixed case the way Python does */
- tmp = ix % iy;
- if (tmp) tmp += iy;
- *((@typ@ *)op)= tmp;
- }
+@CTYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ @type@ d = in2r*in2r + in2i*in2i;
+ ((@type@ *)op)[0] = (in1r*in2r + in1i*in2i)/d;
+ ((@type@ *)op)[1] = (in1i*in2r - in1r*in2i)/d;
}
}
-/**end repeat**/
-/**begin repeat
- #TYPE=UBYTE,USHORT,UINT,ULONG,ULONGLONG#
- #typ=ubyte, ushort, uint, ulong, ulonglong#
-*/
static void
-@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- register @typ@ ix,iy;
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- ix = *((@typ@ *)i1);
- iy = *((@typ@ *)i2);
- if (iy == 0) {
- generate_divbyzero_error();
- *((@typ@ *)op) = 0;
- }
- *((@typ@ *)op) = ix % iy;
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ @type@ d = in2r*in2r + in2i*in2i;
+ ((@type@ *)op)[0] = floor@c@((in1r*in2r + in1i*in2i)/d);
+ ((@type@ *)op)[1] = 0;
}
}
-/**end repeat**/
-/**begin repeat
- #TYPE=FLOAT,DOUBLE,LONGDOUBLE#
- #typ=float,double,longdouble#
- #c=f,,l#
+/**begin repeat1
+ #kind = equal, not_equal#
+ #OP1 = ==, !=#
+ #OP2 = &&, ||#
*/
static void
-@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func)
-{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- @typ@ x, y, res;
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- x = *((@typ@ *)i1);
- y = *((@typ@ *)i2);
- res = fmod@c@(x, y);
- if (res && ((y < 0) != (res < 0))) {
- res += y;
- }
- *((@typ@ *)op)= res;
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+{
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ *((Bool *)op) = (in1r @OP1@ in2r) @OP2@ (in1i @OP1@ in2i);
}
}
-/**end repeat**/
-
+/**end repeat1**/
-/**begin repeat
-
- #TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#
- #typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#
-*/
+/**begin repeat1
+ * #kind= greater, greater_equal, less, less_equal#
+ * #OP = >, >=, <, <=#
+ */
static void
-@TYPE@_fmod(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- @typ@ x, y;
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- x = *((@typ@ *)i1);
- y = *((@typ@ *)i2);
- if (y == 0) {
- generate_divbyzero_error();
- *((@typ@ *)op) = 0;
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ if (in1r != in2r) {
+ *((Bool *)op) = in1r @OP@ in2r ? 1 : 0;
}
else {
- *((@typ@ *)op)= x % y;
+ *((Bool *)op) = in1i @OP@ in2i ? 1 : 0;
}
-
}
}
-/**end repeat**/
-
-/**begin repeat
-
- #TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG)*5#
- #typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong)*5#
- #OP= &*10, |*10, ^*10, <<*10, >>*10#
- #kind=bitwise_and*10, bitwise_or*10, bitwise_xor*10, left_shift*10, right_shift*10#
+/**end repeat1**/
+/**begin repeat1
+ #kind = logical_and, logical_or#
+ #OP1 = ||, ||#
+ #OP2 = &&, ||#
*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- register char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ *((Bool *)op) = (in1r @OP1@ in1i) @OP2@ (in2r @OP1@ in2i);
}
}
-/**end repeat**/
+/**end repeat1**/
-
-/**begin repeat
- #TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#
- #typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#
-*/
static void
-@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0], os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((@typ@ *)op) = ~ *((@typ@*)i1);
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ const Bool tmp1 = (in1r || in1i);
+ const Bool tmp2 = (in2r || in2i);
+ *((Bool *)op) = (tmp1 && !tmp2) || (!tmp1 && tmp2);
}
}
-/**end repeat**/
static void
-BOOL_invert(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0], os=steps[1], n=dimensions[0];
- char *i1=args[0], *op=args[1];
- for(i=0; i<n; i++, i1+=is1, op+=os) {
- *((Bool *)op) = (*((Bool *)i1) ? FALSE : TRUE);
+ UNARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ *((Bool *)op) = !(in1r || in1i);
}
}
-
-/**begin repeat
- #TYPE=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#
- #typ=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#
-
-*/
+/**begin repeat1
+ * #kind = isnan, isinf, isfinite#
+ * #func = isnan, isinf, isfinite#
+ * #OP = ||, ||, &&#
+ **/
static void
-@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((Bool *)op)=(*((@typ@ *)i1) || *((@typ@ *)i2)) && !(*((@typ@ *)i1) && *((@typ@ *)i2));
+ UNARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ *((Bool *)op) = @func@(in1r) @OP@ @func@(in1i);
}
}
-/**end repeat**/
-
+/**end repeat1**/
-/**begin repeat
- #TYPE=CFLOAT,CDOUBLE,CLONGDOUBLE#
- #typ=cfloat, cdouble, clongdouble#
-*/
static void
-@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
{
- Bool p1, p2;
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- p1 = ((@typ@ *)i1)->real || ((@typ@ *)i1)->imag;
- p2 = ((@typ@ *)i2)->real || ((@typ@ *)i2)->imag;
- *((Bool *)op)= (p1 || p2) && !(p1 && p2);
+ UNARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ ((@type@ *)op)[0] = in1r*in1r - in1i*in1i;
+ ((@type@ *)op)[1] = in1r*in1i + in1i*in1r;
}
}
-/**end repeat**/
-
-
-/**begin repeat
-
- #TYPE=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*2#
- #OP= >*14, <*14#
- #typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*2#
- #kind= maximum*14, minimum*14#
-*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- *((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2) ? *((@typ@ *)i1) : *((@typ@ *)i2);
+ UNARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ if (fabs@c@(in1i) <= fabs@c@(in1r)) {
+ const @type@ r = in1i/in1r;
+ const @type@ d = in1r + in1i*r;
+ ((@type@ *)op)[0] = 1/d;
+ ((@type@ *)op)[1] = -r/d;
+ } else {
+ const @type@ r = in1r/in1i;
+ const @type@ d = in1r*r + in1i;
+ ((@type@ *)op)[0] = r/d;
+ ((@type@ *)op)[1] = -1/d;
+ }
}
}
-/**end repeat**/
-
-/**begin repeat
- #TYPE=(CFLOAT,CDOUBLE,CLONGDOUBLE)*2#
- #OP= >*3, <*3#
- #typ=(cfloat, cdouble, clongdouble)*2#
- #kind= maximum*3, minimum*3#
-*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- @typ@ *i1c, *i2c;
- for(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- i1c = (@typ@ *)i1;
- i2c = (@typ@ *)i2;
- if ((i1c->real @OP@ i2c->real) || \
- ((i1c->real==i2c->real) && (i1c->imag @OP@ i2c->imag)))
- memmove(op, i1, sizeof(@typ@));
- else
- memmove(op, i2, sizeof(@typ@));
+ OUTPUT_LOOP {
+ ((@type@ *)op)[0] = 1;
+ ((@type@ *)op)[1] = 0;
}
}
-/**end repeat**/
-
+static void
+@CTYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) {
+ UNARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ ((@type@ *)op)[0] = in1r;
+ ((@type@ *)op)[1] = -in1i;
+ }
+}
-/*** isinf, isinf, isfinite, signbit ***/
-/**begin repeat
- #kind=isnan*3, isinf*3, isfinite*3, signbit*3#
- #TYPE=(FLOAT, DOUBLE, LONGDOUBLE)*4#
- #typ=(float, double, longdouble)*4#
- #c=(f,,l)*4#
-*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is=steps[0], os=steps[1], n=dimensions[0];
- char *ip=args[0], *op=args[1];
- for(i=0; i<n; i++, ip+=is, op+=os) {
- *((Bool *)op) = (Bool) (@kind@@c@(*((@typ@ *)ip)) != 0);
+ UNARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ *((@type@ *)op) = sqrt@c@(in1r*in1r + in1i*in1i);
}
}
-/**end repeat**/
-
-/**begin repeat
- #kind=isnan*3, isinf*3, isfinite*3#
- #TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*3#
- #typ=(float, double, longdouble)*3#
- #c=(f,,l)*3#
- #OP=||*6,&&*3#
-*/
static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is=steps[0], os=steps[1], n=dimensions[0];
- char *ip=args[0], *op=args[1];
- for(i=0; i<n; i++, ip+=is, op+=os) {
- *((Bool *)op) = @kind@@c@(((@typ@ *)ip)[0]) @OP@ \
- @kind@@c@(((@typ@ *)ip)[1]);
+ UNARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ if (in1r > 0) {
+ ((@type@ *)op)[0] = 1;
+ }
+ else if (in1r < 0) {
+ ((@type@ *)op)[0] = -1;
+ }
+ else {
+ if (in1i > 0) {
+ ((@type@ *)op)[0] = 1;
+ }
+ else if (in1i < 0) {
+ ((@type@ *)op)[0] = -1;
+ }
+ else {
+ ((@type@ *)op)[0] = 0;
+ }
+ }
+ ((@type@ *)op)[1] = 0;
}
}
-/**end repeat**/
-
-
-
-/****** modf ****/
-
-/**begin repeat
- #TYPE=FLOAT, DOUBLE, LONGDOUBLE#
- #typ=float, double, longdouble#
- #c=f,,l#
-*/
+/**begin repeat1
+ * #kind = maximum, minimum#
+ * #OP = >, <#
+ */
static void
-@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],os1=steps[1],os2=steps[2],n=dimensions[0];
- char *i1=args[0], *op1=args[1], *op2=args[2];
- @typ@ x1, y1, y2;
- for (i=0; i<n; i++, i1+=is1, op1+=os1, op2+=os2) {
- x1 = *((@typ@ *)i1);
- y1 = modf@c@(x1, &y2);
- *((@typ@ *)op1) = y1;
- *((@typ@ *)op2) = y2;
+ BINARY_LOOP {
+ const @type@ in1r = ((@type@ *)ip1)[0];
+ const @type@ in1i = ((@type@ *)ip1)[1];
+ const @type@ in2r = ((@type@ *)ip2)[0];
+ const @type@ in2i = ((@type@ *)ip2)[1];
+ if (in1r @OP@ in2r || ((in1r == in2r) && (in1i @OP@ in2i))) {
+ ((@type@ *)op)[0] = in1r;
+ ((@type@ *)op)[1] = in1i;
+ }
+ else {
+ ((@type@ *)op)[0] = in2r;
+ ((@type@ *)op)[1] = in2i;
+ }
}
}
+/**end repeat1**/
+
+#define @CTYPE@_true_divide @CTYPE@_divide
/**end repeat**/
-#define HAVE_DOUBLE_FUNCS
+/*
+ *****************************************************************************
+ ** OBJECT LOOPS **
+ *****************************************************************************
+ */
+
/**begin repeat
- #TYPE=FLOAT, DOUBLE, LONGDOUBLE#
- #typ=float, double, longdouble#
- #c=f,,l#
-*/
-#ifdef HAVE_@TYPE@_FUNCS
+ * #kind = equal, not_equal, greater, greater_equal, less, less_equal#
+ * #OP = EQ, NE, GT, GE, LT, LE#
+ */
static void
-@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *func)
-{
- register intp i;
- intp is1=steps[0],os1=steps[1],os2=steps[2],n=dimensions[0];
- char *i1=args[0], *op1=args[1], *op2=args[2];
- @typ@ x1, y1;
- int y2;
- for (i=0; i<n; i++, i1+=is1, op1+=os1, op2+=os2) {
- x1 = *((@typ@ *)i1);
- y1 = frexp@c@(x1, &y2);
- *((@typ@ *)op1) = y1;
- *((int *) op2) = y2;
+OBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) {
+ BINARY_LOOP {
+ PyObject *in1 = *(PyObject **)ip1;
+ PyObject *in2 = *(PyObject **)ip2;
+ *(Bool *)op = (Bool) PyObject_RichCompareBool(in1, in2, Py_@OP@);
}
}
+/**end repeat**/
-static void
-@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *func)
+OBJECT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
{
- register intp i;
- intp is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];
- char *i1=args[0], *i2=args[1], *op=args[2];
- @typ@ x1, y1;
- int x2;
- for (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {
- x1 = *((@typ@ *)i1);
- x2 = *((int *)i2);
- y1 = ldexp@c@(x1, x2);
- *((@typ@ *)op) = y1;
+ PyObject *zero = PyInt_FromLong(0);
+ UNARY_LOOP {
+ PyObject *in1 = *(PyObject **)ip1;
+ *(PyObject **)op = PyInt_FromLong(PyObject_Compare(in1, zero));
}
+ Py_DECREF(zero);
}
-#endif
-/**end repeat**/
-#undef HAVE_DOUBLE_FUNCS
+
+/*
+ *****************************************************************************
+ ** END LOOPS **
+ *****************************************************************************
+ */
static PyUFuncGenericFunction frexp_functions[] = {
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_FREXPF
FLOAT_frexp,
#endif
DOUBLE_frexp
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_FREXPL
,LONGDOUBLE_frexp
#endif
};
static void * blank3_data[] = { (void *)NULL, (void *)NULL, (void *)NULL};
static char frexp_signatures[] = {
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_FREXPF
PyArray_FLOAT, PyArray_FLOAT, PyArray_INT,
#endif
PyArray_DOUBLE, PyArray_DOUBLE, PyArray_INT
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_FREXPL
,PyArray_LONGDOUBLE, PyArray_LONGDOUBLE, PyArray_INT
#endif
};
static PyUFuncGenericFunction ldexp_functions[] = {
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_LDEXPF
FLOAT_ldexp,
#endif
DOUBLE_ldexp
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_LDEXPL
,LONGDOUBLE_ldexp
#endif
};
static char ldexp_signatures[] = {
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_LDEXPF
PyArray_FLOAT, PyArray_INT, PyArray_FLOAT,
#endif
PyArray_DOUBLE, PyArray_INT, PyArray_DOUBLE
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_LDEXPL
,PyArray_LONGDOUBLE, PyArray_INT, PyArray_LONGDOUBLE
#endif
};
-
#include "__umath_generated.c"
-
-
#include "ufuncobject.c"
-
#include "__ufunc_api.c"
static double
@@ -2223,10 +1550,10 @@ InitOtherOperators(PyObject *dictionary) {
PyObject *f;
int num=1;
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_FREXPL
num += 1;
#endif
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_FREXPF
num += 1;
#endif
f = PyUFunc_FromFuncAndData(frexp_functions, blank3_data,
@@ -2237,6 +1564,13 @@ InitOtherOperators(PyObject *dictionary) {
PyDict_SetItemString(dictionary, "frexp", f);
Py_DECREF(f);
+ num = 1;
+#ifdef HAVE_LDEXPL
+ num += 1;
+#endif
+#ifdef HAVE_LDEXPF
+ num += 1;
+#endif
f = PyUFunc_FromFuncAndData(ldexp_functions, blank3_data, ldexp_signatures, num,
2, 1, PyUFunc_None, "ldexp",
"Compute y = x1 * 2**x2.",0);
@@ -2252,7 +1586,7 @@ static struct PyMethodDef methods[] = {
METH_VARARGS, NULL},
{"geterrobj", (PyCFunction) ufunc_geterr,
METH_VARARGS, NULL},
- {NULL, NULL, 0} /* sentinel */
+ {NULL, NULL, 0, NULL} /* sentinel */
};
PyMODINIT_FUNC initumath(void) {
@@ -2352,6 +1686,7 @@ PyMODINIT_FUNC initumath(void) {
PyDict_SetItemString(d, "mod", s2);
return;
+
err:
/* Check for errors */
if (!PyErr_Occurred()) {
diff --git a/numpy/core/tests/test_memmap.py b/numpy/core/tests/test_memmap.py
index 9d940ede9..2b8f276e3 100644
--- a/numpy/core/tests/test_memmap.py
+++ b/numpy/core/tests/test_memmap.py
@@ -2,7 +2,7 @@ from tempfile import NamedTemporaryFile, mktemp
import os
import warnings
-from numpy.core import memmap
+from numpy import memmap
from numpy import arange, allclose
from numpy.testing import *
@@ -45,6 +45,21 @@ class TestMemmap(TestCase):
fp.sync()
warnings.simplefilter('default', DeprecationWarning)
+ def test_del(self):
+ # Make sure a view does not delete the underlying mmap
+ fp_base = memmap(self.tmpfp, dtype=self.dtype, mode='w+',
+ shape=self.shape)
+ fp_view = fp_base[:]
+ class ViewCloseError(Exception):
+ pass
+ _close = memmap._close
+ def replace_close(self):
+ raise ViewCloseError('View should not call _close on memmap')
+ try:
+ memmap._close = replace_close
+ del fp_view
+ finally:
+ memmap._close = _close
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index 50a02058e..ccfbe354c 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -946,6 +946,26 @@ class TestSummarization(TestCase):
assert repr(A) == reprA
+class TestChoose(TestCase):
+ def setUp(self):
+ self.x = 2*ones((3,),dtype=int)
+ self.y = 3*ones((3,),dtype=int)
+ self.x2 = 2*ones((2,3), dtype=int)
+ self.y2 = 3*ones((2,3), dtype=int)
+ self.ind = [0,0,1]
+
+ def test_basic(self):
+ A = np.choose(self.ind, (self.x, self.y))
+ assert_equal(A, [2,2,3])
+
+ def test_broadcast1(self):
+ A = np.choose(self.ind, (self.x2, self.y2))
+ assert_equal(A, [[2,2,3],[2,2,3]])
+
+ def test_broadcast2(self):
+ A = np.choose(self.ind, (self.x, self.y2))
+ assert_equal(A, [[2,2,3],[2,2,3]])
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index b104b888c..c6ba51b3e 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -87,7 +87,6 @@ class TestRegression(TestCase):
def test_char_dump(self,level=rlevel):
"""Ticket #50"""
- import tempfile
f = StringIO()
ca = np.char.array(np.arange(1000,1010),itemsize=4)
ca.dump(f)
@@ -623,8 +622,8 @@ class TestRegression(TestCase):
def test_convolve_empty(self, level=rlevel):
"""Convolve should raise an error for empty input array."""
- self.failUnlessRaises(AssertionError,np.convolve,[],[1])
- self.failUnlessRaises(AssertionError,np.convolve,[1],[])
+ self.failUnlessRaises(ValueError,np.convolve,[],[1])
+ self.failUnlessRaises(ValueError,np.convolve,[1],[])
def test_multidim_byteswap(self, level=rlevel):
"""Ticket #449"""
@@ -843,6 +842,12 @@ class TestRegression(TestCase):
"""Ticket #658"""
np.indices((0,3,4)).T.reshape(-1,3)
+ def test_copy_detection_corner_case2(self, level=rlevel):
+ """Ticket #771: strides are not set correctly when reshaping 0-sized
+ arrays"""
+ b = np.indices((0,3,4)).T.reshape(-1,3)
+ assert_equal(b.strides, (3 * b.itemsize, b.itemsize))
+
def test_object_array_refcounting(self, level=rlevel):
"""Ticket #633"""
if not hasattr(sys, 'getrefcount'):
@@ -1184,5 +1189,24 @@ class TestRegression(TestCase):
assert a.dtype.names[0] == "notfoo"
assert a.dtype.names[1] == "bar"
+ def test_for_object_scalar_creation(self, level=rlevel):
+ """Ticket #816"""
+ a = np.object_()
+ b = np.object_(3)
+ b2 = np.object_(3.0)
+ c = np.object_([4,5])
+ d = np.object_([None, {}, []])
+ assert a is None
+ assert type(b) is int
+ assert type(b2) is float
+ assert type(c) is np.ndarray
+ assert c.dtype == object
+ assert d.dtype == object
+
+ def test_for_zero_length_in_choose(self, level=rlevel):
+ "Ticket #882"
+ a = np.array(1)
+ self.failUnlessRaises(ValueError, lambda x: x.choose([]), a)
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_scalarmath.py b/numpy/core/tests/test_scalarmath.py
index bb1ada66b..6001f6b72 100644
--- a/numpy/core/tests/test_scalarmath.py
+++ b/numpy/core/tests/test_scalarmath.py
@@ -1,5 +1,4 @@
from numpy.testing import *
-import numpy.core.umath as ncu
import numpy as np
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc,
@@ -77,7 +76,6 @@ class TestConversion(TestCase):
class TestRepr(TestCase):
def test_float_repr(self):
- from numpy import nan, inf
for t in [np.float32, np.float64, np.longdouble]:
if t is np.longdouble: # skip it for now.
continue
diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py
index 75bb1e2c2..73766ef58 100644
--- a/numpy/core/tests/test_ufunc.py
+++ b/numpy/core/tests/test_ufunc.py
@@ -183,6 +183,7 @@ class TestUfunc(TestCase):
n 1 log1p flts + M
n 1 sqrt flts + M real x < 0 raises error
n 1 ceil real + M
+ n 1 trunc real + M
n 1 floor real + M
n 1 fabs real + M
n 1 rint flts + M
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index 71a79c9c9..ee2893f18 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -1,8 +1,6 @@
from numpy.testing import *
import numpy.core.umath as ncu
import numpy as np
-import nose
-from numpy import inf, nan, pi
class TestDivision(TestCase):
def test_division_int(self):
@@ -207,9 +205,9 @@ class TestComplexFunctions(object):
def test_branch_cuts(self):
# check branch cuts and continuity on them
- yield _check_branch_cut, np.log, -0.5, 1j, 1, -1, True
- yield _check_branch_cut, np.log10, -0.5, 1j, 1, -1, True
- yield _check_branch_cut, np.log1p, -1.5, 1j, 1, -1, True
+ yield _check_branch_cut, np.log, -0.5, 1j, 1, -1
+ yield _check_branch_cut, np.log10, -0.5, 1j, 1, -1
+ yield _check_branch_cut, np.log1p, -1.5, 1j, 1, -1
yield _check_branch_cut, np.sqrt, -0.5, 1j, 1, -1
yield _check_branch_cut, np.arcsin, [ -2, 2], [1j, -1j], 1, -1
@@ -229,7 +227,13 @@ class TestComplexFunctions(object):
yield _check_branch_cut, np.arccosh, [-2j, 2j, 2], [1, 1, 1j], 1, 1
yield _check_branch_cut, np.arctanh, [-2j, 2j, 0], [1, 1, 1j], 1, 1
+ @dec.knownfailureif(True, "These branch cuts are known to fail")
def test_branch_cuts_failing(self):
+ # XXX: signed zero not OK with ICC on 64-bit platform for log, see
+ # http://permalink.gmane.org/gmane.comp.python.numeric.general/25335
+ yield _check_branch_cut, np.log, -0.5, 1j, 1, -1, True
+ yield _check_branch_cut, np.log10, -0.5, 1j, 1, -1, True
+ yield _check_branch_cut, np.log1p, -1.5, 1j, 1, -1, True
# XXX: signed zeros are not OK for sqrt or for the arc* functions
yield _check_branch_cut, np.sqrt, -0.5, 1j, 1, -1, True
yield _check_branch_cut, np.arcsin, [ -2, 2], [1j, -1j], 1, -1, True
@@ -238,7 +242,6 @@ class TestComplexFunctions(object):
yield _check_branch_cut, np.arcsinh, [-2j, 2j], [-1, 1], -1, 1, True
yield _check_branch_cut, np.arccosh, [ -1, 0.5], [1j, 1j], 1, -1, True
yield _check_branch_cut, np.arctanh, [ -2, 2], [1j, -1j], 1, -1, True
- test_branch_cuts_failing = dec.skipknownfailure(test_branch_cuts_failing)
def test_against_cmath(self):
import cmath, sys
@@ -271,13 +274,23 @@ class TestAttributes(TestCase):
def test_attributes(self):
add = ncu.add
assert_equal(add.__name__, 'add')
- assert add.__doc__.startswith('y = add(x1,x2)\n\n')
+ assert add.__doc__.startswith('add(x1, x2[, out])\n\n')
self.failUnless(add.ntypes >= 18) # don't fail if types added
self.failUnless('ii->i' in add.types)
assert_equal(add.nin, 2)
assert_equal(add.nout, 1)
assert_equal(add.identity, 0)
+class TestSubclass(TestCase):
+ def test_subclass_op(self):
+ class simple(np.ndarray):
+ def __new__(subtype, shape):
+ self = np.ndarray.__new__(subtype, shape, dtype=object)
+ self.fill(0)
+ return self
+ a = simple((3,4))
+ assert_equal(a+a, a)
+
def _check_branch_cut(f, x0, dx, re_sign=1, im_sign=-1, sig_zero_ok=False,
dtype=np.complex):
"""
diff --git a/numpy/distutils/command/build.py b/numpy/distutils/command/build.py
index 2f5dc31ab..5d986570c 100644
--- a/numpy/distutils/command/build.py
+++ b/numpy/distutils/command/build.py
@@ -34,7 +34,4 @@ class build(old_build):
'scripts' + plat_specifier)
def run(self):
- # Make sure that scons based extensions are complete.
- self.run_command('scons')
-
old_build.run(self)
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py
index 68d0aff7f..3092167c6 100644
--- a/numpy/distutils/command/build_ext.py
+++ b/numpy/distutils/command/build_ext.py
@@ -217,6 +217,12 @@ class build_ext (old_build_ext):
# Build extensions
self.build_extensions()
+ # Make sure that scons based extensions are complete.
+ if self.inplace:
+ cmd = self.reinitialize_command('scons')
+ cmd.inplace = 1
+ self.run_command('scons')
+
def swig_sources(self, sources):
# Do nothing. Swig sources have beed handled in build_src command.
return sources
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py
index ce42a36e0..60900f721 100644
--- a/numpy/distutils/command/config.py
+++ b/numpy/distutils/command/config.py
@@ -125,7 +125,14 @@ int main()
self._check_compiler()
body = []
if decl:
- body.append("int %s ();" % func)
+ body.append("int %s (void);" % func)
+ # Handle MSVC intrisincs: force MS compiler to make a function call.
+ # Useful to test for some functions when built with optimization on, to
+ # avoid build error because the intrisinc and our 'fake' test
+ # declaration do not match.
+ body.append("#ifdef _MSC_VER")
+ body.append("#pragma function(%s)" % func)
+ body.append("#endif")
body.append("int main (void) {")
if call:
if call_args is None:
@@ -140,6 +147,67 @@ int main()
return self.try_link(body, headers, include_dirs,
libraries, library_dirs)
+ def check_funcs_once(self, funcs,
+ headers=None, include_dirs=None,
+ libraries=None, library_dirs=None,
+ decl=False, call=False, call_args=None):
+ """Check a list of functions at once.
+
+ This is useful to speed up things, since all the functions in the funcs
+ list will be put in one compilation unit.
+
+ Arguments
+ ---------
+
+ funcs: seq
+ list of functions to test
+ include_dirs : seq
+ list of header paths
+ libraries : seq
+ list of libraries to link the code snippet to
+ libraru_dirs : seq
+ list of library paths
+ decl : dict
+ for every (key, value), the declaration in the value will be
+ used for function in key. If a function is not in the
+ dictionay, no declaration will be used.
+ call : dict
+ for every item (f, value), if the value is True, a call will be
+ done to the function f"""
+ self._check_compiler()
+ body = []
+ if decl:
+ for f, v in decl.items():
+ if v:
+ body.append("int %s (void);" % f)
+
+ # Handle MS intrinsics. See check_func for more info.
+ body.append("#ifdef _MSC_VER")
+ for func in funcs:
+ body.append("#pragma function(%s)" % func)
+ body.append("#endif")
+
+ body.append("int main (void) {")
+ if call:
+ for f in funcs:
+ if call.has_key(f) and call[f]:
+ if not (call_args and call_args.has_key(f) and call_args[f]):
+ args = ''
+ else:
+ args = call_args[f]
+ body.append(" %s(%s);" % (f, args))
+ else:
+ body.append(" %s;" % f)
+ else:
+ for f in funcs:
+ body.append(" %s;" % f)
+ body.append(" return 0;")
+ body.append("}")
+ body = '\n'.join(body) + "\n"
+
+ return self.try_link(body, headers, include_dirs,
+ libraries, library_dirs)
+
def get_output(self, body, headers=None, include_dirs=None,
libraries=None, library_dirs=None,
lang="c"):
diff --git a/numpy/distutils/command/install.py b/numpy/distutils/command/install.py
index 36e6b5a66..87b549da8 100644
--- a/numpy/distutils/command/install.py
+++ b/numpy/distutils/command/install.py
@@ -1,8 +1,10 @@
import sys
if 'setuptools' in sys.modules:
import setuptools.command.install as old_install_mod
+ have_setuptools = True
else:
import distutils.command.install as old_install_mod
+ have_setuptools = False
old_install = old_install_mod.install
from distutils.file_util import write_file
@@ -12,8 +14,41 @@ class install(old_install):
old_install.finalize_options(self)
self.install_lib = self.install_libbase
+ def setuptools_run(self):
+ """ The setuptools version of the .run() method.
+
+ We must pull in the entire code so we can override the level used in the
+ _getframe() call since we wrap this call by one more level.
+ """
+ # Explicit request for old-style install? Just do it
+ if self.old_and_unmanageable or self.single_version_externally_managed:
+ return old_install_mod._install.run(self)
+
+ # Attempt to detect whether we were called from setup() or by another
+ # command. If we were called by setup(), our caller will be the
+ # 'run_command' method in 'distutils.dist', and *its* caller will be
+ # the 'run_commands' method. If we were called any other way, our
+ # immediate caller *might* be 'run_command', but it won't have been
+ # called by 'run_commands'. This is slightly kludgy, but seems to
+ # work.
+ #
+ caller = sys._getframe(3)
+ caller_module = caller.f_globals.get('__name__','')
+ caller_name = caller.f_code.co_name
+
+ if caller_module != 'distutils.dist' or caller_name!='run_commands':
+ # We weren't called from the command line or setup(), so we
+ # should run in backward-compatibility mode to support bdist_*
+ # commands.
+ old_install_mod._install.run(self)
+ else:
+ self.do_egg_install()
+
def run(self):
- r = old_install.run(self)
+ if not have_setuptools:
+ r = old_install.run(self)
+ else:
+ r = self.setuptools_run()
if self.record:
# bdist_rpm fails when INSTALLED_FILES contains
# paths with spaces. Such paths must be enclosed
diff --git a/numpy/distutils/command/scons.py b/numpy/distutils/command/scons.py
index e183f001b..d5303bb29 100644
--- a/numpy/distutils/command/scons.py
+++ b/numpy/distutils/command/scons.py
@@ -44,11 +44,12 @@ def get_scons_local_path():
from numscons import get_scons_path
return get_scons_path()
-def get_distutils_libdir(cmd, sconscript_path):
+def get_distutils_libdir(cmd, pkg):
"""Returns the path where distutils install libraries, relatively to the
scons build directory."""
from numscons import get_scons_build_dir
- scdir = pjoin(get_scons_build_dir(), pdirname(sconscript_path))
+ from numscons.core.utils import pkg_to_path
+ scdir = pjoin(get_scons_build_dir(), pkg_to_path(pkg))
n = scdir.count(os.sep)
return pjoin(os.sep.join([os.pardir for i in range(n+1)]), cmd.build_lib)
@@ -287,11 +288,11 @@ class scons(old_build_ext):
self.post_hooks = []
self.pkg_names = []
- # To avoid trouble, just don't do anything if no sconscripts are used.
- # This is useful when for example f2py uses numpy.distutils, because
- # f2py does not pass compiler information to scons command, and the
- # compilation setup below can crash in some situation.
- if len(self.sconscripts) > 0:
+ # To avoid trouble, just don't do anything if no sconscripts are used.
+ # This is useful when for example f2py uses numpy.distutils, because
+ # f2py does not pass compiler information to scons command, and the
+ # compilation setup below can crash in some situation.
+ if len(self.sconscripts) > 0:
# Try to get the same compiler than the ones used by distutils: this is
# non trivial because distutils and scons have totally different
# conventions on this one (distutils uses PATH from user's environment,
@@ -359,7 +360,7 @@ class scons(old_build_ext):
"this package " % str(e))
try:
- minver = "0.9.1"
+ minver = "0.9.3"
from numscons import get_version
if get_version() < minver:
raise ValueError()
@@ -424,7 +425,7 @@ class scons(old_build_ext):
#cmd.append('distutils_libdir=%s' % protect_path(pjoin(self.build_lib,
# pdirname(sconscript))))
cmd.append('distutils_libdir=%s' %
- protect_path(get_distutils_libdir(self, sconscript)))
+ protect_path(get_distutils_libdir(self, pkg_name)))
if not self._bypass_distutils_cc:
cmd.append('cc_opt=%s' % self.scons_compiler)
diff --git a/numpy/distutils/conv_template.py b/numpy/distutils/conv_template.py
index 01d7b6718..f8a01c797 100644
--- a/numpy/distutils/conv_template.py
+++ b/numpy/distutils/conv_template.py
@@ -128,19 +128,22 @@ def paren_repl(obj):
numrep = obj.group(2)
return ','.join([torep]*int(numrep))
-parenrep = re.compile(r"[(]([^)]*?)[)]\*(\d+)")
+parenrep = re.compile(r"[(]([^)]*)[)]\*(\d+)")
plainrep = re.compile(r"([^*]+)\*(\d+)")
-def conv(astr):
+def parse_values(astr):
# replaces all occurrences of '(a,b,c)*4' in astr
- # with 'a,b,c,a,b,c,a,b,c,a,b,c'. The result is
+ # with 'a,b,c,a,b,c,a,b,c,a,b,c'. Empty braces generate
+ # empty values, i.e., ()*4 yields ',,,'. The result is
# split at ',' and a list of values returned.
- astr = parenrep.sub(paren_repl,astr)
+ astr = parenrep.sub(paren_repl, astr)
# replaces occurences of xxx*3 with xxx, xxx, xxx
astr = ','.join([plainrep.sub(paren_repl,x.strip())
for x in astr.split(',')])
return astr.split(',')
-named_re = re.compile(r"#\s*([\w]*)\s*=\s*([^#]*)#")
+
+stripast = re.compile(r"\n\s*\*?")
+named_re = re.compile(r"#\s*(\w*)\s*=([^#]*)#")
def parse_loop_header(loophead) :
"""Find all named replacements in the header
@@ -149,23 +152,29 @@ def parse_loop_header(loophead) :
value is the replacement string.
"""
+ # Strip out '\n' and leading '*', if any, in continuation lines.
+ # This should not effect code previous to this change as
+ # continuation lines were not allowed.
+ loophead = stripast.sub("", loophead)
# parse out the names and lists of values
names = []
reps = named_re.findall(loophead)
nsub = None
for rep in reps:
- name = rep[0].strip()
- vals = conv(rep[1])
+ name = rep[0]
+ vals = parse_values(rep[1])
size = len(vals)
if nsub is None :
nsub = size
elif nsub != size :
- msg = "Mismatch in number: %s - %s" % (name, vals)
+ msg = "Mismatch in number of values:\n%s = %s" % (name, vals)
raise ValueError, msg
names.append((name,vals))
# generate list of dictionaries, one for each template iteration
dlist = []
+ if nsub is None :
+ raise ValueError, "No substitution variables found"
for i in range(nsub) :
tmp = {}
for name,vals in names :
@@ -183,8 +192,8 @@ def parse_string(astr, env, level, line) :
try :
val = env[name]
except KeyError, e :
- msg = '%s: %s'%(lineno, e)
- raise KeyError, msg
+ msg = 'line %d: %s'%(line, e)
+ raise ValueError, msg
return val
code = [lineno]
@@ -203,7 +212,7 @@ def parse_string(astr, env, level, line) :
try :
envlist = parse_loop_header(head)
except ValueError, e :
- msg = "%s: %s" % (lineno, e)
+ msg = "line %d: %s" % (newline, e)
raise ValueError, msg
for newenv in envlist :
newenv.update(env)
@@ -249,7 +258,10 @@ def resolve_includes(source):
def process_file(source):
lines = resolve_includes(source)
sourcefile = os.path.normcase(source).replace("\\","\\\\")
- code = process_str(''.join(lines))
+ try:
+ code = process_str(''.join(lines))
+ except ValueError, e:
+ raise ValueError, '"%s", %s' % (sourcefile, e)
return '#line 1 "%s"\n%s' % (sourcefile, code)
@@ -284,5 +296,8 @@ if __name__ == "__main__":
outfile = open(newname,'w')
allstr = fid.read()
- writestr = process_str(allstr)
+ try:
+ writestr = process_str(allstr)
+ except ValueError, e:
+ raise ValueError, "file %s, %s" % (file, e)
outfile.write(writestr)
diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py
index 039d6fba8..43a5f681d 100644
--- a/numpy/distutils/fcompiler/__init__.py
+++ b/numpy/distutils/fcompiler/__init__.py
@@ -129,7 +129,7 @@ class FCompiler(CCompiler):
arch = ('flags.arch', 'FARCH', 'arch', flaglist),
arch_f77 = ('flags.arch_f77', None, None, flaglist),
arch_f90 = ('flags.arch_f90', None, None, flaglist),
- debug = ('flags.debug', 'FDEBUG', 'fdebug', None, flaglist),
+ debug = ('flags.debug', 'FDEBUG', 'fdebug', flaglist),
debug_f77 = ('flags.debug_f77', None, None, flaglist),
debug_f90 = ('flags.debug_f90', None, None, flaglist),
flags = ('self.get_flags', 'FFLAGS', 'fflags', flaglist),
diff --git a/numpy/distutils/tests/test_misc_util.py b/numpy/distutils/tests/test_misc_util.py
index 6130d0eea..6a671a931 100644
--- a/numpy/distutils/tests/test_misc_util.py
+++ b/numpy/distutils/tests/test_misc_util.py
@@ -1,10 +1,8 @@
#!/usr/bin/env python
-import os
-import sys
from numpy.testing import *
from numpy.distutils.misc_util import appendpath, minrelpath, gpaths, rel_path
-from os.path import join, sep
+from os.path import join, sep, dirname
ajoin = lambda *paths: join(*((sep,)+paths))
@@ -35,8 +33,7 @@ class TestAppendpath(TestCase):
class TestMinrelpath(TestCase):
def test_1(self):
- import os
- n = lambda path: path.replace('/',os.path.sep)
+ n = lambda path: path.replace('/',sep)
assert_equal(minrelpath(n('aa/bb')),n('aa/bb'))
assert_equal(minrelpath('..'),'..')
assert_equal(minrelpath(n('aa/..')),'')
@@ -50,11 +47,11 @@ class TestMinrelpath(TestCase):
class TestGpaths(TestCase):
def test_gpaths(self):
- local_path = minrelpath(os.path.join(os.path.dirname(__file__),'..'))
+ local_path = minrelpath(join(dirname(__file__),'..'))
ls = gpaths('command/*.py', local_path)
- assert os.path.join(local_path,'command','build_src.py') in ls,`ls`
+ assert join(local_path,'command','build_src.py') in ls,`ls`
f = gpaths('system_info.py', local_path)
- assert os.path.join(local_path,'system_info.py')==f[0],`f`
+ assert join(local_path,'system_info.py')==f[0],`f`
if __name__ == "__main__":
diff --git a/numpy/doc/CAPI.txt b/numpy/doc/CAPI.txt
deleted file mode 100644
index 28738635e..000000000
--- a/numpy/doc/CAPI.txt
+++ /dev/null
@@ -1,313 +0,0 @@
-===============
-C-API for NumPy
-===============
-
-:Author: Travis Oliphant
-:Discussions to: `numpy-discussion@scipy.org`__
-:Created: October 2005
-
-__ http://www.scipy.org/Mailing_Lists
-
-The C API of NumPy is (mostly) backward compatible with Numeric.
-
-There are a few non-standard Numeric usages (that were not really part
-of the API) that will need to be changed:
-
-* If you used any of the function pointers in the ``PyArray_Descr``
- structure you will have to modify your usage of those. First,
- the pointers are all under the member named ``f``. So ``descr->cast``
- is now ``descr->f->cast``. In addition, the
- casting functions have eliminated the strides argument (use
- ``PyArray_CastTo`` if you need strided casting). All functions have
- one or two ``PyArrayObject *`` arguments at the end. This allows the
- flexible arrays and mis-behaved arrays to be handled.
-
-* The ``descr->zero`` and ``descr->one`` constants have been replaced with
- function calls, ``PyArray_Zero``, and ``PyArray_One`` (be sure to read the
- code and free the resulting memory if you use these calls).
-
-* If you passed ``array->dimensions`` and ``array->strides`` around
- to functions, you will need to fix some code. These are now
- ``npy_intp*`` pointers. On 32-bit systems there won't be a problem.
- However, on 64-bit systems, you will need to make changes to avoid
- errors and segfaults.
-
-
-The header files ``arrayobject.h`` and ``ufuncobject.h`` contain many defines
-that you may find useful. The files ``__ufunc_api.h`` and
-``__multiarray_api.h`` contain the available C-API function calls with
-their function signatures.
-
-All of these headers are installed to
-``<YOUR_PYTHON_LOCATION>/site-packages/numpy/core/include``
-
-
-Getting arrays in C-code
-=========================
-
-All new arrays can be created using ``PyArray_NewFromDescr``. A simple interface
-equivalent to ``PyArray_FromDims`` is ``PyArray_SimpleNew(nd, dims, typenum)``
-and to ``PyArray_FromDimsAndData`` is
-``PyArray_SimpleNewFromData(nd, dims, typenum, data)``.
-
-This is a very flexible function.
-
-::
-
- PyObject * PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr,
- int nd, npy_intp *dims,
- npy_intp *strides, char *data,
- int flags, PyObject *obj);
-
-``subtype`` : ``PyTypeObject *``
- The subtype that should be created (either pass in
- ``&PyArray_Type``, ``&PyBigArray_Type``, or ``obj->ob_type``,
- where ``obj`` is a an instance of a subtype (or subclass) of
- ``PyArray_Type`` or ``PyBigArray_Type``).
-
-``descr`` : ``PyArray_Descr *``
- The type descriptor for the array. This is a Python object (this
- function steals a reference to it). The easiest way to get one is
- using ``PyArray_DescrFromType(<typenum>)``. If you want to use a
- flexible size array, then you need to use
- ``PyArray_DescrNewFromType(<flexible typenum>)`` and set its ``elsize``
- paramter to the desired size. The typenum in both of these cases
- is one of the ``PyArray_XXXX`` enumerated types.
-
-``nd`` : ``int``
- The number of dimensions (<``MAX_DIMS``)
-
-``*dims`` : ``npy_intp *``
- A pointer to the size in each dimension. Information will be
- copied from here.
-
-``*strides`` : ``npy_intp *``
- The strides this array should have. For new arrays created by this
- routine, this should be ``NULL``. If you pass in memory for this array
- to use, then you can pass in the strides information as well
- (otherwise it will be created for you and default to C-contiguous
- or Fortran contiguous). Any strides will be copied into the array
- structure. Do not pass in bad strides information!!!!
-
- ``PyArray_CheckStrides(...)`` can help but you must call it if you are
- unsure. You cannot pass in strides information when data is ``NULL``
- and this routine is creating its own memory.
-
-``*data`` : ``char *``
- ``NULL`` for creating brand-new memory. If you want this array to wrap
- another memory area, then pass the pointer here. You are
- responsible for deleting the memory in that case, but do not do so
- until the new array object has been deleted. The best way to
- handle that is to get the memory from another Python object,
- ``INCREF`` that Python object after passing it's data pointer to this
- routine, and set the ``->base`` member of the returned array to the
- Python object. *You are responsible for* setting ``PyArray_BASE(ret)``
- to the base object. Failure to do so will create a memory leak.
-
- If you pass in a data buffer, the ``flags`` argument will be the flags
- of the new array. If you create a new array, a non-zero flags
- argument indicates that you want the array to be in Fortran order.
-
-``flags`` : ``int``
- Either the flags showing how to interpret the data buffer passed
- in, or if a new array is created, nonzero to indicate a Fortran
- order array. See below for an explanation of the flags.
-
-``obj`` : ``PyObject *``
- If subtypes is ``&PyArray_Type`` or ``&PyBigArray_Type``, this argument is
- ignored. Otherwise, the ``__array_finalize__`` method of the subtype
- is called (if present) and passed this object. This is usually an
- array of the type to be created (so the ``__array_finalize__`` method
- must handle an array argument. But, it can be anything...)
-
-Note: The returned array object will be unitialized unless the type is
-``PyArray_OBJECT`` in which case the memory will be set to ``NULL``.
-
-``PyArray_SimpleNew(nd, dims, typenum)`` is a drop-in replacement for
-``PyArray_FromDims`` (except it takes ``npy_intp*`` dims instead of ``int*`` dims
-which matters on 64-bit systems) and it does not initialize the memory
-to zero.
-
-``PyArray_SimpleNew`` is just a macro for ``PyArray_New`` with default arguments.
-Use ``PyArray_FILLWBYTE(arr, 0)`` to fill with zeros.
-
-The ``PyArray_FromDims`` and family of functions are still available and
-are loose wrappers around this function. These functions still take
-``int *`` arguments. This should be fine on 32-bit systems, but on 64-bit
-systems you may run into trouble if you frequently passed
-``PyArray_FromDims`` the dimensions member of the old ``PyArrayObject`` structure
-because ``sizeof(npy_intp) != sizeof(int)``.
-
-
-Getting an arrayobject from an arbitrary Python object
-======================================================
-
-``PyArray_FromAny(...)``
-
-This function replaces ``PyArray_ContiguousFromObject`` and friends (those
-function calls still remain but they are loose wrappers around the
-``PyArray_FromAny`` call).
-
-::
-
- static PyObject *
- PyArray_FromAny(PyObject *op, PyArray_Descr *dtype, int min_depth,
- int max_depth, int requires, PyObject *context)
-
-
-``op`` : ``PyObject *``
- The Python object to "convert" to an array object
-
-``dtype`` : ``PyArray_Descr *``
- The desired data-type descriptor. This can be ``NULL``, if the
- descriptor should be determined by the object. Unless ``FORCECAST`` is
- present in ``flags``, this call will generate an error if the data
- type cannot be safely obtained from the object.
-
-``min_depth`` : ``int``
- The minimum depth of array needed or 0 if doesn't matter
-
-``max_depth`` : ``int``
- The maximum depth of array allowed or 0 if doesn't matter
-
-``requires`` : ``int``
- A flag indicating the "requirements" of the returned array. These
- are the usual ndarray flags (see `NDArray flags`_ below). In
- addition, there are three flags used only for the ``FromAny``
- family of functions:
-
- - ``ENSURECOPY``: always copy the array. Returned arrays always
- have ``CONTIGUOUS``, ``ALIGNED``, and ``WRITEABLE`` set.
- - ``ENSUREARRAY``: ensure the returned array is an ndarray (or a
- bigndarray if ``op`` is one).
- - ``FORCECAST``: cause a cast to occur regardless of whether or
- not it is safe.
-
-``context`` : ``PyObject *``
- If the Python object ``op`` is not an numpy array, but has an
- ``__array__`` method, context is passed as the second argument to
- that method (the first is the typecode). Almost always this
- parameter is ``NULL``.
-
-
-``PyArray_ContiguousFromAny(op, typenum, min_depth, max_depth)`` is
-equivalent to ``PyArray_ContiguousFromObject(...)`` (which is still
-available), except it will return the subclass if op is already a
-subclass of the ndarray. The ``ContiguousFromObject`` version will
-always return an ndarray (or a bigndarray).
-
-Passing Data Type information to C-code
-=======================================
-
-All datatypes are handled using the ``PyArray_Descr *`` structure.
-This structure can be obtained from a Python object using
-``PyArray_DescrConverter`` and ``PyArray_DescrConverter2``. The former
-returns the default ``PyArray_LONG`` descriptor when the input object
-is None, while the latter returns ``NULL`` when the input object is ``None``.
-
-See the ``arraymethods.c`` and ``multiarraymodule.c`` files for many
-examples of usage.
-
-Getting at the structure of the array.
---------------------------------------
-
-You should use the ``#defines`` provided to access array structure portions:
-
-- ``PyArray_DATA(obj)`` : returns a ``void *`` to the array data
-- ``PyArray_BYTES(obj)`` : return a ``char *`` to the array data
-- ``PyArray_ITEMSIZE(obj)``
-- ``PyArray_NDIM(obj)``
-- ``PyArray_DIMS(obj)``
-- ``PyArray_DIM(obj, n)``
-- ``PyArray_STRIDES(obj)``
-- ``PyArray_STRIDE(obj,n)``
-- ``PyArray_DESCR(obj)``
-- ``PyArray_BASE(obj)``
-
-see more in ``arrayobject.h``
-
-
-NDArray Flags
-=============
-
-The ``flags`` attribute of the ``PyArrayObject`` structure contains important
-information about the memory used by the array (pointed to by the data member)
-This flags information must be kept accurate or strange results and even
-segfaults may result.
-
-There are 6 (binary) flags that describe the memory area used by the
-data buffer. These constants are defined in ``arrayobject.h`` and
-determine the bit-position of the flag. Python exposes a nice attribute-
-based interface as well as a dictionary-like interface for getting
-(and, if appropriate, setting) these flags.
-
-Memory areas of all kinds can be pointed to by an ndarray, necessitating
-these flags. If you get an arbitrary ``PyArrayObject`` in C-code,
-you need to be aware of the flags that are set.
-If you need to guarantee a certain kind of array
-(like ``NPY_CONTIGUOUS`` and ``NPY_BEHAVED``), then pass these requirements into the
-PyArray_FromAny function.
-
-
-``NPY_CONTIGUOUS``
- True if the array is (C-style) contiguous in memory.
-``NPY_FORTRAN``
- True if the array is (Fortran-style) contiguous in memory.
-
-Notice that contiguous 1-d arrays are always both ``NPY_FORTRAN`` contiguous
-and C contiguous. Both of these flags can be checked and are convenience
-flags only as whether or not an array is ``NPY_CONTIGUOUS`` or ``NPY_FORTRAN``
-can be determined by the ``strides``, ``dimensions``, and ``itemsize``
-attributes.
-
-``NPY_OWNDATA``
- True if the array owns the memory (it will try and free it using
- ``PyDataMem_FREE()`` on deallocation --- so it better really own it).
-
-These three flags facilitate using a data pointer that is a memory-mapped
-array, or part of some larger record array. But, they may have other uses...
-
-``NPY_ALIGNED``
- True if the data buffer is aligned for the type and the strides
- are multiples of the alignment factor as well. This can be
- checked.
-
-``NPY_WRITEABLE``
- True only if the data buffer can be "written" to.
-
-``NPY_UPDATEIFCOPY``
- This is a special flag that is set if this array represents a copy
- made because a user required certain flags in ``PyArray_FromAny`` and
- a copy had to be made of some other array (and the user asked for
- this flag to be set in such a situation). The base attribute then
- points to the "misbehaved" array (which is set read_only). When
- the array with this flag set is deallocated, it will copy its
- contents back to the "misbehaved" array (casting if necessary) and
- will reset the "misbehaved" array to ``WRITEABLE``. If the
- "misbehaved" array was not ``WRITEABLE`` to begin with then
- ``PyArray_FromAny`` would have returned an error because ``UPDATEIFCOPY``
- would not have been possible.
-
-
-``PyArray_UpdateFlags(obj, flags)`` will update the ``obj->flags`` for
-``flags`` which can be any of ``NPY_CONTIGUOUS``, ``NPY_FORTRAN``, ``NPY_ALIGNED``, or
-``NPY_WRITEABLE``.
-
-Some useful combinations of these flags:
-
-- ``NPY_BEHAVED = NPY_ALIGNED | NPY_WRITEABLE``
-- ``NPY_CARRAY = NPY_DEFAULT = NPY_CONTIGUOUS | NPY_BEHAVED``
-- ``NPY_CARRAY_RO = NPY_CONTIGUOUS | NPY_ALIGNED``
-- ``NPY_FARRAY = NPY_FORTRAN | NPY_BEHAVED``
-- ``NPY_FARRAY_RO = NPY_FORTRAN | NPY_ALIGNED``
-
-The macro ``PyArray_CHECKFLAGS(obj, flags)`` can test any combination of flags.
-There are several default combinations defined as macros already
-(see ``arrayobject.h``)
-
-In particular, there are ``ISBEHAVED``, ``ISBEHAVED_RO``, ``ISCARRAY``
-and ``ISFARRAY`` macros that also check to make sure the array is in
-native byte order (as determined) by the data-type descriptor.
-
-There are more C-API enhancements which you can discover in the code,
-or buy the book (http://www.trelgol.com)
diff --git a/numpy/doc/DISTUTILS.txt b/numpy/doc/DISTUTILS.txt
deleted file mode 100644
index b2027e619..000000000
--- a/numpy/doc/DISTUTILS.txt
+++ /dev/null
@@ -1,546 +0,0 @@
-.. -*- rest -*-
-
-NumPy Distutils - Users Guide
-=============================
-
-:Author: Pearu Peterson <pearu@cens.ioc.ee>
-:Discussions to: scipy-dev@scipy.org
-:Created: October 2005
-:Revision: $LastChangedRevision$
-:SVN source: $HeadURL$
-
-.. contents::
-
-SciPy structure
-'''''''''''''''
-
-Currently SciPy project consists of two packages:
-
-- NumPy (previously called SciPy core) --- it provides packages like:
-
- + numpy.distutils - extension to Python distutils
- + numpy.f2py - a tool to bind Fortran/C codes to Python
- + numpy.core - future replacement of Numeric and numarray packages
- + numpy.lib - extra utility functions
- + numpy.testing - numpy-style tools for unit testing
- + etc
-
-- SciPy --- a collection of scientific tools for Python.
-
-The aim of this document is to describe how to add new tools to SciPy.
-
-
-Requirements for SciPy packages
-'''''''''''''''''''''''''''''''
-
-SciPy consists of Python packages, called SciPy packages, that are
-available to Python users via the ``scipy`` namespace. Each SciPy package
-may contain other SciPy packages. And so on. Therefore, the SciPy
-directory tree is a tree of packages with arbitrary depth and width.
-Any SciPy package may depend on NumPy packages but the dependence on other
-SciPy packages should be kept minimal or zero.
-
-A SciPy package contains, in addition to its sources, the following
-files and directories:
-
- + ``setup.py`` --- building script
- + ``info.py`` --- contains documentation and import flags
- + ``__init__.py`` --- package initializer
- + ``tests/`` --- directory of unittests
-
-Their contents are described below.
-
-The ``setup.py`` file
-'''''''''''''''''''''
-
-In order to add a Python package to SciPy, its build script (``setup.py``)
-must meet certain requirements. The most important requirement is that the
-package define a ``configuration(parent_package='',top_path=None)`` function
-which returns a dictionary suitable for passing to
-``numpy.distutils.core.setup(..)``. To simplify the construction of
-this dictionary, ``numpy.distutils.misc_util`` provides the
-``Configuration`` class, described below.
-
-SciPy pure Python package example
----------------------------------
-
-Below is an example of a minimal ``setup.py`` file for a pure Scipy package::
-
- #!/usr/bin/env python
- def configuration(parent_package='',top_path=None):
- from numpy.distutils.misc_util import Configuration
- config = Configuration('mypackage',parent_package,top_path)
- return config
-
- if __name__ == "__main__":
- from numpy.distutils.core import setup
- #setup(**configuration(top_path='').todict())
- setup(configuration=configuration)
-
-The arguments of the ``configuration`` function specifiy the name of
-parent SciPy package (``parent_package``) and the directory location
-of the main ``setup.py`` script (``top_path``). These arguments,
-along with the name of the current package, should be passed to the
-``Configuration`` constructor.
-
-The ``Configuration`` constructor has a fourth optional argument,
-``package_path``, that can be used when package files are located in
-a different location than the directory of the ``setup.py`` file.
-
-Remaining ``Configuration`` arguments are all keyword arguments that will
-be used to initialize attributes of ``Configuration``
-instance. Usually, these keywords are the same as the ones that
-``setup(..)`` function would expect, for example, ``packages``,
-``ext_modules``, ``data_files``, ``include_dirs``, ``libraries``,
-``headers``, ``scripts``, ``package_dir``, etc. However, the direct
-specification of these keywords is not recommended as the content of
-these keyword arguments will not be processed or checked for the
-consistency of SciPy building system.
-
-Finally, ``Configuration`` has ``.todict()`` method that returns all
-the configuration data as a dictionary suitable for passing on to the
-``setup(..)`` function.
-
-``Configuration`` instance attributes
--------------------------------------
-
-In addition to attributes that can be specified via keyword arguments
-to ``Configuration`` constructor, ``Configuration`` instance (let us
-denote as ``config``) has the following attributes that can be useful
-in writing setup scripts:
-
-+ ``config.name`` - full name of the current package. The names of parent
- packages can be extracted as ``config.name.split('.')``.
-
-+ ``config.local_path`` - path to the location of current ``setup.py`` file.
-
-+ ``config.top_path`` - path to the location of main ``setup.py`` file.
-
-``Configuration`` instance methods
-----------------------------------
-
-+ ``config.todict()`` --- returns configuration dictionary suitable for
- passing to ``numpy.distutils.core.setup(..)`` function.
-
-+ ``config.paths(*paths) --- applies ``glob.glob(..)`` to items of
- ``paths`` if necessary. Fixes ``paths`` item that is relative to
- ``config.local_path``.
-
-+ ``config.get_subpackage(subpackage_name,subpackage_path=None)`` ---
- returns a list of subpackage configurations. Subpackage is looked in the
- current directory under the name ``subpackage_name`` but the path
- can be specified also via optional ``subpackage_path`` argument.
- If ``subpackage_name`` is specified as ``None`` then the subpackage
- name will be taken the basename of ``subpackage_path``.
- Any ``*`` used for subpackage names are expanded as wildcards.
-
-+ ``config.add_subpackage(subpackage_name,subpackage_path=None)`` ---
- add SciPy subpackage configuration to the current one. The meaning
- and usage of arguments is explained above, see
- ``config.get_subpackage()`` method.
-
-+ ``config.add_data_files(*files)`` --- prepend ``files`` to ``data_files``
- list. If ``files`` item is a tuple then its first element defines
- the suffix of where data files are copied relative to package installation
- directory and the second element specifies the path to data
- files. By default data files are copied under package installation
- directory. For example,
-
- ::
-
- config.add_data_files('foo.dat',
- ('fun',['gun.dat','nun/pun.dat','/tmp/sun.dat']),
- 'bar/car.dat'.
- '/full/path/to/can.dat',
- )
-
- will install data files to the following locations
-
- ::
-
- <installation path of config.name package>/
- foo.dat
- fun/
- gun.dat
- pun.dat
- sun.dat
- bar/
- car.dat
- can.dat
-
- Path to data files can be a function taking no arguments and
- returning path(s) to data files -- this is a useful when data files
- are generated while building the package. (XXX: explain the step
- when this function are called exactly)
-
-+ ``config.add_data_dir(data_path)`` --- add directory ``data_path``
- recursively to ``data_files``. The whole directory tree starting at
- ``data_path`` will be copied under package installation directory.
- If ``data_path`` is a tuple then its first element defines
- the suffix of where data files are copied relative to package installation
- directory and the second element specifies the path to data directory.
- By default, data directory are copied under package installation
- directory under the basename of ``data_path``. For example,
-
- ::
-
- config.add_data_dir('fun') # fun/ contains foo.dat bar/car.dat
- config.add_data_dir(('sun','fun'))
- config.add_data_dir(('gun','/full/path/to/fun'))
-
- will install data files to the following locations
-
- ::
-
- <installation path of config.name package>/
- fun/
- foo.dat
- bar/
- car.dat
- sun/
- foo.dat
- bar/
- car.dat
- gun/
- foo.dat
- bar/
- car.dat
-
-+ ``config.add_include_dirs(*paths)`` --- prepend ``paths`` to
- ``include_dirs`` list. This list will be visible to all extension
- modules of the current package.
-
-+ ``config.add_headers(*files)`` --- prepend ``files`` to ``headers``
- list. By default, headers will be installed under
- ``<prefix>/include/pythonX.X/<config.name.replace('.','/')>/``
- directory. If ``files`` item is a tuple then it's first argument
- specifies the installation suffix relative to
- ``<prefix>/include/pythonX.X/`` path. This is a Python distutils
- method; its use is discouraged for NumPy and SciPy in favour of
- ``config.add_data_files(*files)``.
-
-+ ``config.add_scripts(*files)`` --- prepend ``files`` to ``scripts``
- list. Scripts will be installed under ``<prefix>/bin/`` directory.
-
-+ ``config.add_extension(name,sources,*kw)`` --- create and add an
- ``Extension`` instance to ``ext_modules`` list. The first argument
- ``name`` defines the name of the extension module that will be
- installed under ``config.name`` package. The second argument is
- a list of sources. ``add_extension`` method takes also keyword
- arguments that are passed on to the ``Extension`` constructor.
- The list of allowed keywords is the following: ``include_dirs``,
- ``define_macros``, ``undef_macros``, ``library_dirs``, ``libraries``,
- ``runtime_library_dirs``, ``extra_objects``, ``extra_compile_args``,
- ``extra_link_args``, ``export_symbols``, ``swig_opts``, ``depends``,
- ``language``, ``f2py_options``, ``module_dirs``, ``extra_info``.
-
- Note that ``config.paths`` method is applied to all lists that
- may contain paths. ``extra_info`` is a dictionary or a list
- of dictionaries that content will be appended to keyword arguments.
- The list ``depends`` contains paths to files or directories
- that the sources of the extension module depend on. If any path
- in the ``depends`` list is newer than the extension module, then
- the module will be rebuilt.
-
- The list of sources may contain functions ('source generators')
- with a pattern ``def <funcname>(ext, build_dir): return
- <source(s) or None>``. If ``funcname`` returns ``None``, no sources
- are generated. And if the ``Extension`` instance has no sources
- after processing all source generators, no extension module will
- be built. This is the recommended way to conditionally define
- extension modules. Source generator functions are called by the
- ``build_src`` command of ``numpy.distutils``.
-
- For example, here is a typical source generator function::
-
- def generate_source(ext,build_dir):
- import os
- from distutils.dep_util import newer
- target = os.path.join(build_dir,'somesource.c')
- if newer(target,__file__):
- # create target file
- return target
-
- The first argument contains the Extension instance that can be
- useful to access its attributes like ``depends``, ``sources``,
- etc. lists and modify them during the building process.
- The second argument gives a path to a build directory that must
- be used when creating files to a disk.
-
-+ ``config.add_library(name, sources, **build_info)`` --- add
- a library to ``libraries`` list. Allowed keywords arguments
- are ``depends``, ``macros``, ``include_dirs``,
- ``extra_compiler_args``, ``f2py_options``. See ``.add_extension()``
- method for more information on arguments.
-
-+ ``config.have_f77c()`` --- return True if Fortran 77 compiler is
- available (read: a simple Fortran 77 code compiled succesfully).
-
-+ ``config.have_f90c()`` --- return True if Fortran 90 compiler is
- available (read: a simple Fortran 90 code compiled succesfully).
-
-+ ``config.get_version()`` --- return version string of the current package,
- ``None`` if version information could not be detected. This methods
- scans files ``__version__.py``, ``<packagename>_version.py``,
- ``version.py``, ``__svn_version__.py`` for string variables
- ``version``, ``__version__``, ``<packagename>_version``.
-
-+ ``config.make_svn_version_py()`` --- appends a data function to
- ``data_files`` list that will generate ``__svn_version__.py`` file
- to the current package directory. The file will be removed from
- the source directory when Python exits.
-
-+ ``config.get_build_temp_dir()`` --- return a path to a temporary
- directory. This is the place where one should build temporary
- files.
-
-+ ``config.get_distribution()`` --- return distutils ``Distribution``
- instance.
-
-+ ``config.get_config_cmd()`` --- returns ``numpy.distutils`` config
- command instance.
-
-+ ``config.get_info(*names)`` ---
-
-Template files
---------------
-
-XXX: Describe how files with extensions ``.f.src``, ``.pyf.src``,
-``.c.src``, etc. are pre-processed by the ``build_src`` command.
-
-Useful functions in ``numpy.distutils.misc_util``
--------------------------------------------------
-
-+ ``get_numpy_include_dirs()`` --- return a list of NumPy base
- include directories. NumPy base include directories contain
- header files such as ``numpy/arrayobject.h``, ``numpy/funcobject.h``
- etc. For installed NumPy the returned list has length 1
- but when building NumPy the list may contain more directories,
- for example, a path to ``config.h`` file that
- ``numpy/base/setup.py`` file generates and is used by ``numpy``
- header files.
-
-+ ``append_path(prefix,path)`` --- smart append ``path`` to ``prefix``.
-
-+ ``gpaths(paths, local_path='')`` --- apply glob to paths and prepend
- ``local_path`` if needed.
-
-+ ``njoin(*path)`` --- join pathname components + convert ``/``-separated path
- to ``os.sep``-separated path and resolve ``..``, ``.`` from paths.
- Ex. ``njoin('a',['b','./c'],'..','g') -> os.path.join('a','b','g')``.
-
-+ ``minrelpath(path)`` --- resolves dots in ``path``.
-
-+ ``rel_path(path, parent_path)`` --- return ``path`` relative to ``parent_path``.
-
-+ ``def get_cmd(cmdname,_cache={})`` --- returns ``numpy.distutils``
- command instance.
-
-+ ``all_strings(lst)``
-
-+ ``has_f_sources(sources)``
-
-+ ``has_cxx_sources(sources)``
-
-+ ``filter_sources(sources)`` --- return ``c_sources, cxx_sources,
- f_sources, fmodule_sources``
-
-+ ``get_dependencies(sources)``
-
-+ ``is_local_src_dir(directory)``
-
-+ ``get_ext_source_files(ext)``
-
-+ ``get_script_files(scripts)``
-
-+ ``get_lib_source_files(lib)``
-
-+ ``get_data_files(data)``
-
-+ ``dot_join(*args)`` --- join non-zero arguments with a dot.
-
-+ ``get_frame(level=0)`` --- return frame object from call stack with given level.
-
-+ ``cyg2win32(path)``
-
-+ ``mingw32()`` --- return ``True`` when using mingw32 environment.
-
-+ ``terminal_has_colors()``, ``red_text(s)``, ``green_text(s)``,
- ``yellow_text(s)``, ``blue_text(s)``, ``cyan_text(s)``
-
-+ ``get_path(mod_name,parent_path=None)`` --- return path of a module
- relative to parent_path when given. Handles also ``__main__`` and
- ``__builtin__`` modules.
-
-+ ``allpath(name)`` --- replaces ``/`` with ``os.sep`` in ``name``.
-
-+ ``cxx_ext_match``, ``fortran_ext_match``, ``f90_ext_match``,
- ``f90_module_name_match``
-
-``numpy.distutils.system_info`` module
---------------------------------------
-
-+ ``get_info(name,notfound_action=0)``
-+ ``combine_paths(*args,**kws)``
-+ ``show_all()``
-
-``numpy.distutils.cpuinfo`` module
-----------------------------------
-
-+ ``cpuinfo``
-
-``numpy.distutils.log`` module
-------------------------------
-
-+ ``set_verbosity(v)``
-
-
-``numpy.distutils.exec_command`` module
----------------------------------------
-
-+ ``get_pythonexe()``
-+ ``find_executable(exe, path=None)``
-+ ``exec_command( command, execute_in='', use_shell=None, use_tee=None, **env )``
-
-The ``info.py`` file
-''''''''''''''''''''
-
-Scipy package import hooks assume that each package contains a
-``info.py`` file. This file contains overall documentation about the package
-and variables defining the order of package imports, dependency
-relations between packages, etc.
-
-On import, the following information will be looked for in ``info.py``:
-
-__doc__
- The documentation string of the package.
-
-__doc_title__
- The title of the package. If not defined then the first non-empty
- line of ``__doc__`` will be used.
-
-__all__
- List of symbols that package exports. Optional.
-
-global_symbols
- List of names that should be imported to numpy name space. To import
- all symbols to ``numpy`` namespace, define ``global_symbols=['*']``.
-
-depends
- List of names that the package depends on. Prefix ``numpy.``
- will be automatically added to package names. For example,
- use ``testing`` to indicate dependence on ``numpy.testing``
- package. Default value is ``[]``.
-
-postpone_import
- Boolean variable indicating that importing the package should be
- postponed until the first attempt of its usage. Default value is ``False``.
- Depreciated.
-
-The ``__init__.py`` file
-''''''''''''''''''''''''
-
-To speed up the import time and minimize memory usage, numpy
-uses ``ppimport`` hooks to transparently postpone importing large modules,
-which might not be used during the Scipy session. In order to
-have access to the documentation of all Scipy packages, including
-postponed packages, the docstring from ``info.py`` is imported
-into ``__init__.py``.
-
-The header of a typical ``__init__.py`` is::
-
- #
- # Package ... - ...
- #
-
- from info import __doc__
- ...
-
- from numpy.testing import NumpyTest
- test = NumpyTest().test
-
-The ``tests/`` directory
-''''''''''''''''''''''''
-
-Ideally, every Python code, extension module, or subpackage in Scipy
-package directory should have the corresponding ``test_<name>.py``
-file in ``tests/`` directory. This file should define classes
-derived from the ``numpy.testing.TestCase`` class (or from
-``unittest.TestCase``) and have names starting with ``test``. The methods
-of these classes whose names contain ``test`` or start with ``bench`` are
-automatically picked up by the test machinery.
-
-A minimal example of a ``test_yyy.py`` file that implements tests for
-a NumPy package module ``numpy.xxx.yyy`` containing a function
-``zzz()``, is shown below::
-
- import sys
- from numpy.testing import *
-
- # import xxx symbols
- from numpy.xxx.yyy import zzz
-
-
- class test_zzz(TestCase):
- def test_simple(self, level=1):
- assert zzz()=='Hello from zzz'
- #...
-
- if __name__ == "__main__":
- run_module_tests(file)
-
-Note that all classes that are inherited from ``TestCase`` class, are
-automatically picked up by the test runner.
-
-``numpy.testing`` module provides also the following convenience
-functions::
-
- assert_equal(actual,desired,err_msg='',verbose=1)
- assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1)
- assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1)
- assert_array_equal(x,y,err_msg='')
- assert_array_almost_equal(x,y,decimal=6,err_msg='')
- rand(*shape) # returns random array with a given shape
-
-To run all test scripts of the module ``xxx``, execute in Python:
-
- >>> import numpy
- >>> numpy.xxx.test()
-
-To run only tests for ``xxx.yyy`` module, execute:
-
- >>> NumpyTest('xxx.yyy').test(level=1,verbosity=1)
-
-Extra features in NumPy Distutils
-'''''''''''''''''''''''''''''''''
-
-Specifing config_fc options for libraries in setup.py script
-------------------------------------------------------------
-
-It is possible to specify config_fc options in setup.py scripts.
-For example, using
-
- config.add_library('library',
- sources=[...],
- config_fc={'noopt':(__file__,1)})
-
-will compile the ``library`` sources without optimization flags.
-
-It's recommended to specify only those config_fc options in such a way
-that are compiler independent.
-
-Getting extra Fortran 77 compiler options from source
------------------------------------------------------
-
-Some old Fortran codes need special compiler options in order to
-work correctly. In order to specify compiler options per source
-file, ``numpy.distutils`` Fortran compiler looks for the following
-pattern::
-
- CF77FLAGS(<fcompiler type>) = <fcompiler f77flags>
-
-in the first 20 lines of the source and use the ``f77flags`` for
-specified type of the fcompiler (the first character ``C`` is optional).
-
-TODO: This feature can be easily extended for Fortran 90 codes as
-well. Let us know if you would need such a feature.
diff --git a/numpy/doc/EXAMPLE_DOCSTRING.txt b/numpy/doc/EXAMPLE_DOCSTRING.txt
deleted file mode 100644
index ee1326474..000000000
--- a/numpy/doc/EXAMPLE_DOCSTRING.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-.. Here follows an example docstring for a C-function. Note that the
- signature is given. This is done only for functions written is C,
- since Python cannot find their signature by inspection. For all
- other functions, start with the one line description.
-
-
-multivariate_normal(mean, cov[, shape])
-
-Draw samples from a multivariate normal distribution.
-
-The multivariate normal, multinormal or Gaussian distribution is a
-generalisation of the one-dimensional normal distribution to higher
-dimensions.
-
-Such a distribution is specified by its mean and covariance matrix,
-which are analogous to the mean (average or "centre") and variance
-(standard deviation squared or "width") of the one-dimensional normal
-distribution.
-
-Parameters
-----------
-mean : (N,) ndarray
- Mean of the N-dimensional distribution.
-cov : (N,N) ndarray
- Covariance matrix of the distribution.
-shape : tuple of ints, optional
- Given a shape of, for example, (m,n,k), m*n*k samples are
- generated, and packed in an m-by-n-by-k arrangement. Because each
- sample is N-dimensional, the output shape is (m,n,k,N). If no
- shape is specified, a single sample is returned.
-
-Returns
--------
-out : ndarray
- The drawn samples, arranged according to `shape`. If the
- shape given is (m,n,...), then the shape of `out` is is
- (m,n,...,N).
-
- In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
- value drawn from the distribution.
-
-See Also
---------
-normal
-scipy.stats.distributions.norm : Provides random variates, as well as
- probability density function, cumulative
- density function, etc.
-
-Notes
------
-The mean is a coordinate in N-dimensional space, which represents the
-location where samples are most likely to be generated. This is
-analogous to the peak of the bell curve for the one-dimensional or
-univariate normal distribution.
-
-Covariance indicates the level to which two variables vary together.
-From the multivariate normal distribution, we draw N-dimensional
-samples, :math:`X = [x_1, x_2, ... x_N]`. The covariance matrix
-element :math:`C_ij` is the covariance of :math:`x_i` and :math:`x_j`.
-The element :math:`C_ii` is the variance of :math:`x_i` (i.e. its
-"spread").
-
-Instead of specifying the full covariance matrix, popular
-approximations include:
-
- - Spherical covariance (`cov` is a multiple of the identity matrix)
- - Diagonal covariance (`cov` has non-negative elements, and only on
- the diagonal)
-
-This geometrical property can be seen in two dimensions by plotting
-generated data-points:
-
->>> mean = [0,0]
->>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis
->>> x,y = np.random.multivariate_normal(mean,cov,5000).T
-
->>> import matplotlib.pyplot as plt
->>> plt.plot(x,y,'x'); plt.axis('equal'); pyplot.show()
-
-Note that the covariance matrix must be non-negative definite.
-
-References
-----------
-.. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
- Processes," 3rd ed., McGraw-Hill Companies, 1991
-.. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
- 2nd ed., Wiley, 2001.
-
-Examples
---------
->>> mean = (1,2)
->>> cov = [[1,0],[1,0]]
->>> x = np.random.multivariate_normal(mean,cov,(3,3))
->>> x.shape
-(3, 3, 2)
-
-The following is probably true, given that 0.6 is roughly twice the
-standard deviation:
-
->>> print list( (x[0,0,:] - mean) < 0.6 )
-[True, True]
-
-.. index:
- :refguide: random:distributions
diff --git a/numpy/doc/HOWTO_BUILD_DOCS.txt b/numpy/doc/HOWTO_BUILD_DOCS.txt
deleted file mode 100644
index 9b1cca2f0..000000000
--- a/numpy/doc/HOWTO_BUILD_DOCS.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-=========================================
-Building the NumPy API and reference docs
-=========================================
-
-Using Sphinx_
--------------
-`Download <https://code.launchpad.net/~stefanv/scipy/numpy-refguide>`_
-the builder. Follow the instructions in ``README.txt``.
-
-
-Using Epydoc_
--------------
-
-Currently, we recommend that you build epydoc from the trunk::
-
- svn co https://epydoc.svn.sf.net/svnroot/epydoc/trunk/epydoc epydoc
- cd epydoc/src
- sudo python setup.py install
-
-The appearance of some elements can be changed in the epydoc.css
-style sheet.
-
-Emphasized text appearance can be controlled by the definition of the <em>
-tag. For instance, to make them bold, insert::
-
- em {font-weight: bold;}
-
-The variables' types are in a span of class rst-classifier, hence can be
-changed by inserting something like::
-
- span.rst-classifier {font-weight: normal;}
-
-The first line of the signature should **not** copy the signature unless
-the function is written in C, in which case it is mandatory. If the function
-signature is generic (uses ``*args`` or ``**kwds``), then a function signature
-may be included.
-
-Use optional in the "type" field for parameters that are non-keyword
-optional for C-functions.
-
-Epydoc depends on Docutils for reStructuredText parsing. You can
-download Docutils from the `Docutils sourceforge
-page. <http://docutils.sourceforge.net/>`_. The version in SVN is
-broken, so use 0.4 or the patched version from Debian. You may also
-be able to use a package manager like yum to install it::
-
- $ sudo yum install python-docutils
-
-
-Example
--------
-Here is a short example module,
-`plain text <http://svn.scipy.org/svn/numpy/trunk/numpy/doc/example.py>`_
-or
-`rendered <http://www.scipy.org/doc/example>`_ in HTML.
-
-To try this yourself, simply download the example.py::
-
- svn co http://svn.scipy.org/svn/numpy/trunk/numpy/doc/example.py .
-
-Then, run epydoc::
-
- $ epydoc --docformat=restructuredtext example.py
-
-The output is placed in ``./html``, and may be viewed by loading the
-``index.html`` file into your browser.
-
-
-
-.. _epydoc: http://epydoc.sourceforge.net/
-.. _sphinx: http://sphinx.pocoo.org
diff --git a/numpy/doc/HOWTO_DOCUMENT.txt b/numpy/doc/HOWTO_DOCUMENT.txt
deleted file mode 100644
index 03c35283d..000000000
--- a/numpy/doc/HOWTO_DOCUMENT.txt
+++ /dev/null
@@ -1,430 +0,0 @@
-====================================
-A Guide to NumPy/SciPy Documentation
-====================================
-
-.. Contents::
-
-.. Note::
-
- For an accompanying example, see `example.py
- <http://svn.scipy.org/svn/numpy/trunk/numpy/doc/example.py>`_.
-
-Overview
---------
-In general, we follow the standard Python style conventions as described here:
- * `Style Guide for C Code <http://www.python.org/peps/pep-0007.html>`_
- * `Style Guide for Python Code <http://www.python.org/peps/pep-0008.html>`_
- * `Docstring Conventions <http://www.python.org/peps/pep-0257.html>`_
-
-Additional PEPs of interest regarding documentation of code:
- * `Docstring Processing Framework <http://www.python.org/peps/pep-0256.html>`_
- * `Docutils Design Specification <http://www.python.org/peps/pep-0258.html>`_
-
-Use a code checker:
- * `pylint <http://www.logilab.org/857>`_
- * `pyflakes` easy_install pyflakes
- * `pep8.py <http://svn.browsershots.org/trunk/devtools/pep8/pep8.py>`_
-
-The following import conventions are used throughout the NumPy source
-and documentation::
-
- import numpy as np
- import scipy as sp
- import matplotlib as mpl
- import matplotlib.pyplot as plt
-
-It is not necessary to do ``import numpy as np`` at the beginning of
-an example. However, some sub-modules, such as ``fft``, are not
-imported by default, and you have to include them explicitly::
-
- import numpy.fft
-
-after which you may use it::
-
- np.fft.fft2(...)
-
-Docstring Standard
-------------------
-A documentation string (docstring) is a string that describes a module,
-function, class, or method definition. The docstring is a special attribute
-of the object (``object.__doc__``) and, for consistency, is surrounded by
-triple double quotes, i.e.::
-
- """This is the form of a docstring.
-
- It can be spread over several lines.
-
- """
-
-NumPy, SciPy_, and the scikits follow a common convention for
-docstrings that provides for consistency, while also allowing our
-toolchain to produce well-formatted reference guides. This document
-describes the current community consensus for such a standard. If you
-have suggestions for improvements, post them on the `numpy-discussion
-list`_, together with the epydoc output.
-
-Our docstring standard uses `re-structured text (reST)
-<http://docutils.sourceforge.net/rst.html>`_ syntax and is rendered
-using tools like epydoc_ or sphinx_ (pre-processors that understand
-the particular documentation style we are using). While a rich set of
-markup is available, we limit ourselves to a very basic subset, in
-order to provide docstrings that are easy to read on text-only
-terminals.
-
-A guiding principle is that human readers of the text are given
-precedence over contorting docstrings so our tools produce nice
-output. Rather than sacrificing the readability of the docstrings, we
-have written pre-processors to assist tools like epydoc_ and sphinx_ in
-their task.
-
-Status
-------
-We are busy converting existing docstrings to the new format,
-expanding them where they are lacking, as well as writing new ones for
-undocumented functions. Volunteers are welcome to join the effort on
-our new documentation system (see the `Developer Zone
-<http://www.scipy.org/Developer_Zone/DocMarathon2008>`_).
-
-Sections
---------
-The sections of the docstring are:
-
-1. **Short summary**
-
- A one-line summary that does not use variable names or the function
- name, e.g.
-
- ::
-
- def add(a,b):
- """The sum of two numbers.
-
- """
-
- The function signature is normally found by introspection and
- displayed by the help function. For some functions (notably those
- written in C) the signature is not available, so we have to specify
- it as the first line of the docstring::
-
- """
- add(a,b)
-
- The sum of two numbers.
-
- """
-
-2. **Extended summary**
-
- A few sentences giving an extended description. This section
- should be used to clarify *functionality*, not to discuss
- implementation detail or background theory, which should rather be
- explored in the **notes** section below. You may refer to the
- parameters and the function name, but parameter descriptions still
- belong in the **parameters** section.
-
-3. **Parameters**
-
- Description of the function arguments, keywords and their
- respective types.
-
- ::
-
- Parameters
- ----------
- x : type
- Description of parameter `x`.
-
- Enclose variables in single back-tics. If it is not necessary to
- specify a keyword argument, use ``optional``::
-
- x : int, optional
-
- Optional keyword parameters have default values, which are
- displayed as part of the function signature. They can also be
- detailed in the description::
-
- Description of parameter `x` (the default is -1, which implies summation
- over all axes).
-
- When a parameter can only assume one of a fixed set of values,
- those values can be listed in braces ::
-
- x : {True, False}
- Description of `x`.
-
-4. **Returns**
-
- Explanation of the returned values and their types, of the same
- format as **parameters**.
-
-5. **Other parameters**
-
- An optional section used to describe infrequently used parameters.
- It should only be used if a function has a large number of keyword
- prameters, to prevent cluttering the **parameters** section.
-
-6. **Raises**
-
- An optional section detailing which errors get raised and under
- what conditions::
-
- Raises
- ------
- LinAlgException
- If the matrix is not numerically invertible.
-
-7. **See Also**
-
- An optional section used to refer to related code. This section
- can be very useful, but should be used judiciously. The goal is to
- direct users to other functions they may not be aware of, or have
- easy means of discovering (by looking at the module docstring, for
- example). Routines whose docstrings further explain parameters
- used by this function are good candidates.
-
- As an example, for ``numpy.mean`` we would have::
-
- See Also
- --------
- average : Weighted average
-
- When referring to functions in the same sub-module, no prefix is
- needed, and the tree is searched upwards for a match.
-
- Prefix functions from other sub-modules appropriately. E.g.,
- whilst documenting the ``random`` module, refer to a function in
- ``fft`` by
-
- ::
-
- fft.fft2 : 2-D fast discrete Fourier transform
-
- When referring to an entirely different module::
-
- scipy.random.norm : Random variates, PDFs, etc.
-
- Functions may be listed without descriptions::
-
- See Also
- --------
- func_a : Function a with its description.
- func_b, func_c_, func_d
- func_e
-
-8. **Notes**
-
- An optional section that provides additional information about the
- code, possibly including a discussion of the algorithm. This
- section may include mathematical equations, written in
- `LaTeX <http://www.latex-project.org/>`_ format::
-
- The FFT is a fast implementation of the discrete Fourier transform:
-
- .. math:: X(e^{j\omega } ) = x(n)e^{ - j\omega n}
-
- Equations can also be typeset underneath the math directive::
-
- The discrete-time Fourier time-convolution property states that
-
- .. math::
-
- x(n) * y(n) \Leftrightarrow X(e^{j\omega } )Y(e^{j\omega } )\\
- another equation here
-
- Math can furthermore be used inline, i.e.
-
- ::
-
- The value of :math:`\omega` is larger than 5.
-
- Variable names are displayed in typewriter font, obtained by using
- ``\mathtt{var}``::
-
- We square the input parameter `alpha` to obtain
- :math:`\mathtt{alpha}^2`.
-
- Note that LaTeX is not particularly easy to read, so use equations
- sparingly.
-
- Images are allowed, but should not be central to the explanation;
- users viewing the docstring as text must be able to comprehend its
- meaning without resorting to an image viewer. These additional
- illustrations are included using::
-
- .. image:: filename
-
- where filename is a path relative to the reference guide source
- directory.
-
-9. **References**
-
- References cited in the **notes** section may be listed here,
- e.g. if you cited the article below using the text ``[1]_``,
- include it as in the list as follows::
-
- .. [1] O. McNoleg, "The integration of GIS, remote sensing,
- expert systems and adaptive co-kriging for environmental habitat
- modelling of the Highland Haggis using object-oriented, fuzzy-logic
- and neural-network techniques," Computers & Geosciences, vol. 22,
- pp. 585-588, 1996.
-
- which renders as
-
- .. [1] O. McNoleg, "The integration of GIS, remote sensing,
- expert systems and adaptive co-kriging for environmental habitat
- modelling of the Highland Haggis using object-oriented, fuzzy-logic
- and neural-network techniques," Computers & Geosciences, vol. 22,
- pp. 585-588, 1996.
-
- Referencing sources of a temporary nature, like web pages, is
- discouraged. References are meant to augment the docstring, but
- should not be required to understand it. Follow the `citation
- format of the IEEE
- <http://www.ieee.org/pubs/transactions/auinfo03.pdf>`_, which
- states that references are numbered, starting from one, in the
- order in which they are cited.
-
-10. **Examples**
-
- An optional section for examples, using the `doctest
- <http://www.python.org/doc/lib/module-doctest.html>`_ format.
- This section is meant to illustrate usage, not to provide a
- testing framework -- for that, use the ``tests/`` directory.
- While optional, this section is very strongly encouraged. You can
- run these examples by doing::
-
- >>> import doctest
- >>> doctest.testfile('example.py')
-
- or, using nose,
-
- ::
-
- $ nosetests --with-doctest example.py
-
- Blank lines are used to seperate doctests. When they occur in the
- expected output, they should be replaced by ``<BLANKLINE>`` (see
- `doctest options
- <http://docs.python.org/lib/doctest-options.html>`_ for other such
- special strings), e.g.
-
- ::
-
- >>> print "a\n\nb"
- a
- <BLANKLINE>
- b
-
- The examples may assume that ``import numpy as np`` is executed before
- the example code in *numpy*, and ``import scipy as sp`` in *scipy*.
- Additional examples may make use of *matplotlib* for plotting, but should
- import it explicitly, e.g., ``import matplotlib.pyplot as plt``.
-
-11. **Indexing tags***
-
- Each function needs to be categorised for indexing purposes. Use
- the ``index`` directive::
-
- .. index::
- :refguide: ufunc, trigonometry
-
- To index a function as a sub-category of a class, separate index
- entries by a colon, e.g.
-
- ::
-
- :refguide: ufunc, numpy:reshape, other
-
- A `list of available categories
- <http://www.scipy.org/Developer_Zone/ReferenceGuide>`_ is
- available.
-
-Documenting classes
--------------------
-
-Class docstring
-```````````````
-Use the same sections as outlined above (all except ``Returns`` are
-applicable). The constructor (``__init__``) should also be documented
-here.
-
-An ``Attributes`` section may be used to describe class variables::
-
- Attributes
- ----------
- x : float
- The X coordinate.
- y : float
- The Y coordinate.
-
-In general, it is not necessary to list class methods. Those that are
-not part of the public API have names that start with an underscore.
-In some cases, however, a class may have a great many methods, of
-which only a few are relevant (e.g., subclasses of ndarray). Then, it
-becomes useful to have an additional ``Methods`` section::
-
- class Photo(ndarray):
- """
- Array with associated photographic information.
-
- ...
-
- Attributes
- ----------
- exposure : float
- Exposure in seconds.
-
- Methods
- -------
- colorspace(c='rgb')
- Represent the photo in the given colorspace.
- gamma(n=1.0)
- Change the photo's gamma exposure.
-
- """
-
-Note that `self` is *not* listed as the first parameter of methods.
-
-Method docstrings
-`````````````````
-Document these as you would any other function. Do not include
-``self`` in the list of parameters.
-
-Common reST concepts
---------------------
-For paragraphs, indentation is significant and indicates indentation in the
-output. New paragraphs are marked with a blank line.
-
-Use *italics*, **bold**, and ``courier`` if needed in any explanations
-(but not for variable names and doctest code or multi-line code).
-Variable, module and class names should be written between single
-backticks (```numpy```).
-
-A more extensive example of reST markup can be found in `this example
-document <http://docutils.sourceforge.net/docs/user/rst/demo.txt>`_;
-the `quick reference
-<http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_ is
-useful while editing.
-
-Line spacing and indentation are significant and should be carefully
-followed.
-
-Conclusion
-----------
-
-`An example
-<http://svn.scipy.org/svn/numpy/trunk/numpy/doc/example.py>`_ of the
-format shown here is available. Refer to `How to Build API/Reference
-Documentation
-<http://svn.scipy.org/svn/numpy/trunk/numpy/doc/HOWTO_BUILD_DOCS.txt>`_
-on how to use epydoc_ or sphinx_ to construct a manual and web page.
-
-This document itself was written in ReStructuredText, and may be converted to
-HTML using::
-
- $ rst2html HOWTO_DOCUMENT.txt HOWTO_DOCUMENT.html
-
-.. _SciPy: http://www.scipy.org
-.. _numpy-discussion list: http://www.scipy.org/Mailing_Lists
-.. _epydoc: http://epydoc.sourceforge.net/
-.. _sphinx: http://sphinx.pocoo.org
diff --git a/numpy/doc/README.txt b/numpy/doc/README.txt
deleted file mode 100644
index eacc3659e..000000000
--- a/numpy/doc/README.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Very complete documentation is available from the primary developer of
-NumPy for a small fee. After a brief period, that documentation
-will become freely available. See http://www.trelgol.com for
-details. The fee and restriction period is intended to allow people
-and to encourage companies to easily contribute to the development of
-NumPy.
-
-This directory will contain all public documentation that becomes available.
-
-Very good documentation is also available using Python's (and
-especially IPython's) own help system. Most of the functions have
-docstrings that provide usage assistance.
-
-
-
diff --git a/numpy/doc/__init__.py b/numpy/doc/__init__.py
index 394f0b548..44eb42441 100644
--- a/numpy/doc/__init__.py
+++ b/numpy/doc/__init__.py
@@ -1,2 +1,27 @@
-from numpy.doc.reference import *
-del reference
+import os
+
+ref_dir = os.path.join(os.path.dirname(__file__))
+
+__all__ = [f[:-3] for f in os.listdir(ref_dir) if f.endswith('.py') and
+ not f.startswith('__')]
+__all__.sort()
+
+for f in __all__:
+ __import__(__name__ + '.' + f)
+
+del f, ref_dir
+
+__doc__ = """\
+Topical documentation
+=====================
+
+The following topics are available:
+%s
+
+You can view them by
+
+>>> help(doc.TOPIC)
+
+""" % '\n- '.join([''] + __all__)
+
+__all__.extend(['__doc__'])
diff --git a/numpy/doc/reference/basics.py b/numpy/doc/basics.py
index dfb8fe74d..dfb8fe74d 100644
--- a/numpy/doc/reference/basics.py
+++ b/numpy/doc/basics.py
diff --git a/numpy/doc/reference/broadcasting.py b/numpy/doc/broadcasting.py
index 95e9b67f9..95e9b67f9 100644
--- a/numpy/doc/reference/broadcasting.py
+++ b/numpy/doc/broadcasting.py
diff --git a/numpy/doc/reference/creation.py b/numpy/doc/creation.py
index 1e80e5115..1e80e5115 100644
--- a/numpy/doc/reference/creation.py
+++ b/numpy/doc/creation.py
diff --git a/numpy/doc/cython/MANIFEST b/numpy/doc/cython/MANIFEST
deleted file mode 100644
index feb3ec22a..000000000
--- a/numpy/doc/cython/MANIFEST
+++ /dev/null
@@ -1,2 +0,0 @@
-numpyx.pyx
-setup.py
diff --git a/numpy/doc/cython/Makefile b/numpy/doc/cython/Makefile
deleted file mode 100644
index 7c9c72981..000000000
--- a/numpy/doc/cython/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-# Simple makefile to quickly access handy build commands for Cython extension
-# code generation. Note that the actual code to produce the extension lives in
-# the setup.py file, this Makefile is just meant as a command
-# convenience/reminder while doing development.
-
-help:
- @echo "Numpy/Cython tasks. Available tasks:"
- @echo "ext -> build the Cython extension module."
- @echo "html -> create annotated HTML from the .pyx sources"
- @echo "test -> run a simple test demo."
- @echo "all -> Call ext, html and finally test."
-
-all: ext html test
-
-ext: numpyx.so
-
-test: ext
- python run_test.py
-
-html: numpyx.pyx.html
-
-numpyx.so: numpyx.pyx numpyx.c
- python setup.py build_ext --inplace
-
-numpyx.pyx.html: numpyx.pyx
- cython -a numpyx.pyx
- @echo "Annotated HTML of the C code generated in numpyx.html"
-
-# Phony targets for cleanup and similar uses
-
-.PHONY: clean
-clean:
- rm -rf *~ *.so *.c *.o *.html build
-
-# Suffix rules
-%.c : %.pyx
- cython $<
diff --git a/numpy/doc/cython/README.txt b/numpy/doc/cython/README.txt
deleted file mode 100644
index ff0abb0fe..000000000
--- a/numpy/doc/cython/README.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-==================
- NumPy and Cython
-==================
-
-This directory contains a small example of how to use NumPy and Cython
-together. While much work is planned for the Summer of 2008 as part of the
-Google Summer of Code project to improve integration between the two, even
-today Cython can be used effectively to write optimized code that accesses
-NumPy arrays.
-
-The example provided is just a stub showing how to build an extension and
-access the array objects; improvements to this to show more sophisticated tasks
-are welcome.
-
-To run it locally, simply type::
-
- make help
-
-which shows you the currently available targets (these are just handy
-shorthands for common commands). \ No newline at end of file
diff --git a/numpy/doc/cython/c_numpy.pxd b/numpy/doc/cython/c_numpy.pxd
deleted file mode 100644
index 4a0bd1c01..000000000
--- a/numpy/doc/cython/c_numpy.pxd
+++ /dev/null
@@ -1,136 +0,0 @@
-# :Author: Travis Oliphant
-
-# API declaration section. This basically exposes the NumPy C API to
-# Pyrex/Cython programs.
-
-cdef extern from "numpy/arrayobject.h":
-
- cdef enum NPY_TYPES:
- NPY_BOOL
- NPY_BYTE
- NPY_UBYTE
- NPY_SHORT
- NPY_USHORT
- NPY_INT
- NPY_UINT
- NPY_LONG
- NPY_ULONG
- NPY_LONGLONG
- NPY_ULONGLONG
- NPY_FLOAT
- NPY_DOUBLE
- NPY_LONGDOUBLE
- NPY_CFLOAT
- NPY_CDOUBLE
- NPY_CLONGDOUBLE
- NPY_OBJECT
- NPY_STRING
- NPY_UNICODE
- NPY_VOID
- NPY_NTYPES
- NPY_NOTYPE
-
- cdef enum requirements:
- NPY_CONTIGUOUS
- NPY_FORTRAN
- NPY_OWNDATA
- NPY_FORCECAST
- NPY_ENSURECOPY
- NPY_ENSUREARRAY
- NPY_ELEMENTSTRIDES
- NPY_ALIGNED
- NPY_NOTSWAPPED
- NPY_WRITEABLE
- NPY_UPDATEIFCOPY
- NPY_ARR_HAS_DESCR
-
- NPY_BEHAVED
- NPY_BEHAVED_NS
- NPY_CARRAY
- NPY_CARRAY_RO
- NPY_FARRAY
- NPY_FARRAY_RO
- NPY_DEFAULT
-
- NPY_IN_ARRAY
- NPY_OUT_ARRAY
- NPY_INOUT_ARRAY
- NPY_IN_FARRAY
- NPY_OUT_FARRAY
- NPY_INOUT_FARRAY
-
- NPY_UPDATE_ALL
-
- cdef enum defines:
- NPY_MAXDIMS
-
- ctypedef struct npy_cdouble:
- double real
- double imag
-
- ctypedef struct npy_cfloat:
- double real
- double imag
-
- ctypedef int npy_intp
-
- ctypedef extern class numpy.dtype [object PyArray_Descr]:
- cdef int type_num, elsize, alignment
- cdef char type, kind, byteorder, hasobject
- cdef object fields, typeobj
-
- ctypedef extern class numpy.ndarray [object PyArrayObject]:
- cdef char *data
- cdef int nd
- cdef npy_intp *dimensions
- cdef npy_intp *strides
- cdef object base
- cdef dtype descr
- cdef int flags
-
- ctypedef extern class numpy.flatiter [object PyArrayIterObject]:
- cdef int nd_m1
- cdef npy_intp index, size
- cdef ndarray ao
- cdef char *dataptr
-
- ctypedef extern class numpy.broadcast [object PyArrayMultiIterObject]:
- cdef int numiter
- cdef npy_intp size, index
- cdef int nd
- cdef npy_intp *dimensions
- cdef void **iters
-
- object PyArray_ZEROS(int ndims, npy_intp* dims, NPY_TYPES type_num, int fortran)
- object PyArray_EMPTY(int ndims, npy_intp* dims, NPY_TYPES type_num, int fortran)
- dtype PyArray_DescrFromTypeNum(NPY_TYPES type_num)
- object PyArray_SimpleNew(int ndims, npy_intp* dims, NPY_TYPES type_num)
- int PyArray_Check(object obj)
- object PyArray_ContiguousFromAny(object obj, NPY_TYPES type,
- int mindim, int maxdim)
- object PyArray_ContiguousFromObject(object obj, NPY_TYPES type,
- int mindim, int maxdim)
- npy_intp PyArray_SIZE(ndarray arr)
- npy_intp PyArray_NBYTES(ndarray arr)
- void *PyArray_DATA(ndarray arr)
- object PyArray_FromAny(object obj, dtype newtype, int mindim, int maxdim,
- int requirements, object context)
- object PyArray_FROMANY(object obj, NPY_TYPES type_num, int min,
- int max, int requirements)
- object PyArray_NewFromDescr(object subtype, dtype newtype, int nd,
- npy_intp* dims, npy_intp* strides, void* data,
- int flags, object parent)
-
- object PyArray_FROM_OTF(object obj, NPY_TYPES type, int flags)
- object PyArray_EnsureArray(object)
-
- object PyArray_MultiIterNew(int n, ...)
-
- char *PyArray_MultiIter_DATA(broadcast multi, int i)
- void PyArray_MultiIter_NEXTi(broadcast multi, int i)
- void PyArray_MultiIter_NEXT(broadcast multi)
-
- object PyArray_IterNew(object arr)
- void PyArray_ITER_NEXT(flatiter it)
-
- void import_array()
diff --git a/numpy/doc/cython/c_python.pxd b/numpy/doc/cython/c_python.pxd
deleted file mode 100644
index 46d2fd1a7..000000000
--- a/numpy/doc/cython/c_python.pxd
+++ /dev/null
@@ -1,62 +0,0 @@
-# :Author: Robert Kern
-# :Copyright: 2004, Enthought, Inc.
-# :License: BSD Style
-
-
-cdef extern from "Python.h":
- # Not part of the Python API, but we might as well define it here.
- # Note that the exact type doesn't actually matter for Pyrex.
- ctypedef int size_t
-
- # Some type declarations we need
- ctypedef int Py_intptr_t
-
-
- # String API
- char* PyString_AsString(object string)
- char* PyString_AS_STRING(object string)
- object PyString_FromString(char* c_string)
- object PyString_FromStringAndSize(char* c_string, int length)
- object PyString_InternFromString(char *v)
-
- # Float API
- object PyFloat_FromDouble(double v)
- double PyFloat_AsDouble(object ob)
- long PyInt_AsLong(object ob)
-
-
- # Memory API
- void* PyMem_Malloc(size_t n)
- void* PyMem_Realloc(void* buf, size_t n)
- void PyMem_Free(void* buf)
-
- void Py_DECREF(object obj)
- void Py_XDECREF(object obj)
- void Py_INCREF(object obj)
- void Py_XINCREF(object obj)
-
- # CObject API
- ctypedef void (*destructor1)(void* cobj)
- ctypedef void (*destructor2)(void* cobj, void* desc)
- int PyCObject_Check(object p)
- object PyCObject_FromVoidPtr(void* cobj, destructor1 destr)
- object PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc,
- destructor2 destr)
- void* PyCObject_AsVoidPtr(object self)
- void* PyCObject_GetDesc(object self)
- int PyCObject_SetVoidPtr(object self, void* cobj)
-
- # TypeCheck API
- int PyFloat_Check(object obj)
- int PyInt_Check(object obj)
-
- # Error API
- int PyErr_Occurred()
- void PyErr_Clear()
- int PyErr_CheckSignals()
-
-cdef extern from "string.h":
- void *memcpy(void *s1, void *s2, int n)
-
-cdef extern from "math.h":
- double fabs(double x)
diff --git a/numpy/doc/cython/numpyx.pyx b/numpy/doc/cython/numpyx.pyx
deleted file mode 100644
index cbc786ef0..000000000
--- a/numpy/doc/cython/numpyx.pyx
+++ /dev/null
@@ -1,127 +0,0 @@
-# -*- Mode: Python -*- Not really, but close enough
-"""Cython access to Numpy arrays - simple example.
-"""
-
-#############################################################################
-# Load C APIs declared in .pxd files via cimport
-#
-# A 'cimport' is similar to a Python 'import' statement, but it provides access
-# to the C part of a library instead of its Python-visible API. See the
-# Pyrex/Cython documentation for details.
-
-cimport c_python as py
-
-cimport c_numpy as cnp
-
-# NOTE: numpy MUST be initialized before any other code is executed.
-cnp.import_array()
-
-#############################################################################
-# Load Python modules via normal import statements
-
-import numpy as np
-
-#############################################################################
-# Regular code section begins
-
-# A 'def' function is visible in the Python-imported module
-def print_array_info(cnp.ndarray arr):
- """Simple information printer about an array.
-
- Code meant to illustrate Cython/NumPy integration only."""
-
- cdef int i
-
- print '-='*10
- # Note: the double cast here (void * first, then py.Py_intptr_t) is needed
- # in Cython but not in Pyrex, since the casting behavior of cython is
- # slightly different (and generally safer) than that of Pyrex. In this
- # case, we just want the memory address of the actual Array object, so we
- # cast it to void before doing the py.Py_intptr_t cast:
- print 'Printing array info for ndarray at 0x%0lx'% \
- (<py.Py_intptr_t><void *>arr,)
- print 'number of dimensions:',arr.nd
- print 'address of strides: 0x%0lx'%(<py.Py_intptr_t>arr.strides,)
- print 'strides:'
- for i from 0<=i<arr.nd:
- # print each stride
- print ' stride %d:'%i,<py.Py_intptr_t>arr.strides[i]
- print 'memory dump:'
- print_elements( arr.data, arr.strides, arr.dimensions,
- arr.nd, sizeof(double), arr.dtype )
- print '-='*10
- print
-
-# A 'cdef' function is NOT visible to the python side, but it is accessible to
-# the rest of this Cython module
-cdef print_elements(char *data,
- py.Py_intptr_t* strides,
- py.Py_intptr_t* dimensions,
- int nd,
- int elsize,
- object dtype):
- cdef py.Py_intptr_t i,j
- cdef void* elptr
-
- if dtype not in [np.dtype(np.object_),
- np.dtype(np.float64)]:
- print ' print_elements() not (yet) implemented for dtype %s'%dtype.name
- return
-
- if nd ==0:
- if dtype==np.dtype(np.object_):
- elptr = (<void**>data)[0] #[0] dereferences pointer in Pyrex
- print ' ',<object>elptr
- elif dtype==np.dtype(np.float64):
- print ' ',(<double*>data)[0]
- elif nd == 1:
- for i from 0<=i<dimensions[0]:
- if dtype==np.dtype(np.object_):
- elptr = (<void**>data)[0]
- print ' ',<object>elptr
- elif dtype==np.dtype(np.float64):
- print ' ',(<double*>data)[0]
- data = data + strides[0]
- else:
- for i from 0<=i<dimensions[0]:
- print_elements(data, strides+1, dimensions+1, nd-1, elsize, dtype)
- data = data + strides[0]
-
-def test_methods(cnp.ndarray arr):
- """Test a few attribute accesses for an array.
-
- This illustrates how the pyrex-visible object is in practice a strange
- hybrid of the C PyArrayObject struct and the python object. Some
- properties (like .nd) are visible here but not in python, while others
- like flags behave very differently: in python flags appears as a separate,
- object while here we see the raw int holding the bit pattern.
-
- This makes sense when we think of how pyrex resolves arr.foo: if foo is
- listed as a field in the ndarray struct description, it will be directly
- accessed as a C variable without going through Python at all. This is why
- for arr.flags, we see the actual int which holds all the flags as bit
- fields. However, for any other attribute not listed in the struct, it
- simply forwards the attribute lookup to python at runtime, just like python
- would (which means that AttributeError can be raised for non-existent
- attributes, for example)."""
-
- print 'arr.any() :',arr.any()
- print 'arr.nd :',arr.nd
- print 'arr.flags :',arr.flags
-
-def test():
- """this function is pure Python"""
- arr1 = np.array(-1e-30,dtype=np.float64)
- arr2 = np.array([1.0,2.0,3.0],dtype=np.float64)
-
- arr3 = np.arange(9,dtype=np.float64)
- arr3.shape = 3,3
-
- four = 4
- arr4 = np.array(['one','two',3,four],dtype=np.object_)
-
- arr5 = np.array([1,2,3]) # int types not (yet) supported by print_elements
-
- for arr in [arr1,arr2,arr3,arr4,arr5]:
- print_array_info(arr)
-
diff --git a/numpy/doc/cython/run_test.py b/numpy/doc/cython/run_test.py
deleted file mode 100755
index 96388011e..000000000
--- a/numpy/doc/cython/run_test.py
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env python
-from numpyx import test
-test()
diff --git a/numpy/doc/cython/setup.py b/numpy/doc/cython/setup.py
deleted file mode 100755
index 270e11c56..000000000
--- a/numpy/doc/cython/setup.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-"""Install file for example on how to use Cython with Numpy.
-
-Note: Cython is the successor project to Pyrex. For more information, see
-http://cython.org.
-"""
-
-from distutils.core import setup
-from distutils.extension import Extension
-
-import numpy
-
-# We detect whether Cython is available, so that below, we can eventually ship
-# pre-generated C for users to compile the extension without having Cython
-# installed on their systems.
-try:
- from Cython.Distutils import build_ext
- has_cython = True
-except ImportError:
- has_cython = False
-
-# Define a cython-based extension module, using the generated sources if cython
-# is not available.
-if has_cython:
- pyx_sources = ['numpyx.pyx']
- cmdclass = {'build_ext': build_ext}
-else:
- # In production work, you can ship the auto-generated C source yourself to
- # your users. In this case, we do NOT ship the .c file as part of numpy,
- # so you'll need to actually have cython installed at least the first
- # time. Since this is really just an example to show you how to use
- # *Cython*, it makes more sense NOT to ship the C sources so you can edit
- # the pyx at will with less chances for source update conflicts when you
- # update numpy.
- pyx_sources = ['numpyx.c']
- cmdclass = {}
-
-
-# Declare the extension object
-pyx_ext = Extension('numpyx',
- pyx_sources,
- include_dirs = [numpy.get_include()])
-
-# Call the routine which does the real work
-setup(name = 'numpyx',
- description = 'Small example on using Cython to write a Numpy extension',
- ext_modules = [pyx_ext],
- cmdclass = cmdclass,
- )
diff --git a/numpy/doc/example.py b/numpy/doc/example.py
deleted file mode 100644
index 152e2a622..000000000
--- a/numpy/doc/example.py
+++ /dev/null
@@ -1,125 +0,0 @@
-"""This is the docstring for the example.py module. Modules names should
-have short, all-lowercase names. The module name may have underscores if
-this improves readability.
-
-Every module should have a docstring at the very top of the file. The
-module's docstring may extend over multiple lines. If your docstring does
-extend over multiple lines, the closing three quotation marks must be on
-a line by itself, preferably preceeded by a blank line.
-
-"""
-import os # standard library imports first
-
-# Do NOT import using *, e.g. from numpy import *
-#
-# Import the module using
-#
-# import numpy
-#
-# instead or import individual functions as needed, e.g
-#
-# from numpy import array, zeros
-#
-# If you prefer the use of abbreviated module names, we suggest the
-# convention used by NumPy itself::
-
-import numpy as np
-import scipy as sp
-import matplotlib as mpl
-import matplotlib.pyplot as plt
-
-# These abbreviated names are not to be used in docstrings; users must
-# be able to paste and execute docstrings after importing only the
-# numpy module itself, unabbreviated.
-
-from my_module import my_func, other_func
-
-def foo(var1, var2, long_var_name='hi') :
- """A one-line summary that does not use variable names or the
- function name.
-
- Several sentences providing an extended description. Refer to
- variables using back-ticks, e.g. `var`.
-
- Parameters
- ----------
- var1 : array_like
- Array_like means all those objects -- lists, nested lists, etc. --
- that can be converted to an array. We can also refer to
- variables like `var1`.
- var2 : int
- The type above can either refer to an actual Python type
- (e.g. ``int``), or describe the type of the variable in more
- detail, e.g. ``(N,) ndarray`` or ``array_like``.
- Long_variable_name : {'hi', 'ho'}, optional
- Choices in brackets, default first when optional.
-
- Returns
- -------
- describe : type
- Explanation
- output
- Explanation
- tuple
- Explanation
- items
- even more explaining
-
- Other Parameters
- ----------------
- only_seldom_used_keywords : type
- Explanation
- common_parameters_listed_above : type
- Explanation
-
- Raises
- ------
- BadException
- Because you shouldn't have done that.
-
- See Also
- --------
- otherfunc : relationship (optional)
- newfunc : Relationship (optional), which could be fairly long, in which
- case the line wraps here.
- thirdfunc, fourthfunc, fifthfunc
-
- Notes
- -----
- Notes about the implementation algorithm (if needed).
-
- This can have multiple paragraphs.
-
- You may include some math:
-
- .. math:: X(e^{j\omega } ) = x(n)e^{ - j\omega n}
-
- And even use a greek symbol like :math:`omega` inline.
-
- References
- ----------
- Cite the relevant literature, e.g. [1]_. You may also cite these
- references in the notes section above.
-
- .. [1] O. McNoleg, "The integration of GIS, remote sensing,
- expert systems and adaptive co-kriging for environmental habitat
- modelling of the Highland Haggis using object-oriented, fuzzy-logic
- and neural-network techniques," Computers & Geosciences, vol. 22,
- pp. 585-588, 1996.
-
- Examples
- --------
- These are written in doctest format, and should illustrate how to
- use the function.
-
- >>> a=[1,2,3]
- >>> print [x + 3 for x in a]
- [4, 5, 6]
- >>> print "a\n\nb"
- a
- <BLANKLINE>
- b
-
- """
-
- pass
diff --git a/numpy/doc/reference/glossary.py b/numpy/doc/glossary.py
index 6a182adf4..6a182adf4 100644
--- a/numpy/doc/reference/glossary.py
+++ b/numpy/doc/glossary.py
diff --git a/numpy/doc/reference/howtofind.py b/numpy/doc/howtofind.py
index 29ad05318..29ad05318 100644
--- a/numpy/doc/reference/howtofind.py
+++ b/numpy/doc/howtofind.py
diff --git a/numpy/doc/html/api-objects.txt b/numpy/doc/html/api-objects.txt
deleted file mode 100644
index 81953990e..000000000
--- a/numpy/doc/html/api-objects.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-example example-module.html
-example.otherfunc example-module.html#otherfunc
-example.foo example-module.html#foo
-example.newfunc example-module.html#newfunc
diff --git a/numpy/doc/html/crarr.png b/numpy/doc/html/crarr.png
deleted file mode 100644
index 26b43c524..000000000
--- a/numpy/doc/html/crarr.png
+++ /dev/null
Binary files differ
diff --git a/numpy/doc/html/epydoc.css b/numpy/doc/html/epydoc.css
deleted file mode 100644
index 86d417068..000000000
--- a/numpy/doc/html/epydoc.css
+++ /dev/null
@@ -1,322 +0,0 @@
-
-
-/* Epydoc CSS Stylesheet
- *
- * This stylesheet can be used to customize the appearance of epydoc's
- * HTML output.
- *
- */
-
-/* Default Colors & Styles
- * - Set the default foreground & background color with 'body'; and
- * link colors with 'a:link' and 'a:visited'.
- * - Use bold for decision list terms.
- * - The heading styles defined here are used for headings *within*
- * docstring descriptions. All headings used by epydoc itself use
- * either class='epydoc' or class='toc' (CSS styles for both
- * defined below).
- */
-body { background: #ffffff; color: #000000; }
-p { margin-top: 0.5em; margin-bottom: 0.5em; }
-a:link { color: #0000ff; }
-a:visited { color: #204080; }
-dt { font-weight: bold; }
-h1 { font-size: +140%; font-style: italic;
- font-weight: bold; }
-h2 { font-size: +125%; font-style: italic;
- font-weight: bold; }
-h3 { font-size: +110%; font-style: italic;
- font-weight: normal; }
-code { font-size: 100%; }
-/* N.B.: class, not pseudoclass */
-a.link { font-family: monospace; }
-
-/* Page Header & Footer
- * - The standard page header consists of a navigation bar (with
- * pointers to standard pages such as 'home' and 'trees'); a
- * breadcrumbs list, which can be used to navigate to containing
- * classes or modules; options links, to show/hide private
- * variables and to show/hide frames; and a page title (using
- * <h1>). The page title may be followed by a link to the
- * corresponding source code (using 'span.codelink').
- * - The footer consists of a navigation bar, a timestamp, and a
- * pointer to epydoc's homepage.
- */
-h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; }
-h2.epydoc { font-size: +130%; font-weight: bold; }
-h3.epydoc { font-size: +115%; font-weight: bold;
- margin-top: 0.2em; }
-td h3.epydoc { font-size: +115%; font-weight: bold;
- margin-bottom: 0; }
-table.navbar { background: #a0c0ff; color: #000000;
- border: 2px groove #c0d0d0; }
-table.navbar table { color: #000000; }
-th.navbar-select { background: #70b0ff;
- color: #000000; }
-table.navbar a { text-decoration: none; }
-table.navbar a:link { color: #0000ff; }
-table.navbar a:visited { color: #204080; }
-span.breadcrumbs { font-size: 85%; font-weight: bold; }
-span.options { font-size: 70%; }
-span.codelink { font-size: 85%; }
-td.footer { font-size: 85%; }
-
-/* Table Headers
- * - Each summary table and details section begins with a 'header'
- * row. This row contains a section title (marked by
- * 'span.table-header') as well as a show/hide private link
- * (marked by 'span.options', defined above).
- * - Summary tables that contain user-defined groups mark those
- * groups using 'group header' rows.
- */
-td.table-header { background: #70b0ff; color: #000000;
- border: 1px solid #608090; }
-td.table-header table { color: #000000; }
-td.table-header table a:link { color: #0000ff; }
-td.table-header table a:visited { color: #204080; }
-span.table-header { font-size: 120%; font-weight: bold; }
-th.group-header { background: #c0e0f8; color: #000000;
- text-align: left; font-style: italic;
- font-size: 115%;
- border: 1px solid #608090; }
-
-/* Summary Tables (functions, variables, etc)
- * - Each object is described by a single row of the table with
- * two cells. The left cell gives the object's type, and is
- * marked with 'code.summary-type'. The right cell gives the
- * object's name and a summary description.
- * - CSS styles for the table's header and group headers are
- * defined above, under 'Table Headers'
- */
-table.summary { border-collapse: collapse;
- background: #e8f0f8; color: #000000;
- border: 1px solid #608090;
- margin-bottom: 0.5em; }
-td.summary { border: 1px solid #608090; }
-code.summary-type { font-size: 85%; }
-table.summary a:link { color: #0000ff; }
-table.summary a:visited { color: #204080; }
-
-
-/* Details Tables (functions, variables, etc)
- * - Each object is described in its own div.
- * - A single-row summary table w/ table-header is used as
- * a header for each details section (CSS style for table-header
- * is defined above, under 'Table Headers').
- */
-table.details { border-collapse: collapse;
- background: #e8f0f8; color: #000000;
- border: 1px solid #608090;
- margin: .2em 0 0 0; }
-table.details table { color: #000000; }
-table.details a:link { color: #0000ff; }
-table.details a:visited { color: #204080; }
-
-/* Fields */
-dl.fields { margin-left: 2em; margin-top: 1em;
- margin-bottom: 1em; }
-dl.fields dd ul { margin-left: 0em; padding-left: 0em; }
-dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; }
-div.fields { margin-left: 2em; }
-div.fields p { margin-bottom: 0.5em; }
-
-/* Index tables (identifier index, term index, etc)
- * - link-index is used for indices containing lists of links
- * (namely, the identifier index & term index).
- * - index-where is used in link indices for the text indicating
- * the container/source for each link.
- * - metadata-index is used for indices containing metadata
- * extracted from fields (namely, the bug index & todo index).
- */
-table.link-index { border-collapse: collapse;
- background: #e8f0f8; color: #000000;
- border: 1px solid #608090; }
-td.link-index { border-width: 0px; }
-table.link-index a:link { color: #0000ff; }
-table.link-index a:visited { color: #204080; }
-span.index-where { font-size: 70%; }
-table.metadata-index { border-collapse: collapse;
- background: #e8f0f8; color: #000000;
- border: 1px solid #608090;
- margin: .2em 0 0 0; }
-td.metadata-index { border-width: 1px; border-style: solid; }
-table.metadata-index a:link { color: #0000ff; }
-table.metadata-index a:visited { color: #204080; }
-
-/* Function signatures
- * - sig* is used for the signature in the details section.
- * - .summary-sig* is used for the signature in the summary
- * table, and when listing property accessor functions.
- * */
-.sig-name { color: #006080; }
-.sig-arg { color: #008060; }
-.sig-default { color: #602000; }
-.summary-sig { font-family: monospace; }
-.summary-sig-name { color: #006080; font-weight: bold; }
-table.summary a.summary-sig-name:link
- { color: #006080; font-weight: bold; }
-table.summary a.summary-sig-name:visited
- { color: #006080; font-weight: bold; }
-.summary-sig-arg { color: #006040; }
-.summary-sig-default { color: #501800; }
-
-/* Subclass list
- */
-ul.subclass-list { display: inline; }
-ul.subclass-list li { display: inline; }
-
-/* To render variables, classes etc. like functions */
-table.summary .summary-name { color: #006080; font-weight: bold;
- font-family: monospace; }
-table.summary
- a.summary-name:link { color: #006080; font-weight: bold;
- font-family: monospace; }
-table.summary
- a.summary-name:visited { color: #006080; font-weight: bold;
- font-family: monospace; }
-
-/* Variable values
- * - In the 'variable details' sections, each varaible's value is
- * listed in a 'pre.variable' box. The width of this box is
- * restricted to 80 chars; if the value's repr is longer than
- * this it will be wrapped, using a backslash marked with
- * class 'variable-linewrap'. If the value's repr is longer
- * than 3 lines, the rest will be ellided; and an ellipsis
- * marker ('...' marked with 'variable-ellipsis') will be used.
- * - If the value is a string, its quote marks will be marked
- * with 'variable-quote'.
- * - If the variable is a regexp, it is syntax-highlighted using
- * the re* CSS classes.
- */
-pre.variable { padding: .5em; margin: 0;
- background: #dce4ec; color: #000000;
- border: 1px solid #708890; }
-.variable-linewrap { color: #604000; font-weight: bold; }
-.variable-ellipsis { color: #604000; font-weight: bold; }
-.variable-quote { color: #604000; font-weight: bold; }
-.variable-group { color: #008000; font-weight: bold; }
-.variable-op { color: #604000; font-weight: bold; }
-.variable-string { color: #006030; }
-.variable-unknown { color: #a00000; font-weight: bold; }
-.re { color: #000000; }
-.re-char { color: #006030; }
-.re-op { color: #600000; }
-.re-group { color: #003060; }
-.re-ref { color: #404040; }
-
-/* Base tree
- * - Used by class pages to display the base class hierarchy.
- */
-pre.base-tree { font-size: 80%; margin: 0; }
-
-/* Frames-based table of contents headers
- * - Consists of two frames: one for selecting modules; and
- * the other listing the contents of the selected module.
- * - h1.toc is used for each frame's heading
- * - h2.toc is used for subheadings within each frame.
- */
-h1.toc { text-align: center; font-size: 105%;
- margin: 0; font-weight: bold;
- padding: 0; }
-h2.toc { font-size: 100%; font-weight: bold;
- margin: 0.5em 0 0 -0.3em; }
-
-/* Syntax Highlighting for Source Code
- * - doctest examples are displayed in a 'pre.py-doctest' block.
- * If the example is in a details table entry, then it will use
- * the colors specified by the 'table pre.py-doctest' line.
- * - Source code listings are displayed in a 'pre.py-src' block.
- * Each line is marked with 'span.py-line' (used to draw a line
- * down the left margin, separating the code from the line
- * numbers). Line numbers are displayed with 'span.py-lineno'.
- * The expand/collapse block toggle button is displayed with
- * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not
- * modify the font size of the text.)
- * - If a source code page is opened with an anchor, then the
- * corresponding code block will be highlighted. The code
- * block's header is highlighted with 'py-highlight-hdr'; and
- * the code block's body is highlighted with 'py-highlight'.
- * - The remaining py-* classes are used to perform syntax
- * highlighting (py-string for string literals, py-name for names,
- * etc.)
- */
-pre.py-doctest { padding: .5em; margin: 1em;
- background: #e8f0f8; color: #000000;
- border: 1px solid #708890; }
-table pre.py-doctest { background: #dce4ec;
- color: #000000; }
-pre.py-src { border: 2px solid #000000;
- background: #f0f0f0; color: #000000; }
-.py-line { border-left: 2px solid #000000;
- margin-left: .2em; padding-left: .4em; }
-.py-lineno { font-style: italic; font-size: 90%;
- padding-left: .5em; }
-a.py-toggle { text-decoration: none; }
-div.py-highlight-hdr { border-top: 2px solid #000000;
- border-bottom: 2px solid #000000;
- background: #d8e8e8; }
-div.py-highlight { border-bottom: 2px solid #000000;
- background: #d0e0e0; }
-.py-prompt { color: #005050; font-weight: bold;}
-.py-more { color: #005050; font-weight: bold;}
-.py-string { color: #006030; }
-.py-comment { color: #003060; }
-.py-keyword { color: #600000; }
-.py-output { color: #404040; }
-.py-name { color: #000050; }
-.py-name:link { color: #000050 !important; }
-.py-name:visited { color: #000050 !important; }
-.py-number { color: #005000; }
-.py-defname { color: #000060; font-weight: bold; }
-.py-def-name { color: #000060; font-weight: bold; }
-.py-base-class { color: #000060; }
-.py-param { color: #000060; }
-.py-docstring { color: #006030; }
-.py-decorator { color: #804020; }
-/* Use this if you don't want links to names underlined: */
-/*a.py-name { text-decoration: none; }*/
-
-/* Graphs & Diagrams
- * - These CSS styles are used for graphs & diagrams generated using
- * Graphviz dot. 'img.graph-without-title' is used for bare
- * diagrams (to remove the border created by making the image
- * clickable).
- */
-img.graph-without-title { border: none; }
-img.graph-with-title { border: 1px solid #000000; }
-span.graph-title { font-weight: bold; }
-span.graph-caption { }
-
-/* General-purpose classes
- * - 'p.indent-wrapped-lines' defines a paragraph whose first line
- * is not indented, but whose subsequent lines are.
- * - The 'nomargin-top' class is used to remove the top margin (e.g.
- * from lists). The 'nomargin' class is used to remove both the
- * top and bottom margin (but not the left or right margin --
- * for lists, that would cause the bullets to disappear.)
- */
-p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em;
- margin: 0; }
-.nomargin-top { margin-top: 0; }
-.nomargin { margin-top: 0; margin-bottom: 0; }
-
-/* HTML Log */
-div.log-block { padding: 0; margin: .5em 0 .5em 0;
- background: #e8f0f8; color: #000000;
- border: 1px solid #000000; }
-div.log-error { padding: .1em .3em .1em .3em; margin: 4px;
- background: #ffb0b0; color: #000000;
- border: 1px solid #000000; }
-div.log-warning { padding: .1em .3em .1em .3em; margin: 4px;
- background: #ffffb0; color: #000000;
- border: 1px solid #000000; }
-div.log-info { padding: .1em .3em .1em .3em; margin: 4px;
- background: #b0ffb0; color: #000000;
- border: 1px solid #000000; }
-h2.log-hdr { background: #70b0ff; color: #000000;
- margin: 0; padding: 0em 0.5em 0em 0.5em;
- border-bottom: 1px solid #000000; font-size: 110%; }
-p.log { font-weight: bold; margin: .5em 0 .5em 0; }
-tr.opt-changed { color: #000000; font-weight: bold; }
-tr.opt-default { color: #606060; }
-pre.log { margin: 0; padding: 0; padding-left: 1em; }
diff --git a/numpy/doc/html/epydoc.js b/numpy/doc/html/epydoc.js
deleted file mode 100644
index e787dbcf4..000000000
--- a/numpy/doc/html/epydoc.js
+++ /dev/null
@@ -1,293 +0,0 @@
-function toggle_private() {
- // Search for any private/public links on this page. Store
- // their old text in "cmd," so we will know what action to
- // take; and change their text to the opposite action.
- var cmd = "?";
- var elts = document.getElementsByTagName("a");
- for(var i=0; i<elts.length; i++) {
- if (elts[i].className == "privatelink") {
- cmd = elts[i].innerHTML;
- elts[i].innerHTML = ((cmd && cmd.substr(0,4)=="show")?
- "hide&nbsp;private":"show&nbsp;private");
- }
- }
- // Update all DIVs containing private objects.
- var elts = document.getElementsByTagName("div");
- for(var i=0; i<elts.length; i++) {
- if (elts[i].className == "private") {
- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");
- }
- else if (elts[i].className == "public") {
- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"block":"none");
- }
- }
- // Update all table rows containing private objects. Note, we
- // use "" instead of "block" becaue IE & firefox disagree on what
- // this should be (block vs table-row), and "" just gives the
- // default for both browsers.
- var elts = document.getElementsByTagName("tr");
- for(var i=0; i<elts.length; i++) {
- if (elts[i].className == "private") {
- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"");
- }
- }
- // Update all list items containing private objects.
- var elts = document.getElementsByTagName("li");
- for(var i=0; i<elts.length; i++) {
- if (elts[i].className == "private") {
- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?
- "none":"");
- }
- }
- // Update all list items containing private objects.
- var elts = document.getElementsByTagName("ul");
- for(var i=0; i<elts.length; i++) {
- if (elts[i].className == "private") {
- elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");
- }
- }
- // Set a cookie to remember the current option.
- document.cookie = "EpydocPrivate="+cmd;
- }
-function show_private() {
- var elts = document.getElementsByTagName("a");
- for(var i=0; i<elts.length; i++) {
- if (elts[i].className == "privatelink") {
- cmd = elts[i].innerHTML;
- if (cmd && cmd.substr(0,4)=="show")
- toggle_private();
- }
- }
- }
-function getCookie(name) {
- var dc = document.cookie;
- var prefix = name + "=";
- var begin = dc.indexOf("; " + prefix);
- if (begin == -1) {
- begin = dc.indexOf(prefix);
- if (begin != 0) return null;
- } else
- { begin += 2; }
- var end = document.cookie.indexOf(";", begin);
- if (end == -1)
- { end = dc.length; }
- return unescape(dc.substring(begin + prefix.length, end));
- }
-function setFrame(url1, url2) {
- parent.frames[1].location.href = url1;
- parent.frames[2].location.href = url2;
- }
-function checkCookie() {
- var cmd=getCookie("EpydocPrivate");
- if (cmd && cmd.substr(0,4)!="show" && location.href.indexOf("#_") < 0)
- toggle_private();
- }
-function toggleCallGraph(id) {
- var elt = document.getElementById(id);
- if (elt.style.display == "none")
- elt.style.display = "block";
- else
- elt.style.display = "none";
- }
-function expand(id) {
- var elt = document.getElementById(id+"-expanded");
- if (elt) elt.style.display = "block";
- var elt = document.getElementById(id+"-expanded-linenums");
- if (elt) elt.style.display = "block";
- var elt = document.getElementById(id+"-collapsed");
- if (elt) { elt.innerHTML = ""; elt.style.display = "none"; }
- var elt = document.getElementById(id+"-collapsed-linenums");
- if (elt) { elt.innerHTML = ""; elt.style.display = "none"; }
- var elt = document.getElementById(id+"-toggle");
- if (elt) { elt.innerHTML = "-"; }
-}
-
-function collapse(id) {
- var elt = document.getElementById(id+"-expanded");
- if (elt) elt.style.display = "none";
- var elt = document.getElementById(id+"-expanded-linenums");
- if (elt) elt.style.display = "none";
- var elt = document.getElementById(id+"-collapsed-linenums");
- if (elt) { elt.innerHTML = "<br />"; elt.style.display="block"; }
- var elt = document.getElementById(id+"-toggle");
- if (elt) { elt.innerHTML = "+"; }
- var elt = document.getElementById(id+"-collapsed");
- if (elt) {
- elt.style.display = "block";
-
- var indent = elt.getAttribute("indent");
- var pad = elt.getAttribute("pad");
- var s = "<tt class='py-lineno'>";
- for (var i=0; i<pad.length; i++) { s += "&nbsp;" }
- s += "</tt>";
- s += "&nbsp;&nbsp;<tt class='py-line'>";
- for (var i=0; i<indent.length; i++) { s += "&nbsp;" }
- s += "<a href='#' onclick='expand(\"" + id;
- s += "\");return false'>...</a></tt><br />";
- elt.innerHTML = s;
- }
-}
-
-function toggle(id) {
- elt = document.getElementById(id+"-toggle");
- if (elt.innerHTML == "-")
- collapse(id);
- else
- expand(id);
- return false;
-}
-
-function highlight(id) {
- var elt = document.getElementById(id+"-def");
- if (elt) elt.className = "py-highlight-hdr";
- var elt = document.getElementById(id+"-expanded");
- if (elt) elt.className = "py-highlight";
- var elt = document.getElementById(id+"-collapsed");
- if (elt) elt.className = "py-highlight";
-}
-
-function num_lines(s) {
- var n = 1;
- var pos = s.indexOf("\n");
- while ( pos > 0) {
- n += 1;
- pos = s.indexOf("\n", pos+1);
- }
- return n;
-}
-
-// Collapse all blocks that mave more than `min_lines` lines.
-function collapse_all(min_lines) {
- var elts = document.getElementsByTagName("div");
- for (var i=0; i<elts.length; i++) {
- var elt = elts[i];
- var split = elt.id.indexOf("-");
- if (split > 0)
- if (elt.id.substring(split, elt.id.length) == "-expanded")
- if (num_lines(elt.innerHTML) > min_lines)
- collapse(elt.id.substring(0, split));
- }
-}
-
-function expandto(href) {
- var start = href.indexOf("#")+1;
- if (start != 0 && start != href.length) {
- if (href.substring(start, href.length) != "-") {
- collapse_all(4);
- pos = href.indexOf(".", start);
- while (pos != -1) {
- var id = href.substring(start, pos);
- expand(id);
- pos = href.indexOf(".", pos+1);
- }
- var id = href.substring(start, href.length);
- expand(id);
- highlight(id);
- }
- }
-}
-
-function kill_doclink(id) {
- var parent = document.getElementById(id);
- parent.removeChild(parent.childNodes.item(0));
-}
-function auto_kill_doclink(ev) {
- if (!ev) var ev = window.event;
- if (!this.contains(ev.toElement)) {
- var parent = document.getElementById(this.parentID);
- parent.removeChild(parent.childNodes.item(0));
- }
-}
-
-function doclink(id, name, targets_id) {
- var elt = document.getElementById(id);
-
- // If we already opened the box, then destroy it.
- // (This case should never occur, but leave it in just in case.)
- if (elt.childNodes.length > 1) {
- elt.removeChild(elt.childNodes.item(0));
- }
- else {
- // The outer box: relative + inline positioning.
- var box1 = document.createElement("div");
- box1.style.position = "relative";
- box1.style.display = "inline";
- box1.style.top = 0;
- box1.style.left = 0;
-
- // A shadow for fun
- var shadow = document.createElement("div");
- shadow.style.position = "absolute";
- shadow.style.left = "-1.3em";
- shadow.style.top = "-1.3em";
- shadow.style.background = "#404040";
-
- // The inner box: absolute positioning.
- var box2 = document.createElement("div");
- box2.style.position = "relative";
- box2.style.border = "1px solid #a0a0a0";
- box2.style.left = "-.2em";
- box2.style.top = "-.2em";
- box2.style.background = "white";
- box2.style.padding = ".3em .4em .3em .4em";
- box2.style.fontStyle = "normal";
- box2.onmouseout=auto_kill_doclink;
- box2.parentID = id;
-
- // Get the targets
- var targets_elt = document.getElementById(targets_id);
- var targets = targets_elt.getAttribute("targets");
- var links = "";
- target_list = targets.split(",");
- for (var i=0; i<target_list.length; i++) {
- var target = target_list[i].split("=");
- links += "<li><a href='" + target[1] +
- "' style='text-decoration:none'>" +
- target[0] + "</a></li>";
- }
-
- // Put it all together.
- elt.insertBefore(box1, elt.childNodes.item(0));
- //box1.appendChild(box2);
- box1.appendChild(shadow);
- shadow.appendChild(box2);
- box2.innerHTML =
- "Which <b>"+name+"</b> do you want to see documentation for?" +
- "<ul style='margin-bottom: 0;'>" +
- links +
- "<li><a href='#' style='text-decoration:none' " +
- "onclick='kill_doclink(\""+id+"\");return false;'>"+
- "<i>None of the above</i></a></li></ul>";
- }
- return false;
-}
-
-function get_anchor() {
- var href = location.href;
- var start = href.indexOf("#")+1;
- if ((start != 0) && (start != href.length))
- return href.substring(start, href.length);
- }
-function redirect_url(dottedName) {
- // Scan through each element of the "pages" list, and check
- // if "name" matches with any of them.
- for (var i=0; i<pages.length; i++) {
-
- // Each page has the form "<pagename>-m" or "<pagename>-c";
- // extract the <pagename> portion & compare it to dottedName.
- var pagename = pages[i].substring(0, pages[i].length-2);
- if (pagename == dottedName.substring(0,pagename.length)) {
-
- // We've found a page that matches `dottedName`;
- // construct its URL, using leftover `dottedName`
- // content to form an anchor.
- var pagetype = pages[i].charAt(pages[i].length-1);
- var url = pagename + ((pagetype=="m")?"-module.html":
- "-class.html");
- if (dottedName.length > pagename.length)
- url += "#" + dottedName.substring(pagename.length+1,
- dottedName.length);
- return url;
- }
- }
- }
diff --git a/numpy/doc/html/example-module.html b/numpy/doc/html/example-module.html
deleted file mode 100644
index f08370632..000000000
--- a/numpy/doc/html/example-module.html
+++ /dev/null
@@ -1,316 +0,0 @@
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>example</title>
- <link rel="stylesheet" href="epydoc.css" type="text/css" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-
-<body bgcolor="white" text="black" link="blue" vlink="#204080"
- alink="#204080">
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table width="100%" cellpadding="0" cellspacing="0">
- <tr valign="top">
- <td width="100%">
- <span class="breadcrumbs">
- Module&nbsp;example
- </span>
- </td>
- <td>
- <table cellpadding="0" cellspacing="0">
- <!-- hide/show private -->
- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
- onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
- <tr><td align="right"><span class="options"
- >[<a href="frames.html" target="_top">frames</a
- >]&nbsp;|&nbsp;<a href="example-module.html"
- target="_top">no&nbsp;frames</a>]</span></td></tr>
- </table>
- </td>
- </tr>
-</table>
-<!-- ==================== MODULE DESCRIPTION ==================== -->
-<h1 class="epydoc">Module example</h1><p class="nomargin-top"><span class="codelink"><a href="example-pysrc.html">source&nbsp;code</a></span></p>
-<p>This is the docstring for the example.py module. Modules names should
-have short, all-lowercase names. The module name may have underscores if
-this improves readability.</p>
-<p>Every module should have a docstring at the very top of the file. The
-module's docstring may extend over multiple lines. If your docstring does
-extend over multiple lines, the closing three quotation marks must be on
-a line by itself, preferably preceeded by a blank line.</p>
-
-<!-- ==================== FUNCTIONS ==================== -->
-<a name="section-Functions"></a>
-<table class="summary" border="1" cellpadding="3"
- cellspacing="0" width="100%" bgcolor="white">
-<tr bgcolor="#70b0f0" class="table-header">
- <td colspan="2" class="table-header">
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr valign="top">
- <td align="left"><span class="table-header">Functions</span></td>
- <td align="right" valign="top"
- ><span class="options">[<a href="#section-Functions"
- class="privatelink" onclick="toggle_private();"
- >hide private</a>]</span></td>
- </tr>
- </table>
- </td>
-</tr>
-<tr>
- <td width="15%" align="right" valign="top" class="summary">
- <span class="summary-type">&nbsp;</span>
- </td><td class="summary">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td><span class="summary-sig"><a href="example-module.html#foo" class="summary-sig-name">foo</a>(<span class="summary-sig-arg">var1</span>,
- <span class="summary-sig-arg">var2</span>,
- <span class="summary-sig-arg">long_var_name</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">hi</code><code class="variable-quote">'</code></span>)</span><br />
- One-line summary or signature.</td>
- <td align="right" valign="top">
- <span class="codelink"><a href="example-pysrc.html#foo">source&nbsp;code</a></span>
-
- </td>
- </tr>
- </table>
-
- </td>
- </tr>
-<tr>
- <td width="15%" align="right" valign="top" class="summary">
- <span class="summary-type">&nbsp;</span>
- </td><td class="summary">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td><span class="summary-sig"><a href="example-module.html#newfunc" class="summary-sig-name">newfunc</a>()</span><br />
- Do nothing.</td>
- <td align="right" valign="top">
- <span class="codelink"><a href="example-pysrc.html#newfunc">source&nbsp;code</a></span>
-
- </td>
- </tr>
- </table>
-
- </td>
- </tr>
-<tr>
- <td width="15%" align="right" valign="top" class="summary">
- <span class="summary-type">&nbsp;</span>
- </td><td class="summary">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td><span class="summary-sig"><a href="example-module.html#otherfunc" class="summary-sig-name">otherfunc</a>()</span><br />
- Do nothing.</td>
- <td align="right" valign="top">
- <span class="codelink"><a href="example-pysrc.html#otherfunc">source&nbsp;code</a></span>
-
- </td>
- </tr>
- </table>
-
- </td>
- </tr>
-</table>
-<!-- ==================== FUNCTION DETAILS ==================== -->
-<a name="section-FunctionDetails"></a>
-<table class="details" border="1" cellpadding="3"
- cellspacing="0" width="100%" bgcolor="white">
-<tr bgcolor="#70b0f0" class="table-header">
- <td colspan="2" class="table-header">
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr valign="top">
- <td align="left"><span class="table-header">Function Details</span></td>
- <td align="right" valign="top"
- ><span class="options">[<a href="#section-FunctionDetails"
- class="privatelink" onclick="toggle_private();"
- >hide private</a>]</span></td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-<a name="foo"></a>
-<div>
-<table class="details" border="1" cellpadding="3"
- cellspacing="0" width="100%" bgcolor="white">
-<tr><td>
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr valign="top"><td>
- <h3 class="epydoc"><span class="sig"><span class="sig-name">foo</span>(<span class="sig-arg">var1</span>,
- <span class="sig-arg">var2</span>,
- <span class="sig-arg">long_var_name</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">hi</code><code class="variable-quote">'</code></span>)</span>
- </h3>
- </td><td align="right" valign="top"
- ><span class="codelink"><a href="example-pysrc.html#foo">source&nbsp;code</a></span>&nbsp;
- </td>
- </tr></table>
-
- <p>One-line summary or signature.</p>
-<p>Several sentences providing an extended description. You can put
-text in mono-spaced type like so: <tt class="rst-docutils literal"><span class="pre">var</span></tt>.</p>
-<div class="rst-section" id="rst-parameters">
-<h1 class="heading">Parameters</h1>
-<dl class="rst-docutils">
-<dt>var1 <span class="classifier-delimiter">:</span> <span class="rst-classifier">array_like</span></dt>
-<dd>Array_like means all those objects -- lists, nested lists, etc. --
-that can be converted to an array.</dd>
-<dt>var2 <span class="classifier-delimiter">:</span> <span class="rst-classifier">integer</span></dt>
-<dd>Write out the full type</dd>
-<dt>long_variable_name <span class="classifier-delimiter">:</span> <span class="rst-classifier">{'hi', 'ho'}, optional</span></dt>
-<dd>Choices in brackets, default first when optional.</dd>
-</dl>
-</div>
-<div class="rst-section" id="rst-returns">
-<h1 class="heading">Returns</h1>
-<dl class="rst-docutils">
-<dt>named <span class="classifier-delimiter">:</span> <span class="rst-classifier">type</span></dt>
-<dd>Explanation</dd>
-<dt>list</dt>
-<dd>Explanation</dd>
-<dt>of</dt>
-<dd>Explanation</dd>
-<dt>outputs</dt>
-<dd>even more explaining</dd>
-</dl>
-</div>
-<div class="rst-section" id="rst-other-parameters">
-<h1 class="heading">Other Parameters</h1>
-<dl class="rst-docutils">
-<dt>only_seldom_used_keywords <span class="classifier-delimiter">:</span> <span class="rst-classifier">type</span></dt>
-<dd>Explanation</dd>
-<dt>common_parametrs_listed_above <span class="classifier-delimiter">:</span> <span class="rst-classifier">type</span></dt>
-<dd>Explanation</dd>
-</dl>
-</div>
-<div class="rst-section" id="rst-see-also">
-<h1 class="heading">See Also</h1>
-<p>otherfunc : relationship (optional)
-newfunc : relationship (optional)</p>
-</div>
-<div class="rst-section" id="rst-notes">
-<h1 class="heading">Notes</h1>
-<p>Notes about the implementation algorithm (if needed).</p>
-<p>This can have multiple paragraphs as can all sections.</p>
-</div>
-<div class="rst-section" id="rst-examples">
-<h1 class="heading">Examples</h1>
-<p>examples in doctest format</p>
-<pre class="py-doctest">
-<span class="py-prompt">&gt;&gt;&gt; </span>a=[1,2,3]
-<span class="py-prompt">&gt;&gt;&gt; </span>[x + 3 <span class="py-keyword">for</span> x <span class="py-keyword">in</span> a]
-<span class="py-output">[4, 5, 6]</span></pre>
-</div>
- <dl class="fields">
- </dl>
-</td></tr></table>
-</div>
-<a name="newfunc"></a>
-<div>
-<table class="details" border="1" cellpadding="3"
- cellspacing="0" width="100%" bgcolor="white">
-<tr><td>
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr valign="top"><td>
- <h3 class="epydoc"><span class="sig"><span class="sig-name">newfunc</span>()</span>
- </h3>
- </td><td align="right" valign="top"
- ><span class="codelink"><a href="example-pysrc.html#newfunc">source&nbsp;code</a></span>&nbsp;
- </td>
- </tr></table>
-
- <p>Do nothing.</p>
-<p>I never saw a purple cow.</p>
- <dl class="fields">
- </dl>
-</td></tr></table>
-</div>
-<a name="otherfunc"></a>
-<div>
-<table class="details" border="1" cellpadding="3"
- cellspacing="0" width="100%" bgcolor="white">
-<tr><td>
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr valign="top"><td>
- <h3 class="epydoc"><span class="sig"><span class="sig-name">otherfunc</span>()</span>
- </h3>
- </td><td align="right" valign="top"
- ><span class="codelink"><a href="example-pysrc.html#otherfunc">source&nbsp;code</a></span>&nbsp;
- </td>
- </tr></table>
-
- <p>Do nothing.</p>
-<p>I never hope to see one.</p>
- <dl class="fields">
- </dl>
-</td></tr></table>
-</div>
-<br />
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table border="0" cellpadding="0" cellspacing="0" width="100%%">
- <tr>
- <td align="left" class="footer">
- Generated by Epydoc 3.0beta1 on Tue Jan 22 00:26:36 2008
- </td>
- <td align="right" class="footer">
- <a target="mainFrame" href="http://epydoc.sourceforge.net"
- >http://epydoc.sourceforge.net</a>
- </td>
- </tr>
-</table>
-
-<script type="text/javascript">
- <!--
- // Private objects are initially displayed (because if
- // javascript is turned off then we want them to be
- // visible); but by default, we want to hide them. So hide
- // them unless we have a cookie that says to show them.
- checkCookie();
- // -->
-</script>
-</body>
-</html>
diff --git a/numpy/doc/html/example-pysrc.html b/numpy/doc/html/example-pysrc.html
deleted file mode 100644
index f771330e2..000000000
--- a/numpy/doc/html/example-pysrc.html
+++ /dev/null
@@ -1,204 +0,0 @@
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>example</title>
- <link rel="stylesheet" href="epydoc.css" type="text/css" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-
-<body bgcolor="white" text="black" link="blue" vlink="#204080"
- alink="#204080">
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table width="100%" cellpadding="0" cellspacing="0">
- <tr valign="top">
- <td width="100%">
- <span class="breadcrumbs">
- Module&nbsp;example
- </span>
- </td>
- <td>
- <table cellpadding="0" cellspacing="0">
- <!-- hide/show private -->
- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
- onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
- <tr><td align="right"><span class="options"
- >[<a href="frames.html" target="_top">frames</a
- >]&nbsp;|&nbsp;<a href="example-pysrc.html"
- target="_top">no&nbsp;frames</a>]</span></td></tr>
- </table>
- </td>
- </tr>
-</table>
-<h1 class="epydoc">Source Code for <a href="example-module.html">Module example</a></h1>
-<pre class="py-src">
-<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-docstring">"""This is the docstring for the example.py module. Modules names should</tt> </tt>
-<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-docstring">have short, all-lowercase names. The module name may have underscores if</tt> </tt>
-<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-docstring">this improves readability.</tt> </tt>
-<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-docstring">Every module should have a docstring at the very top of the file. The</tt> </tt>
-<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-docstring">module's docstring may extend over multiple lines. If your docstring does</tt> </tt>
-<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-docstring">extend over multiple lines, the closing three quotation marks must be on</tt> </tt>
-<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-docstring">a line by itself, preferably preceeded by a blank line.</tt> </tt>
-<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L10"></a><tt class="py-lineno">10</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
-<a name="L11"></a><tt class="py-lineno">11</tt> <tt class="py-line"><tt class="py-name">__docformat__</tt> <tt class="py-op">=</tt> <tt class="py-string">"restructuredtext en"</tt> </tt>
-<a name="L12"></a><tt class="py-lineno">12</tt> <tt class="py-line"> </tt>
-<a name="L13"></a><tt class="py-lineno">13</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> <tt class="py-comment"># standard library imports first</tt> </tt>
-<a name="L14"></a><tt class="py-lineno">14</tt> <tt class="py-line"> </tt>
-<a name="L15"></a><tt class="py-lineno">15</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">numpy</tt> <tt class="py-keyword">as</tt> <tt class="py-name">np</tt> <tt class="py-comment"># related third party imports next</tt> </tt>
-<a name="L16"></a><tt class="py-lineno">16</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">scipy</tt> <tt class="py-keyword">as</tt> <tt class="py-name">sp</tt> <tt class="py-comment"># imports should be at the top of the module</tt> </tt>
-<a name="L17"></a><tt class="py-lineno">17</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">matplotlib</tt> <tt class="py-keyword">as</tt> <tt class="py-name">mpl</tt> <tt class="py-comment"># imports should usually be on separate lines</tt> </tt>
-<a name="L18"></a><tt class="py-lineno">18</tt> <tt class="py-line"> </tt>
-<a name="foo"></a><div id="foo-def"><a name="L19"></a><tt class="py-lineno">19</tt> <a class="py-toggle" href="#" id="foo-toggle" onclick="return toggle('foo');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="example-module.html#foo">foo</a><tt class="py-op">(</tt><tt class="py-param">var1</tt><tt class="py-op">,</tt> <tt class="py-param">var2</tt><tt class="py-op">,</tt> <tt class="py-param">long_var_name</tt><tt class="py-op">=</tt><tt class="py-string">'hi'</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
-</div><div id="foo-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="foo-expanded"><a name="L20"></a><tt class="py-lineno">20</tt> <tt class="py-line"> <tt class="py-docstring">"""One-line summary or signature.</tt> </tt>
-<a name="L21"></a><tt class="py-lineno">21</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L22"></a><tt class="py-lineno">22</tt> <tt class="py-line"><tt class="py-docstring"> Several sentences providing an extended description. You can put</tt> </tt>
-<a name="L23"></a><tt class="py-lineno">23</tt> <tt class="py-line"><tt class="py-docstring"> text in mono-spaced type like so: ``var``.</tt> </tt>
-<a name="L24"></a><tt class="py-lineno">24</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L25"></a><tt class="py-lineno">25</tt> <tt class="py-line"><tt class="py-docstring"> Parameters</tt> </tt>
-<a name="L26"></a><tt class="py-lineno">26</tt> <tt class="py-line"><tt class="py-docstring"> ----------</tt> </tt>
-<a name="L27"></a><tt class="py-lineno">27</tt> <tt class="py-line"><tt class="py-docstring"> var1 : array_like</tt> </tt>
-<a name="L28"></a><tt class="py-lineno">28</tt> <tt class="py-line"><tt class="py-docstring"> Array_like means all those objects -- lists, nested lists, etc. --</tt> </tt>
-<a name="L29"></a><tt class="py-lineno">29</tt> <tt class="py-line"><tt class="py-docstring"> that can be converted to an array.</tt> </tt>
-<a name="L30"></a><tt class="py-lineno">30</tt> <tt class="py-line"><tt class="py-docstring"> var2 : integer</tt> </tt>
-<a name="L31"></a><tt class="py-lineno">31</tt> <tt class="py-line"><tt class="py-docstring"> Write out the full type</tt> </tt>
-<a name="L32"></a><tt class="py-lineno">32</tt> <tt class="py-line"><tt class="py-docstring"> long_variable_name : {'hi', 'ho'}, optional</tt> </tt>
-<a name="L33"></a><tt class="py-lineno">33</tt> <tt class="py-line"><tt class="py-docstring"> Choices in brackets, default first when optional.</tt> </tt>
-<a name="L34"></a><tt class="py-lineno">34</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L35"></a><tt class="py-lineno">35</tt> <tt class="py-line"><tt class="py-docstring"> Returns</tt> </tt>
-<a name="L36"></a><tt class="py-lineno">36</tt> <tt class="py-line"><tt class="py-docstring"> -------</tt> </tt>
-<a name="L37"></a><tt class="py-lineno">37</tt> <tt class="py-line"><tt class="py-docstring"> named : type</tt> </tt>
-<a name="L38"></a><tt class="py-lineno">38</tt> <tt class="py-line"><tt class="py-docstring"> Explanation</tt> </tt>
-<a name="L39"></a><tt class="py-lineno">39</tt> <tt class="py-line"><tt class="py-docstring"> list</tt> </tt>
-<a name="L40"></a><tt class="py-lineno">40</tt> <tt class="py-line"><tt class="py-docstring"> Explanation</tt> </tt>
-<a name="L41"></a><tt class="py-lineno">41</tt> <tt class="py-line"><tt class="py-docstring"> of</tt> </tt>
-<a name="L42"></a><tt class="py-lineno">42</tt> <tt class="py-line"><tt class="py-docstring"> Explanation</tt> </tt>
-<a name="L43"></a><tt class="py-lineno">43</tt> <tt class="py-line"><tt class="py-docstring"> outputs</tt> </tt>
-<a name="L44"></a><tt class="py-lineno">44</tt> <tt class="py-line"><tt class="py-docstring"> even more explaining</tt> </tt>
-<a name="L45"></a><tt class="py-lineno">45</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L46"></a><tt class="py-lineno">46</tt> <tt class="py-line"><tt class="py-docstring"> Other Parameters</tt> </tt>
-<a name="L47"></a><tt class="py-lineno">47</tt> <tt class="py-line"><tt class="py-docstring"> ----------------</tt> </tt>
-<a name="L48"></a><tt class="py-lineno">48</tt> <tt class="py-line"><tt class="py-docstring"> only_seldom_used_keywords : type</tt> </tt>
-<a name="L49"></a><tt class="py-lineno">49</tt> <tt class="py-line"><tt class="py-docstring"> Explanation</tt> </tt>
-<a name="L50"></a><tt class="py-lineno">50</tt> <tt class="py-line"><tt class="py-docstring"> common_parametrs_listed_above : type</tt> </tt>
-<a name="L51"></a><tt class="py-lineno">51</tt> <tt class="py-line"><tt class="py-docstring"> Explanation</tt> </tt>
-<a name="L52"></a><tt class="py-lineno">52</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L53"></a><tt class="py-lineno">53</tt> <tt class="py-line"><tt class="py-docstring"> See Also</tt> </tt>
-<a name="L54"></a><tt class="py-lineno">54</tt> <tt class="py-line"><tt class="py-docstring"> -------- </tt> </tt>
-<a name="L55"></a><tt class="py-lineno">55</tt> <tt class="py-line"><tt class="py-docstring"> otherfunc : relationship (optional)</tt> </tt>
-<a name="L56"></a><tt class="py-lineno">56</tt> <tt class="py-line"><tt class="py-docstring"> newfunc : relationship (optional)</tt> </tt>
-<a name="L57"></a><tt class="py-lineno">57</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L58"></a><tt class="py-lineno">58</tt> <tt class="py-line"><tt class="py-docstring"> Notes</tt> </tt>
-<a name="L59"></a><tt class="py-lineno">59</tt> <tt class="py-line"><tt class="py-docstring"> -----</tt> </tt>
-<a name="L60"></a><tt class="py-lineno">60</tt> <tt class="py-line"><tt class="py-docstring"> Notes about the implementation algorithm (if needed).</tt> </tt>
-<a name="L61"></a><tt class="py-lineno">61</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L62"></a><tt class="py-lineno">62</tt> <tt class="py-line"><tt class="py-docstring"> This can have multiple paragraphs as can all sections.</tt> </tt>
-<a name="L63"></a><tt class="py-lineno">63</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L64"></a><tt class="py-lineno">64</tt> <tt class="py-line"><tt class="py-docstring"> Examples</tt> </tt>
-<a name="L65"></a><tt class="py-lineno">65</tt> <tt class="py-line"><tt class="py-docstring"> --------</tt> </tt>
-<a name="L66"></a><tt class="py-lineno">66</tt> <tt class="py-line"><tt class="py-docstring"> examples in doctest format</tt> </tt>
-<a name="L67"></a><tt class="py-lineno">67</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L68"></a><tt class="py-lineno">68</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; a=[1,2,3]</tt> </tt>
-<a name="L69"></a><tt class="py-lineno">69</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; [x + 3 for x in a]</tt> </tt>
-<a name="L70"></a><tt class="py-lineno">70</tt> <tt class="py-line"><tt class="py-docstring"> [4, 5, 6]</tt> </tt>
-<a name="L71"></a><tt class="py-lineno">71</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L72"></a><tt class="py-lineno">72</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
-<a name="L73"></a><tt class="py-lineno">73</tt> <tt class="py-line"> </tt>
-<a name="L74"></a><tt class="py-lineno">74</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
-</div><a name="L75"></a><tt class="py-lineno">75</tt> <tt class="py-line"> </tt>
-<a name="L76"></a><tt class="py-lineno">76</tt> <tt class="py-line"> </tt>
-<a name="newfunc"></a><div id="newfunc-def"><a name="L77"></a><tt class="py-lineno">77</tt> <a class="py-toggle" href="#" id="newfunc-toggle" onclick="return toggle('newfunc');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="example-module.html#newfunc">newfunc</a><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
-</div><div id="newfunc-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="newfunc-expanded"><a name="L78"></a><tt class="py-lineno">78</tt> <tt class="py-line"> <tt class="py-docstring">"""Do nothing.</tt> </tt>
-<a name="L79"></a><tt class="py-lineno">79</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L80"></a><tt class="py-lineno">80</tt> <tt class="py-line"><tt class="py-docstring"> I never saw a purple cow.</tt> </tt>
-<a name="L81"></a><tt class="py-lineno">81</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L82"></a><tt class="py-lineno">82</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
-<a name="L83"></a><tt class="py-lineno">83</tt> <tt class="py-line"> </tt>
-<a name="L84"></a><tt class="py-lineno">84</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
-</div><a name="L85"></a><tt class="py-lineno">85</tt> <tt class="py-line"> </tt>
-<a name="L86"></a><tt class="py-lineno">86</tt> <tt class="py-line"> </tt>
-<a name="otherfunc"></a><div id="otherfunc-def"><a name="L87"></a><tt class="py-lineno">87</tt> <a class="py-toggle" href="#" id="otherfunc-toggle" onclick="return toggle('otherfunc');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="example-module.html#otherfunc">otherfunc</a><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
-</div><div id="otherfunc-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="otherfunc-expanded"><a name="L88"></a><tt class="py-lineno">88</tt> <tt class="py-line"> <tt class="py-docstring">"""Do nothing.</tt> </tt>
-<a name="L89"></a><tt class="py-lineno">89</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L90"></a><tt class="py-lineno">90</tt> <tt class="py-line"><tt class="py-docstring"> I never hope to see one.</tt> </tt>
-<a name="L91"></a><tt class="py-lineno">91</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L92"></a><tt class="py-lineno">92</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
-<a name="L93"></a><tt class="py-lineno">93</tt> <tt class="py-line"> </tt>
-<a name="L94"></a><tt class="py-lineno">94</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
-</div><a name="L95"></a><tt class="py-lineno">95</tt> <tt class="py-line"> </tt><script type="text/javascript">
-<!--
-expandto(location.href);
-// -->
-</script>
-</pre>
-<br />
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table border="0" cellpadding="0" cellspacing="0" width="100%%">
- <tr>
- <td align="left" class="footer">
- Generated by Epydoc 3.0beta1 on Tue Jan 22 00:26:36 2008
- </td>
- <td align="right" class="footer">
- <a target="mainFrame" href="http://epydoc.sourceforge.net"
- >http://epydoc.sourceforge.net</a>
- </td>
- </tr>
-</table>
-
-<script type="text/javascript">
- <!--
- // Private objects are initially displayed (because if
- // javascript is turned off then we want them to be
- // visible); but by default, we want to hide them. So hide
- // them unless we have a cookie that says to show them.
- checkCookie();
- // -->
-</script>
-</body>
-</html>
diff --git a/numpy/doc/html/frames.html b/numpy/doc/html/frames.html
deleted file mode 100644
index 6ebc67e75..000000000
--- a/numpy/doc/html/frames.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
- "DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title> API Documentation </title>
-</head>
-<frameset cols="20%,80%">
- <frameset rows="30%,70%">
- <frame src="toc.html" name="moduleListFrame"
- id="moduleListFrame" />
- <frame src="toc-everything.html" name="moduleFrame"
- id="moduleFrame" />
- </frameset>
- <frame src="example-module.html" name="mainFrame" id="mainFrame" />
-</frameset>
-</html>
diff --git a/numpy/doc/html/help.html b/numpy/doc/html/help.html
deleted file mode 100644
index b92302aeb..000000000
--- a/numpy/doc/html/help.html
+++ /dev/null
@@ -1,268 +0,0 @@
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Help</title>
- <link rel="stylesheet" href="epydoc.css" type="text/css" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-
-<body bgcolor="white" text="black" link="blue" vlink="#204080"
- alink="#204080">
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="example-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Help&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table width="100%" cellpadding="0" cellspacing="0">
- <tr valign="top">
- <td width="100%">&nbsp;</td>
- <td>
- <table cellpadding="0" cellspacing="0">
- <!-- hide/show private -->
- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
- onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
- <tr><td align="right"><span class="options"
- >[<a href="frames.html" target="_top">frames</a
- >]&nbsp;|&nbsp;<a href="help.html"
- target="_top">no&nbsp;frames</a>]</span></td></tr>
- </table>
- </td>
- </tr>
-</table>
-
-<h1 class="epydoc"> API Documentation </h1>
-
-<p> This document contains the API (Application Programming Interface)
-documentation for this project. Documentation for the Python
-objects defined by the project is divided into separate pages for each
-package, module, and class. The API documentation also includes two
-pages containing information about the project as a whole: a trees
-page, and an index page. </p>
-
-<h2> Object Documentation </h2>
-
- <p>Each <strong>Package Documentation</strong> page contains: </p>
- <ul>
- <li> A description of the package. </li>
- <li> A list of the modules and sub-packages contained by the
- package. </li>
- <li> A summary of the classes defined by the package. </li>
- <li> A summary of the functions defined by the package. </li>
- <li> A summary of the variables defined by the package. </li>
- <li> A detailed description of each function defined by the
- package. </li>
- <li> A detailed description of each variable defined by the
- package. </li>
- </ul>
-
- <p>Each <strong>Module Documentation</strong> page contains:</p>
- <ul>
- <li> A description of the module. </li>
- <li> A summary of the classes defined by the module. </li>
- <li> A summary of the functions defined by the module. </li>
- <li> A summary of the variables defined by the module. </li>
- <li> A detailed description of each function defined by the
- module. </li>
- <li> A detailed description of each variable defined by the
- module. </li>
- </ul>
-
- <p>Each <strong>Class Documentation</strong> page contains: </p>
- <ul>
- <li> A class inheritance diagram. </li>
- <li> A list of known subclasses. </li>
- <li> A description of the class. </li>
- <li> A summary of the methods defined by the class. </li>
- <li> A summary of the instance variables defined by the class. </li>
- <li> A summary of the class (static) variables defined by the
- class. </li>
- <li> A detailed description of each method defined by the
- class. </li>
- <li> A detailed description of each instance variable defined by the
- class. </li>
- <li> A detailed description of each class (static) variable defined
- by the class. </li>
- </ul>
-
-<h2> Project Documentation </h2>
-
- <p> The <strong>Trees</strong> page contains the module and class hierarchies: </p>
- <ul>
- <li> The <em>module hierarchy</em> lists every package and module, with
- modules grouped into packages. At the top level, and within each
- package, modules and sub-packages are listed alphabetically. </li>
- <li> The <em>class hierarchy</em> lists every class, grouped by base
- class. If a class has more than one base class, then it will be
- listed under each base class. At the top level, and under each base
- class, classes are listed alphabetically. </li>
- </ul>
-
- <p> The <strong>Index</strong> page contains indices of terms and
- identifiers: </p>
- <ul>
- <li> The <em>term index</em> lists every term indexed by any object's
- documentation. For each term, the index provides links to each
- place where the term is indexed. </li>
- <li> The <em>identifier index</em> lists the (short) name of every package,
- module, class, method, function, variable, and parameter. For each
- identifier, the index provides a short description, and a link to
- its documentation. </li>
- </ul>
-
-<h2> The Table of Contents </h2>
-
-<p> The table of contents occupies the two frames on the left side of
-the window. The upper-left frame displays the <em>project
-contents</em>, and the lower-left frame displays the <em>module
-contents</em>: </p>
-
-<table class="help summary" border="1" cellspacing="0" cellpadding="3">
- <tr style="height: 30%">
- <td align="center" style="font-size: small">
- Project<br />Contents<hr />...</td>
- <td align="center" style="font-size: small" rowspan="2" width="70%">
- API<br />Documentation<br />Frame<br /><br /><br />
- </td>
- </tr>
- <tr>
- <td align="center" style="font-size: small">
- Module<br />Contents<hr />&nbsp;<br />...<br />&nbsp;
- </td>
- </tr>
-</table><br />
-
-<p> The <strong>project contents frame</strong> contains a list of all packages
-and modules that are defined by the project. Clicking on an entry
-will display its contents in the module contents frame. Clicking on a
-special entry, labeled "Everything," will display the contents of
-the entire project. </p>
-
-<p> The <strong>module contents frame</strong> contains a list of every
-submodule, class, type, exception, function, and variable defined by a
-module or package. Clicking on an entry will display its
-documentation in the API documentation frame. Clicking on the name of
-the module, at the top of the frame, will display the documentation
-for the module itself. </p>
-
-<p> The "<strong>frames</strong>" and "<strong>no frames</strong>" buttons below the top
-navigation bar can be used to control whether the table of contents is
-displayed or not. </p>
-
-<h2> The Navigation Bar </h2>
-
-<p> A navigation bar is located at the top and bottom of every page.
-It indicates what type of page you are currently viewing, and allows
-you to go to related pages. The following table describes the labels
-on the navigation bar. Note that not some labels (such as
-[Parent]) are not displayed on all pages. </p>
-
-<table class="summary" border="1" cellspacing="0" cellpadding="3" width="100%">
-<tr class="summary">
- <th>Label</th>
- <th>Highlighted when...</th>
- <th>Links to...</th>
-</tr>
- <tr><td valign="top"><strong>[Parent]</strong></td>
- <td valign="top"><em>(never highlighted)</em></td>
- <td valign="top"> the parent of the current package </td></tr>
- <tr><td valign="top"><strong>[Package]</strong></td>
- <td valign="top">viewing a package</td>
- <td valign="top">the package containing the current object
- </td></tr>
- <tr><td valign="top"><strong>[Module]</strong></td>
- <td valign="top">viewing a module</td>
- <td valign="top">the module containing the current object
- </td></tr>
- <tr><td valign="top"><strong>[Class]</strong></td>
- <td valign="top">viewing a class </td>
- <td valign="top">the class containing the current object</td></tr>
- <tr><td valign="top"><strong>[Trees]</strong></td>
- <td valign="top">viewing the trees page</td>
- <td valign="top"> the trees page </td></tr>
- <tr><td valign="top"><strong>[Index]</strong></td>
- <td valign="top">viewing the index page</td>
- <td valign="top"> the index page </td></tr>
- <tr><td valign="top"><strong>[Help]</strong></td>
- <td valign="top">viewing the help page</td>
- <td valign="top"> the help page </td></tr>
-</table>
-
-<p> The "<strong>show private</strong>" and "<strong>hide private</strong>" buttons below
-the top navigation bar can be used to control whether documentation
-for private objects is displayed. Private objects are usually defined
-as objects whose (short) names begin with a single underscore, but do
-not end with an underscore. For example, "<code>_x</code>",
-"<code>__pprint</code>", and "<code>epydoc.epytext._tokenize</code>"
-are private objects; but "<code>re.sub</code>",
-"<code>__init__</code>", and "<code>type_</code>" are not. However,
-if a module defines the "<code>__all__</code>" variable, then its
-contents are used to decide which objects are private. </p>
-
-<p> A timestamp below the bottom navigation bar indicates when each
-page was last updated. </p>
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="example-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Help&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table border="0" cellpadding="0" cellspacing="0" width="100%%">
- <tr>
- <td align="left" class="footer">
- Generated by Epydoc 3.0beta1 on Tue Jan 22 00:26:36 2008
- </td>
- <td align="right" class="footer">
- <a target="mainFrame" href="http://epydoc.sourceforge.net"
- >http://epydoc.sourceforge.net</a>
- </td>
- </tr>
-</table>
-
-<script type="text/javascript">
- <!--
- // Private objects are initially displayed (because if
- // javascript is turned off then we want them to be
- // visible); but by default, we want to hide them. So hide
- // them unless we have a cookie that says to show them.
- checkCookie();
- // -->
-</script>
-</body>
-</html>
diff --git a/numpy/doc/html/identifier-index.html b/numpy/doc/html/identifier-index.html
deleted file mode 100644
index c29b8c5c9..000000000
--- a/numpy/doc/html/identifier-index.html
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Identifier Index</title>
- <link rel="stylesheet" href="epydoc.css" type="text/css" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-
-<body bgcolor="white" text="black" link="blue" vlink="#204080"
- alink="#204080">
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="example-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Indices&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table width="100%" cellpadding="0" cellspacing="0">
- <tr valign="top">
- <td width="100%">&nbsp;</td>
- <td>
- <table cellpadding="0" cellspacing="0">
- <!-- hide/show private -->
- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
- onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
- <tr><td align="right"><span class="options"
- >[<a href="frames.html" target="_top">frames</a
- >]&nbsp;|&nbsp;<a href="identifier-index.html"
- target="_top">no&nbsp;frames</a>]</span></td></tr>
- </table>
- </td>
- </tr>
-</table>
-<table border="0" width="100%">
-<tr valign="bottom"><td>
-<h1 class="epydoc">Identifier Index</h1>
-</td><td>
-[
- A
- B
- C
- D
- <a href="#E">E</a>
- <a href="#F">F</a>
- G
- H
- I
- J
- K
- L
- M
- <a href="#N">N</a>
- <a href="#O">O</a>
- P
- Q
- R
- S
- T
- U
- V
- W
- X
- Y
- Z
- _
-]
-</td></table>
-<table border="0" width="100%">
-<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="E">E</a></h2></td>
-<td valign="top">
-<table class="link-index" width="100%" border="1">
-<tr>
-<td width="33%" class="link-index"><a href="example-module.html">example</a></td>
-<td width="33%" class="link-index">&nbsp;</td>
-<td width="33%" class="link-index">&nbsp;</td>
-</tr>
-<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
-</table>
-</td></tr>
-<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="F">F</a></h2></td>
-<td valign="top">
-<table class="link-index" width="100%" border="1">
-<tr>
-<td width="33%" class="link-index"><a href="example-module.html#foo">foo()</a><br />
-<span class="index-where">(in&nbsp;<a href="example-module.html">example</a>)</span></td>
-<td width="33%" class="link-index">&nbsp;</td>
-<td width="33%" class="link-index">&nbsp;</td>
-</tr>
-<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
-</table>
-</td></tr>
-<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="N">N</a></h2></td>
-<td valign="top">
-<table class="link-index" width="100%" border="1">
-<tr>
-<td width="33%" class="link-index"><a href="example-module.html#newfunc">newfunc()</a><br />
-<span class="index-where">(in&nbsp;<a href="example-module.html">example</a>)</span></td>
-<td width="33%" class="link-index">&nbsp;</td>
-<td width="33%" class="link-index">&nbsp;</td>
-</tr>
-<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
-</table>
-</td></tr>
-<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="O">O</a></h2></td>
-<td valign="top">
-<table class="link-index" width="100%" border="1">
-<tr>
-<td width="33%" class="link-index"><a href="example-module.html#otherfunc">otherfunc()</a><br />
-<span class="index-where">(in&nbsp;<a href="example-module.html">example</a>)</span></td>
-<td width="33%" class="link-index">&nbsp;</td>
-<td width="33%" class="link-index">&nbsp;</td>
-</tr>
-<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
-</table>
-</td></tr>
-</table>
-<br /><br /><!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="example-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Indices&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table border="0" cellpadding="0" cellspacing="0" width="100%%">
- <tr>
- <td align="left" class="footer">
- Generated by Epydoc 3.0beta1 on Tue Jan 22 00:26:36 2008
- </td>
- <td align="right" class="footer">
- <a target="mainFrame" href="http://epydoc.sourceforge.net"
- >http://epydoc.sourceforge.net</a>
- </td>
- </tr>
-</table>
-
-<script type="text/javascript">
- <!--
- // Private objects are initially displayed (because if
- // javascript is turned off then we want them to be
- // visible); but by default, we want to hide them. So hide
- // them unless we have a cookie that says to show them.
- checkCookie();
- // -->
-</script>
-</body>
-</html>
diff --git a/numpy/doc/html/index.html b/numpy/doc/html/index.html
deleted file mode 100644
index 6ebc67e75..000000000
--- a/numpy/doc/html/index.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
- "DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title> API Documentation </title>
-</head>
-<frameset cols="20%,80%">
- <frameset rows="30%,70%">
- <frame src="toc.html" name="moduleListFrame"
- id="moduleListFrame" />
- <frame src="toc-everything.html" name="moduleFrame"
- id="moduleFrame" />
- </frameset>
- <frame src="example-module.html" name="mainFrame" id="mainFrame" />
-</frameset>
-</html>
diff --git a/numpy/doc/html/module-tree.html b/numpy/doc/html/module-tree.html
deleted file mode 100644
index ad64d11b2..000000000
--- a/numpy/doc/html/module-tree.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Module Hierarchy</title>
- <link rel="stylesheet" href="epydoc.css" type="text/css" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-
-<body bgcolor="white" text="black" link="blue" vlink="#204080"
- alink="#204080">
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="example-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table width="100%" cellpadding="0" cellspacing="0">
- <tr valign="top">
- <td width="100%">&nbsp;</td>
- <td>
- <table cellpadding="0" cellspacing="0">
- <!-- hide/show private -->
- <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
- onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
- <tr><td align="right"><span class="options"
- >[<a href="frames.html" target="_top">frames</a
- >]&nbsp;|&nbsp;<a href="module-tree.html"
- target="_top">no&nbsp;frames</a>]</span></td></tr>
- </table>
- </td>
- </tr>
-</table>
-<h1 class="epydoc">Module Hierarchy</h1>
-<ul class="nomargin-top">
- <li> <strong class="uidlink"><a href="example-module.html">example</a></strong>: <em class="summary">This is the docstring for the example.py module.</em> </li>
-</ul>
-<!-- ==================== NAVIGATION BAR ==================== -->
-<table class="navbar" border="0" width="100%" cellpadding="0"
- bgcolor="#a0c0ff" cellspacing="0">
- <tr valign="middle">
- <!-- Home link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="example-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Tree link -->
- <th bgcolor="#70b0f0" class="navbar-select"
- >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Index link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
-
- <!-- Help link -->
- <th>&nbsp;&nbsp;&nbsp;<a
- href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
-
- <th class="navbar" width="100%"></th>
- </tr>
-</table>
-<table border="0" cellpadding="0" cellspacing="0" width="100%%">
- <tr>
- <td align="left" class="footer">
- Generated by Epydoc 3.0beta1 on Tue Jan 22 00:26:36 2008
- </td>
- <td align="right" class="footer">
- <a target="mainFrame" href="http://epydoc.sourceforge.net"
- >http://epydoc.sourceforge.net</a>
- </td>
- </tr>
-</table>
-
-<script type="text/javascript">
- <!--
- // Private objects are initially displayed (because if
- // javascript is turned off then we want them to be
- // visible); but by default, we want to hide them. So hide
- // them unless we have a cookie that says to show them.
- checkCookie();
- // -->
-</script>
-</body>
-</html>
diff --git a/numpy/doc/html/redirect.html b/numpy/doc/html/redirect.html
deleted file mode 100644
index dbd50828c..000000000
--- a/numpy/doc/html/redirect.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<html><head><title>Epydoc Redirect Page</title>
-<meta http-equiv="cache-control" content="no-cache" />
-<meta http-equiv="expires" content="0" />
-<meta http-equiv="pragma" content="no-cache" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-<body>
-<script type="text/javascript">
-<!--
-var pages = ["example-m"];
-var dottedName = get_anchor();
-if (dottedName) {
- var target = redirect_url(dottedName);
- if (target) window.location.replace(target);
-}
-// -->
-</script>
-
-<h3>Epydoc Auto-redirect page</h3>
-
-<p>When javascript is enabled, this page will redirect URLs of
-the form <tt>redirect.html#<i>dotted.name</i></tt> to the
-documentation for the object with the given fully-qualified
-dotted name.</p>
-<p><a id="message"> &nbsp; </a></p>
-
-<script type="text/javascript">
-<!--
-if (dottedName) {
- var msg = document.getElementById("message");
- msg.innerHTML = "No documentation found for <tt>"+
- dottedName+"</tt>";
-}
-// -->
-</script>
-
-</body>
-</html>
diff --git a/numpy/doc/html/toc-everything.html b/numpy/doc/html/toc-everything.html
deleted file mode 100644
index ce94bd1f0..000000000
--- a/numpy/doc/html/toc-everything.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Everything</title>
- <link rel="stylesheet" href="epydoc.css" type="text/css" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-
-<body bgcolor="white" text="black" link="blue" vlink="#204080"
- alink="#204080">
-<h1 class="toc">Everything</h1>
-<hr />
- <h2 class="toc">All Functions</h2>
- <a target="mainFrame" href="example-module.html#foo"
- >example.foo</a><br /> <a target="mainFrame" href="example-module.html#newfunc"
- >example.newfunc</a><br /> <a target="mainFrame" href="example-module.html#otherfunc"
- >example.otherfunc</a><br /><hr />
-<span class="options">[<a href="javascript:void(0);" class="privatelink"
- onclick="toggle_private();">hide&nbsp;private</a>]</span>
-
-<script type="text/javascript">
- <!--
- // Private objects are initially displayed (because if
- // javascript is turned off then we want them to be
- // visible); but by default, we want to hide them. So hide
- // them unless we have a cookie that says to show them.
- checkCookie();
- // -->
-</script>
-</body>
-</html>
diff --git a/numpy/doc/html/toc-example-module.html b/numpy/doc/html/toc-example-module.html
deleted file mode 100644
index c691dccae..000000000
--- a/numpy/doc/html/toc-example-module.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>example</title>
- <link rel="stylesheet" href="epydoc.css" type="text/css" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-
-<body bgcolor="white" text="black" link="blue" vlink="#204080"
- alink="#204080">
-<h1 class="toc">Module example</h1>
-<hr />
- <h2 class="toc">Functions</h2>
- <a target="mainFrame" href="example-module.html#foo"
- >foo</a><br /> <a target="mainFrame" href="example-module.html#newfunc"
- >newfunc</a><br /> <a target="mainFrame" href="example-module.html#otherfunc"
- >otherfunc</a><br /><hr />
-<span class="options">[<a href="javascript:void(0);" class="privatelink"
- onclick="toggle_private();">hide&nbsp;private</a>]</span>
-
-<script type="text/javascript">
- <!--
- // Private objects are initially displayed (because if
- // javascript is turned off then we want them to be
- // visible); but by default, we want to hide them. So hide
- // them unless we have a cookie that says to show them.
- checkCookie();
- // -->
-</script>
-</body>
-</html>
diff --git a/numpy/doc/html/toc.html b/numpy/doc/html/toc.html
deleted file mode 100644
index 7008e1695..000000000
--- a/numpy/doc/html/toc.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Table of Contents</title>
- <link rel="stylesheet" href="epydoc.css" type="text/css" />
- <script type="text/javascript" src="epydoc.js"></script>
-</head>
-
-<body bgcolor="white" text="black" link="blue" vlink="#204080"
- alink="#204080">
-<h1 class="toc">Table&nbsp;of&nbsp;Contents</h1>
-<hr />
- <a target="moduleFrame" href="toc-everything.html">Everything</a>
- <br />
- <h2 class="toc">Modules</h2>
- <a target="moduleFrame" href="toc-example-module.html"
- onclick="setFrame('toc-example-module.html','example-module.html');" >example</a><br /><hr />
- <span class="options">[<a href="javascript:void(0);" class="privatelink"
- onclick="toggle_private();">hide&nbsp;private</a>]</span>
-
-<script type="text/javascript">
- <!--
- // Private objects are initially displayed (because if
- // javascript is turned off then we want them to be
- // visible); but by default, we want to hide them. So hide
- // them unless we have a cookie that says to show them.
- checkCookie();
- // -->
-</script>
-</body>
-</html>
diff --git a/numpy/doc/reference/indexing.py b/numpy/doc/indexing.py
index 365edd67a..365edd67a 100644
--- a/numpy/doc/reference/indexing.py
+++ b/numpy/doc/indexing.py
diff --git a/numpy/doc/reference/internals.py b/numpy/doc/internals.py
index a74429368..a74429368 100644
--- a/numpy/doc/reference/internals.py
+++ b/numpy/doc/internals.py
diff --git a/numpy/doc/reference/io.py b/numpy/doc/io.py
index 3cde40bd0..3cde40bd0 100644
--- a/numpy/doc/reference/io.py
+++ b/numpy/doc/io.py
diff --git a/numpy/doc/reference/jargon.py b/numpy/doc/jargon.py
index e13ff5686..e13ff5686 100644
--- a/numpy/doc/reference/jargon.py
+++ b/numpy/doc/jargon.py
diff --git a/numpy/doc/reference/methods_vs_functions.py b/numpy/doc/methods_vs_functions.py
index 22eadccf7..22eadccf7 100644
--- a/numpy/doc/reference/methods_vs_functions.py
+++ b/numpy/doc/methods_vs_functions.py
diff --git a/numpy/doc/reference/misc.py b/numpy/doc/misc.py
index e978100bf..e978100bf 100644
--- a/numpy/doc/reference/misc.py
+++ b/numpy/doc/misc.py
diff --git a/numpy/doc/newdtype_example/example.py b/numpy/doc/newdtype_example/example.py
deleted file mode 100644
index 7ee64ca00..000000000
--- a/numpy/doc/newdtype_example/example.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import floatint.floatint as ff
-import numpy as np
-
-# Setting using array is hard because
-# The parser doesn't stop at tuples always
-# So, the setitem code will be called with scalars on the
-# wrong shaped array.
-# But we can get a view as an ndarray of the given type:
-g = np.array([1,2,3,4,5,6,7,8]).view(ff.floatint_type)
-
-# Now, the elements will be the scalar type associated
-# with the ndarray.
-print g[0]
-print type(g[1])
-
-# Now, you need to register ufuncs and more arrfuncs to do useful things...
diff --git a/numpy/doc/newdtype_example/floatint.c b/numpy/doc/newdtype_example/floatint.c
deleted file mode 100644
index cf698a7f9..000000000
--- a/numpy/doc/newdtype_example/floatint.c
+++ /dev/null
@@ -1,153 +0,0 @@
-
-#include "Python.h"
-#include "structmember.h" /* for offsetof macro if needed */
-#include "numpy/arrayobject.h"
-
-
-/* Use a Python float as the cannonical type being added
-*/
-
-typedef struct _floatint {
- PyObject_HEAD
- npy_int32 first;
- npy_int32 last;
-} PyFloatIntObject;
-
-static PyTypeObject PyFloatInt_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
- "floatint.floatint", /*tp_name*/
- sizeof(PyFloatIntObject), /*tp_basicsize*/
-};
-
-static PyArray_ArrFuncs _PyFloatInt_Funcs;
-
-#define _ALIGN(type) offsetof(struct {char c; type v;},v)
-
-/* The scalar-type */
-
-static PyArray_Descr _PyFloatInt_Dtype = {
- PyObject_HEAD_INIT(NULL)
- &PyFloatInt_Type,
- 'f',
- '0',
- '=',
- 0,
- 0,
- sizeof(double),
- _ALIGN(double),
- NULL,
- NULL,
- NULL,
- &_PyFloatInt_Funcs
-};
-
-static void
-twoint_copyswap(void *dst, void *src, int swap, void *arr)
-{
- if (src != NULL)
- memcpy(dst, src, sizeof(double));
-
- if (swap) {
- register char *a, *b, c;
- a = (char *)dst;
- b = a + 7;
- c = *a; *a++ = *b; *b-- = c;
- c = *a; *a++ = *b; *b-- = c;
- c = *a; *a++ = *b; *b-- = c;
- c = *a; *a++ = *b; *b = c;
- }
-}
-
-static PyObject *
-twoint_getitem(char *ip, PyArrayObject *ap) {
- npy_int32 a[2];
-
- if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {
- a[0] = *((npy_int32 *)ip);
- a[1] = *((npy_int32 *)ip + 1);
- }
- else {
- ap->descr->f->copyswap(a, ip, !PyArray_ISNOTSWAPPED(ap),
- ap);
- }
- return Py_BuildValue("(ii)", a[0], a[1]);
-}
-
-static int
-twoint_setitem(PyObject *op, char *ov, PyArrayObject *ap) {
- npy_int32 a[2];
-
- if (!PyTuple_Check(op)) {
- PyErr_SetString(PyExc_TypeError, "must be a tuple");
- return -1;
- }
- if (!PyArg_ParseTuple(op, "ii", a, a+1)) return -1;
-
- if (ap == NULL || PyArray_ISBEHAVED(ap)) {
- memcpy(ov, a, sizeof(double));
- }
- else {
- ap->descr->f->copyswap(ov, a, !PyArray_ISNOTSWAPPED(ap),
- ap);
- }
- return 0;
-}
-
-static PyArray_Descr * _register_dtype(void)
-{
- int userval;
- PyArray_InitArrFuncs(&_PyFloatInt_Funcs);
- /* Add copyswap,
- nonzero, getitem, setitem*/
- _PyFloatInt_Funcs.copyswap = twoint_copyswap;
- _PyFloatInt_Funcs.getitem = (PyArray_GetItemFunc *)twoint_getitem;
- _PyFloatInt_Funcs.setitem = (PyArray_SetItemFunc *)twoint_setitem;
- _PyFloatInt_Dtype.ob_type = &PyArrayDescr_Type;
-
- userval = PyArray_RegisterDataType(&_PyFloatInt_Dtype);
- return PyArray_DescrFromType(userval);
-}
-
-
-/* Initialization function for the module (*must* be called init<name>) */
-
-PyMODINIT_FUNC initfloatint(void) {
- PyObject *m, *d;
- PyArray_Descr *dtype;
-
- /* Create the module and add the functions */
- m = Py_InitModule("floatint", NULL);
-
- /* Import the array objects */
- import_array();
-
-
- /* Initialize the new float type */
-
- /* Add some symbolic constants to the module */
- d = PyModule_GetDict(m);
-
- if (PyType_Ready(&PyFloat_Type) < 0) return;
- PyFloatInt_Type.tp_base = &PyFloat_Type;
- /* This is only needed because we are sub-typing the
- Float type and must pre-set some function pointers
- to get PyType_Ready to fill in the rest.
- */
- PyFloatInt_Type.tp_alloc = PyType_GenericAlloc;
- PyFloatInt_Type.tp_new = PyFloat_Type.tp_new;
- PyFloatInt_Type.tp_dealloc = PyFloat_Type.tp_dealloc;
- PyFloatInt_Type.tp_free = PyObject_Del;
- if (PyType_Ready(&PyFloatInt_Type) < 0) return;
- /* End specific code */
-
-
- dtype = _register_dtype();
- Py_XINCREF(dtype);
- if (dtype != NULL) {
- PyDict_SetItemString(d, "floatint_type", (PyObject *)dtype);
- }
- Py_INCREF(&PyFloatInt_Type);
- PyDict_SetItemString(d, "floatint", (PyObject *)&PyFloatInt_Type);
- return;
-}
diff --git a/numpy/doc/newdtype_example/floatint/__init__.py b/numpy/doc/newdtype_example/floatint/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/numpy/doc/newdtype_example/floatint/__init__.py
+++ /dev/null
diff --git a/numpy/doc/newdtype_example/setup.py b/numpy/doc/newdtype_example/setup.py
deleted file mode 100644
index 3b9d75578..000000000
--- a/numpy/doc/newdtype_example/setup.py
+++ /dev/null
@@ -1,12 +0,0 @@
-
-from numpy.distutils.core import setup
-
-def configuration(parent_package = '', top_path=None):
- from numpy.distutils.misc_util import Configuration
- config = Configuration('floatint',parent_package,top_path)
-
- config.add_extension('floatint',
- sources = ['floatint.c']);
- return config
-
-setup(configuration=configuration)
diff --git a/numpy/doc/npy-format.txt b/numpy/doc/npy-format.txt
deleted file mode 100644
index 836468096..000000000
--- a/numpy/doc/npy-format.txt
+++ /dev/null
@@ -1,294 +0,0 @@
-Title: A Simple File Format for NumPy Arrays
-Discussions-To: numpy-discussion@mail.scipy.org
-Version: $Revision$
-Last-Modified: $Date$
-Author: Robert Kern <robert.kern@gmail.com>
-Status: Draft
-Type: Standards Track
-Content-Type: text/plain
-Created: 20-Dec-2007
-
-
-Abstract
-
- We propose a standard binary file format (NPY) for persisting
- a single arbitrary NumPy array on disk. The format stores all of
- the shape and dtype information necessary to reconstruct the array
- correctly even on another machine with a different architecture.
- The format is designed to be as simple as possible while achieving
- its limited goals. The implementation is intended to be pure
- Python and distributed as part of the main numpy package.
-
-
-Rationale
-
- A lightweight, omnipresent system for saving NumPy arrays to disk
- is a frequent need. Python in general has pickle [1] for saving
- most Python objects to disk. This often works well enough with
- NumPy arrays for many purposes, but it has a few drawbacks:
-
- - Dumping or loading a pickle file require the duplication of the
- data in memory. For large arrays, this can be a showstopper.
-
- - The array data is not directly accessible through
- memory-mapping. Now that numpy has that capability, it has
- proved very useful for loading large amounts of data (or more to
- the point: avoiding loading large amounts of data when you only
- need a small part).
-
- Both of these problems can be addressed by dumping the raw bytes
- to disk using ndarray.tofile() and numpy.fromfile(). However,
- these have their own problems:
-
- - The data which is written has no information about the shape or
- dtype of the array.
-
- - It is incapable of handling object arrays.
-
- The NPY file format is an evolutionary advance over these two
- approaches. Its design is mostly limited to solving the problems
- with pickles and tofile()/fromfile(). It does not intend to solve
- more complicated problems for which more complicated formats like
- HDF5 [2] are a better solution.
-
-
-Use Cases
-
- - Neville Newbie has just started to pick up Python and NumPy. He
- has not installed many packages, yet, nor learned the standard
- library, but he has been playing with NumPy at the interactive
- prompt to do small tasks. He gets a result that he wants to
- save.
-
- - Annie Analyst has been using large nested record arrays to
- represent her statistical data. She wants to convince her
- R-using colleague, David Doubter, that Python and NumPy are
- awesome by sending him her analysis code and data. She needs
- the data to load at interactive speeds. Since David does not
- use Python usually, needing to install large packages would turn
- him off.
-
- - Simon Seismologist is developing new seismic processing tools.
- One of his algorithms requires large amounts of intermediate
- data to be written to disk. The data does not really fit into
- the industry-standard SEG-Y schema, but he already has a nice
- record-array dtype for using it internally.
-
- - Polly Parallel wants to split up a computation on her multicore
- machine as simply as possible. Parts of the computation can be
- split up among different processes without any communication
- between processes; they just need to fill in the appropriate
- portion of a large array with their results. Having several
- child processes memory-mapping a common array is a good way to
- achieve this.
-
-
-Requirements
-
- The format MUST be able to:
-
- - Represent all NumPy arrays including nested record
- arrays and object arrays.
-
- - Represent the data in its native binary form.
-
- - Be contained in a single file.
-
- - Support Fortran-contiguous arrays directly.
-
- - Store all of the necessary information to reconstruct the array
- including shape and dtype on a machine of a different
- architecture. Both little-endian and big-endian arrays must be
- supported and a file with little-endian numbers will yield
- a little-endian array on any machine reading the file. The
- types must be described in terms of their actual sizes. For
- example, if a machine with a 64-bit C "long int" writes out an
- array with "long ints", a reading machine with 32-bit C "long
- ints" will yield an array with 64-bit integers.
-
- - Be reverse engineered. Datasets often live longer than the
- programs that created them. A competent developer should be
- able create a solution in his preferred programming language to
- read most NPY files that he has been given without much
- documentation.
-
- - Allow memory-mapping of the data.
-
- - Be read from a filelike stream object instead of an actual file.
- This allows the implementation to be tested easily and makes the
- system more flexible. NPY files can be stored in ZIP files and
- easily read from a ZipFile object.
-
- - Store object arrays. Since general Python objects are
- complicated and can only be reliably serialized by pickle (if at
- all), many of the other requirements are waived for files
- containing object arrays. Files with object arrays do not have
- to be mmapable since that would be technically impossible. We
- cannot expect the pickle format to be reverse engineered without
- knowledge of pickle. However, one should at least be able to
- read and write object arrays with the same generic interface as
- other arrays.
-
- - Be read and written using APIs provided in the numpy package
- itself without any other libraries. The implementation inside
- numpy may be in C if necessary.
-
- The format explicitly *does not* need to:
-
- - Support multiple arrays in a file. Since we require filelike
- objects to be supported, one could use the API to build an ad
- hoc format that supported multiple arrays. However, solving the
- general problem and use cases is beyond the scope of the format
- and the API for numpy.
-
- - Fully handle arbitrary subclasses of numpy.ndarray. Subclasses
- will be accepted for writing, but only the array data will be
- written out. A regular numpy.ndarray object will be created
- upon reading the file. The API can be used to build a format
- for a particular subclass, but that is out of scope for the
- general NPY format.
-
-
-Format Specification: Version 1.0
-
- The first 6 bytes are a magic string: exactly "\x93NUMPY".
-
- The next 1 byte is an unsigned byte: the major version number of
- the file format, e.g. \x01.
-
- The next 1 byte is an unsigned byte: the minor version number of
- the file format, e.g. \x00. Note: the version of the file format
- is not tied to the version of the numpy package.
-
- The next 2 bytes form a little-endian unsigned short int: the
- length of the header data HEADER_LEN.
-
- The next HEADER_LEN bytes form the header data describing the
- array's format. It is an ASCII string which contains a Python
- literal expression of a dictionary. It is terminated by a newline
- ('\n') and padded with spaces ('\x20') to make the total length of
- the magic string + 4 + HEADER_LEN be evenly divisible by 16 for
- alignment purposes.
-
- The dictionary contains three keys:
-
- "descr" : dtype.descr
- An object that can be passed as an argument to the
- numpy.dtype() constructor to create the array's dtype.
-
- "fortran_order" : bool
- Whether the array data is Fortran-contiguous or not.
- Since Fortran-contiguous arrays are a common form of
- non-C-contiguity, we allow them to be written directly to
- disk for efficiency.
-
- "shape" : tuple of int
- The shape of the array.
-
- For repeatability and readability, this dictionary is formatted
- using pprint.pformat() so the keys are in alphabetic order.
-
- Following the header comes the array data. If the dtype contains
- Python objects (i.e. dtype.hasobject is True), then the data is
- a Python pickle of the array. Otherwise the data is the
- contiguous (either C- or Fortran-, depending on fortran_order)
- bytes of the array. Consumers can figure out the number of bytes
- by multiplying the number of elements given by the shape (noting
- that shape=() means there is 1 element) by dtype.itemsize.
-
-
-Conventions
-
- We recommend using the ".npy" extension for files following this
- format. This is by no means a requirement; applications may wish
- to use this file format but use an extension specific to the
- application. In the absence of an obvious alternative, however,
- we suggest using ".npy".
-
- For a simple way to combine multiple arrays into a single file,
- one can use ZipFile to contain multiple ".npy" files. We
- recommend using the file extension ".npz" for these archives.
-
-
-Alternatives
-
- The author believes that this system (or one along these lines) is
- about the simplest system that satisfies all of the requirements.
- However, one must always be wary of introducing a new binary
- format to the world.
-
- HDF5 [2] is a very flexible format that should be able to
- represent all of NumPy's arrays in some fashion. It is probably
- the only widely-used format that can faithfully represent all of
- NumPy's array features. It has seen substantial adoption by the
- scientific community in general and the NumPy community in
- particular. It is an excellent solution for a wide variety of
- array storage problems with or without NumPy.
-
- HDF5 is a complicated format that more or less implements
- a hierarchical filesystem-in-a-file. This fact makes satisfying
- some of the Requirements difficult. To the author's knowledge, as
- of this writing, there is no application or library that reads or
- writes even a subset of HDF5 files that does not use the canonical
- libhdf5 implementation. This implementation is a large library
- that is not always easy to build. It would be infeasible to
- include it in numpy.
-
- It might be feasible to target an extremely limited subset of
- HDF5. Namely, there would be only one object in it: the array.
- Using contiguous storage for the data, one should be able to
- implement just enough of the format to provide the same metadata
- that the proposed format does. One could still meet all of the
- technical requirements like mmapability.
-
- We would accrue a substantial benefit by being able to generate
- files that could be read by other HDF5 software. Furthermore, by
- providing the first non-libhdf5 implementation of HDF5, we would
- be able to encourage more adoption of simple HDF5 in applications
- where it was previously infeasible because of the size of the
- library. The basic work may encourage similar dead-simple
- implementations in other languages and further expand the
- community.
-
- The remaining concern is about reverse engineerability of the
- format. Even the simple subset of HDF5 would be very difficult to
- reverse engineer given just a file by itself. However, given the
- prominence of HDF5, this might not be a substantial concern.
-
- In conclusion, we are going forward with the design laid out in
- this document. If someone writes code to handle the simple subset
- of HDF5 that would be useful to us, we may consider a revision of
- the file format.
-
-
-Implementation
-
- The current implementation is in the trunk of the numpy SVN
- repository and will be part of the 1.0.5 release.
-
- http://svn.scipy.org/svn/numpy/trunk
-
- Specifically, the file format.py in this directory implements the
- format as described here.
-
-
-References
-
- [1] http://docs.python.org/lib/module-pickle.html
-
- [2] http://hdf.ncsa.uiuc.edu/products/hdf5/index.html
-
-
-Copyright
-
- This document has been placed in the public domain.
-
-
-
-Local Variables:
-mode: indented-text
-indent-tabs-mode: nil
-sentence-end-double-space: t
-fill-column: 70
-coding: utf-8
-End:
diff --git a/numpy/doc/pep_buffer.txt b/numpy/doc/pep_buffer.txt
deleted file mode 100644
index a154d2792..000000000
--- a/numpy/doc/pep_buffer.txt
+++ /dev/null
@@ -1,869 +0,0 @@
-:PEP: 3118
-:Title: Revising the buffer protocol
-:Version: $Revision$
-:Last-Modified: $Date$
-:Authors: Travis Oliphant <oliphant@ee.byu.edu>, Carl Banks <pythondev@aerojockey.com>
-:Status: Draft
-:Type: Standards Track
-:Content-Type: text/x-rst
-:Created: 28-Aug-2006
-:Python-Version: 3000
-
-Abstract
-========
-
-This PEP proposes re-designing the buffer interface (PyBufferProcs
-function pointers) to improve the way Python allows memory sharing
-in Python 3.0
-
-In particular, it is proposed that the character buffer portion
-of the API be elminated and the multiple-segment portion be
-re-designed in conjunction with allowing for strided memory
-to be shared. In addition, the new buffer interface will
-allow the sharing of any multi-dimensional nature of the
-memory and what data-format the memory contains.
-
-This interface will allow any extension module to either
-create objects that share memory or create algorithms that
-use and manipulate raw memory from arbitrary objects that
-export the interface.
-
-
-Rationale
-=========
-
-The Python 2.X buffer protocol allows different Python types to
-exchange a pointer to a sequence of internal buffers. This
-functionality is *extremely* useful for sharing large segments of
-memory between different high-level objects, but it is too limited and
-has issues:
-
-1. There is the little used "sequence-of-segments" option
- (bf_getsegcount) that is not well motivated.
-
-2. There is the apparently redundant character-buffer option
- (bf_getcharbuffer)
-
-3. There is no way for a consumer to tell the buffer-API-exporting
- object it is "finished" with its view of the memory and
- therefore no way for the exporting object to be sure that it is
- safe to reallocate the pointer to the memory that it owns (for
- example, the array object reallocating its memory after sharing
- it with the buffer object which held the original pointer led
- to the infamous buffer-object problem).
-
-4. Memory is just a pointer with a length. There is no way to
- describe what is "in" the memory (float, int, C-structure, etc.)
-
-5. There is no shape information provided for the memory. But,
- several array-like Python types could make use of a standard
- way to describe the shape-interpretation of the memory
- (wxPython, GTK, pyQT, CVXOPT, PyVox, Audio and Video
- Libraries, ctypes, NumPy, data-base interfaces, etc.)
-
-6. There is no way to share discontiguous memory (except through
- the sequence of segments notion).
-
- There are two widely used libraries that use the concept of
- discontiguous memory: PIL and NumPy. Their view of discontiguous
- arrays is different, though. The proposed buffer interface allows
- sharing of either memory model. Exporters will use only one
- approach and consumers may choose to support discontiguous
- arrays of each type however they choose.
-
- NumPy uses the notion of constant striding in each dimension as its
- basic concept of an array. With this concept, a simple sub-region
- of a larger array can be described without copying the data.
- Thus, stride information is the additional information that must be
- shared.
-
- The PIL uses a more opaque memory representation. Sometimes an
- image is contained in a contiguous segment of memory, but sometimes
- it is contained in an array of pointers to the contiguous segments
- (usually lines) of the image. The PIL is where the idea of multiple
- buffer segments in the original buffer interface came from.
-
- NumPy's strided memory model is used more often in computational
- libraries and because it is so simple it makes sense to support
- memory sharing using this model. The PIL memory model is sometimes
- used in C-code where a 2-d array can be then accessed using double
- pointer indirection: e.g. image[i][j].
-
- The buffer interface should allow the object to export either of these
- memory models. Consumers are free to either require contiguous memory
- or write code to handle one or both of these memory models.
-
-Proposal Overview
-=================
-
-* Eliminate the char-buffer and multiple-segment sections of the
- buffer-protocol.
-
-* Unify the read/write versions of getting the buffer.
-
-* Add a new function to the interface that should be called when
- the consumer object is "done" with the memory area.
-
-* Add a new variable to allow the interface to describe what is in
- memory (unifying what is currently done now in struct and
- array)
-
-* Add a new variable to allow the protocol to share shape information
-
-* Add a new variable for sharing stride information
-
-* Add a new mechanism for sharing arrays that must
- be accessed using pointer indirection.
-
-* Fix all objects in the core and the standard library to conform
- to the new interface
-
-* Extend the struct module to handle more format specifiers
-
-* Extend the buffer object into a new memory object which places
- a Python veneer around the buffer interface.
-
-* Add a few functions to make it easy to copy contiguous data
- in and out of object supporting the buffer interface.
-
-Specification
-=============
-
-While the new specification allows for complicated memory sharing.
-Simple contiguous buffers of bytes can still be obtained from an
-object. In fact, the new protocol allows a standard mechanism for
-doing this even if the original object is not represented as a
-contiguous chunk of memory.
-
-The easiest way to obtain a simple contiguous chunk of memory is
-to use the provided C-API to obtain a chunk of memory.
-
-
-Change the PyBufferProcs structure to
-
-::
-
- typedef struct {
- getbufferproc bf_getbuffer;
- releasebufferproc bf_releasebuffer;
- }
-
-
-::
-
- typedef int (*getbufferproc)(PyObject *obj, PyBuffer *view, int flags)
-
-This function returns 0 on success and -1 on failure (and raises an
-error). The first variable is the "exporting" object. The second
-argument is the address to a bufferinfo structure. If view is NULL,
-then no information is returned but a lock on the memory is still
-obtained. In this case, the corresponding releasebuffer should also
-be called with NULL.
-
-The third argument indicates what kind of buffer the exporter is
-allowed to return. It essentially tells the exporter what kind of
-memory area the consumer can deal with. It also indicates what
-members of the PyBuffer structure the consumer is going to care about.
-
-The exporter can use this information to simplify how much of the PyBuffer
-structure is filled in and/or raise an error if the object can't support
-a simpler view of its memory.
-
-Thus, the caller can request a simple "view" and either receive it or
-have an error raised if it is not possible.
-
-All of the following assume that at least buf, len, and readonly
-will always be utilized by the caller.
-
-Py_BUF_SIMPLE
-
- The returned buffer will be assumed to be readable (the object may
- or may not have writeable memory). Only the buf, len, and readonly
- variables may be accessed. The format will be assumed to be
- unsigned bytes . This is a "stand-alone" flag constant. It never
- needs to be \|'d to the others. The exporter will raise an
- error if it cannot provide such a contiguous buffer.
-
-Py_BUF_WRITEABLE
-
- The returned buffer must be writeable. If it is not writeable,
- then raise an error.
-
-Py_BUF_READONLY
-
- The returned buffer must be readonly. If the object is already
- read-only or it can make its memory read-only (and there are no
- other views on the object) then it should do so and return the
- buffer information. If the object does not have read-only memory
- (or cannot make it read-only), then an error should be raised.
-
-Py_BUF_FORMAT
-
- The returned buffer must have true format information. This would
- be used when the consumer is going to be checking for what 'kind'
- of data is actually stored. An exporter should always be able
- to provide this information if requested.
-
-Py_BUF_SHAPE
-
- The returned buffer must have shape information. The memory will
- be assumed C-style contiguous (last dimension varies the fastest).
- The exporter may raise an error if it cannot provide this kind
- of contiguous buffer.
-
-Py_BUF_STRIDES (implies Py_BUF_SHAPE)
-
- The returned buffer must have strides information. This would be
- used when the consumer can handle strided, discontiguous arrays.
- Handling strides automatically assumes you can handle shape.
- The exporter may raise an error if cannot provide a strided-only
- representation of the data (i.e. without the suboffsets).
-
-Py_BUF_OFFSETS (implies Py_BUF_STRIDES)
-
- The returned buffer must have suboffsets information. This would
- be used when the consumer can handle indirect array referencing
- implied by these suboffsets.
-
-Py_BUF_FULL (Py_BUF_OFFSETS | Py_BUF_WRITEABLE | Py_BUF_FORMAT)
-
-Thus, the consumer simply wanting a contiguous chunk of bytes from
-the object would use Py_BUF_SIMPLE, while a consumer that understands
-how to make use of the most complicated cases could use Py_BUF_INDIRECT.
-
-If format information is going to be probed, then Py_BUF_FORMAT must
-be \|'d to the flags otherwise the consumer assumes it is unsigned
-bytes.
-
-There is a C-API that simple exporting objects can use to fill-in the
-buffer info structure correctly according to the provided flags if a
-contiguous chunk of "unsigned bytes" is all that can be exported.
-
-
-The bufferinfo structure is::
-
- struct bufferinfo {
- void *buf;
- Py_ssize_t len;
- int readonly;
- const char *format;
- int ndims;
- Py_ssize_t *shape;
- Py_ssize_t *strides;
- Py_ssize_t *suboffsets;
- int itemsize;
- void *internal;
- } PyBuffer;
-
-Before calling this function, the bufferinfo structure can be filled
-with whatever. Upon return from getbufferproc, the bufferinfo
-structure is filled in with relevant information about the buffer.
-This same bufferinfo structure must be passed to bf_releasebuffer (if
-available) when the consumer is done with the memory. The caller is
-responsible for keeping a reference to obj until releasebuffer is
-called (i.e. this call does not alter the reference count of obj).
-
-The members of the bufferinfo structure are:
-
-buf
- a pointer to the start of the memory for the object
-
-len
- the total bytes of memory the object uses. This should be the
- same as the product of the shape array multiplied by the number of
- bytes per item of memory.
-
-readonly
- an integer variable to hold whether or not the memory is
- readonly. 1 means the memory is readonly, zero means the
- memory is writeable.
-
-format
- a NULL-terminated format-string (following the struct-style syntax
- including extensions) indicating what is in each element of
- memory. The number of elements is len / itemsize, where itemsize
- is the number of bytes implied by the format. For standard
- unsigned bytes use a format string of "B".
-
-ndims
- a variable storing the number of dimensions the memory represents.
- Must be >=0.
-
-shape
- an array of ``Py_ssize_t`` of length ``ndims`` indicating the
- shape of the memory as an N-D array. Note that ``((*shape)[0] *
- ... * (*shape)[ndims-1])*itemsize = len``. If ndims is 0 (indicating
- a scalar), then this must be NULL.
-
-strides
- address of a ``Py_ssize_t*`` variable that will be filled with a
- pointer to an array of ``Py_ssize_t`` of length ``ndims`` (or NULL
- if ndims is 0). indicating the number of bytes to skip to get to
- the next element in each dimension. If this is not requested by
- the caller (BUF_STRIDES is not set), then this member of the
- structure will not be used and the consumer is assuming the array
- is C-style contiguous. If this is not the case, then an error
- should be raised. If this member is requested by the caller
- (BUF_STRIDES is set), then it must be filled in.
-
-
-suboffsets
- address of a ``Py_ssize_t *`` variable that will be filled with a
- pointer to an array of ``Py_ssize_t`` of length ``*ndims``. If
- these suboffset numbers are >=0, then the value stored along the
- indicated dimension is a pointer and the suboffset value dictates
- how many bytes to add to the pointer after de-referencing. A
- suboffset value that it negative indicates that no de-referencing
- should occur (striding in a contiguous memory block). If all
- suboffsets are negative (i.e. no de-referencing is needed, then
- this must be NULL.
-
- For clarity, here is a function that returns a pointer to the
- element in an N-D array pointed to by an N-dimesional index when
- there are both strides and suboffsets.::
-
- void* get_item_pointer(int ndim, void* buf, Py_ssize_t* strides,
- Py_ssize_t* suboffsets, Py_ssize_t *indices) {
- char* pointer = (char*)buf;
- int i;
- for (i = 0; i < ndim; i++) {
- pointer += strides[i]*indices[i];
- if (suboffsets[i] >=0 ) {
- pointer = *((char**)pointer) + suboffsets[i];
- }
- }
- return (void*)pointer;
- }
-
- Notice the suboffset is added "after" the dereferencing occurs.
- Thus slicing in the ith dimension would add to the suboffsets in
- the (i-1)st dimension. Slicing in the first dimension would change
- the location of the starting pointer directly (i.e. buf would
- be modified).
-
-itemsize
- This is a storage for the itemsize of each element of the shared
- memory. It can be obtained using PyBuffer_SizeFromFormat but an
- exporter may know it without making this call and thus storing it
- is more convenient and faster.
-
-internal
- This is for use internally by the exporting object. For example,
- this might be re-cast as an integer by the exporter and used to
- store flags about whether or not the shape, strides, and suboffsets
- arrays must be freed when the buffer is released. The consumer
- should never touch this value.
-
-
-The exporter is responsible for making sure the memory pointed to by
-buf, format, shape, strides, and suboffsets is valid until
-releasebuffer is called. If the exporter wants to be able to change
-shape, strides, and/or suboffsets before releasebuffer is called then
-it should allocate those arrays when getbuffer is called (pointing to
-them in the buffer-info structure provided) and free them when
-releasebuffer is called.
-
-
-The same bufferinfo struct should be used in the release-buffer
-interface call. The caller is responsible for the memory of the
-bufferinfo structure itself.
-
-``typedef int (*releasebufferproc)(PyObject *obj, PyBuffer *view)``
- Callers of getbufferproc must make sure that this function is
- called when memory previously acquired from the object is no
- longer needed. The exporter of the interface must make sure that
- any memory pointed to in the bufferinfo structure remains valid
- until releasebuffer is called.
-
- Both of these routines are optional for a type object
-
- If the releasebuffer function is not provided then it does not ever
- need to be called.
-
-Exporters will need to define a releasebuffer function if they can
-re-allocate their memory, strides, shape, suboffsets, or format
-variables which they might share through the struct bufferinfo.
-Several mechanisms could be used to keep track of how many getbuffer
-calls have been made and shared. Either a single variable could be
-used to keep track of how many "views" have been exported, or a
-linked-list of bufferinfo structures filled in could be maintained in
-each object.
-
-All that is specifically required by the exporter, however, is to
-ensure that any memory shared through the bufferinfo structure remains
-valid until releasebuffer is called on the bufferinfo structure.
-
-
-New C-API calls are proposed
-============================
-
-::
-
- int PyObject_CheckBuffer(PyObject *obj)
-
-Return 1 if the getbuffer function is available otherwise 0.
-
-::
-
- int PyObject_GetBuffer(PyObject *obj, PyBuffer *view,
- int flags)
-
-This is a C-API version of the getbuffer function call. It checks to
-make sure object has the required function pointer and issues the
-call. Returns -1 and raises an error on failure and returns 0 on
-success.
-
-::
-
- int PyObject_ReleaseBuffer(PyObject *obj, PyBuffer *view)
-
-This is a C-API version of the releasebuffer function call. It checks
-to make sure the object has the required function pointer and issues
-the call. Returns 0 on success and -1 (with an error raised) on
-failure. This function always succeeds if there is no releasebuffer
-function for the object.
-
-::
-
- PyObject *PyObject_GetMemoryView(PyObject *obj)
-
-Return a memory-view object from an object that defines the buffer interface.
-
-A memory-view object is an extended buffer object that could replace
-the buffer object (but doesn't have to). It's C-structure is
-
-::
-
- typedef struct {
- PyObject_HEAD
- PyObject *base;
- int ndims;
- Py_ssize_t *starts; /* slice starts */
- Py_ssize_t *stops; /* slice stops */
- Py_ssize_t *steps; /* slice steps */
- } PyMemoryViewObject;
-
-This is functionally similar to the current buffer object except only
-a reference to base is kept. The actual memory for base must be
-re-grabbed using the buffer-protocol, whenever it is needed.
-
-The getbuffer and releasebuffer for this object use the underlying
-base object (adjusted using the slice information). If the number of
-dimensions of the base object (or the strides or the size) has changed
-when a new view is requested, then the getbuffer will trigger an error.
-
-This memory-view object will support mult-dimensional slicing. Slices
-of the memory-view object are other memory-view objects. When an
-"element" from the memory-view is returned it is always a tuple of
-bytes object + format string which can then be interpreted using the
-struct module if desired.
-
-::
-
- int PyBuffer_SizeFromFormat(const char *)
-
-Return the implied itemsize of the data-format area from a struct-style
-description.
-
-::
-
- int PyObject_GetContiguous(PyObject *obj, void **buf, Py_ssize_t *len,
- char **format, char fortran)
-
-Return a contiguous chunk of memory representing the buffer. If a
-copy is made then return 1. If no copy was needed return 0. If an
-error occurred in probing the buffer interface, then return -1. The
-contiguous chunk of memory is pointed to by ``*buf`` and the length of
-that memory is ``*len``. If the object is multi-dimensional, then if
-fortran is 'F', the first dimension of the underlying array will vary
-the fastest in the buffer. If fortran is 'C', then the last dimension
-will vary the fastest (C-style contiguous). If fortran is 'A', then it
-does not matter and you will get whatever the object decides is more
-efficient.
-
-::
-
- int PyObject_CopyToObject(PyObject *obj, void *buf, Py_ssize_t len,
- char fortran)
-
-Copy ``len`` bytes of data pointed to by the contiguous chunk of
-memory pointed to by ``buf`` into the buffer exported by obj. Return
-0 on success and return -1 and raise an error on failure. If the
-object does not have a writeable buffer, then an error is raised. If
-fortran is 'F', then if the object is multi-dimensional, then the data
-will be copied into the array in Fortran-style (first dimension varies
-the fastest). If fortran is 'C', then the data will be copied into the
-array in C-style (last dimension varies the fastest). If fortran is 'A', then
-it does not matter and the copy will be made in whatever way is more
-efficient.
-
-::
-
- void PyBuffer_FreeMem(void *buf)
-
-This function frees the memory returned by PyObject_GetContiguous if a
-copy was made. Do not call this function unless
-PyObject_GetContiguous returns a 1 indicating that new memory was
-created.
-
-
-These last three C-API calls allow a standard way of getting data in and
-out of Python objects into contiguous memory areas no matter how it is
-actually stored. These calls use the extended buffer interface to perform
-their work.
-
-::
-
- int PyBuffer_IsContiguous(PyBuffer *view, char fortran);
-
-Return 1 if the memory defined by the view object is C-style (fortran = 'C')
-or Fortran-style (fortran = 'A') contiguous. Return 0 otherwise.
-
-::
-
- void PyBuffer_FillContiguousStrides(int *ndims, Py_ssize_t *shape,
- int itemsize,
- Py_ssize_t *strides, char fortran)
-
-Fill the strides array with byte-strides of a contiguous (C-style if
-fortran is 0 or Fortran-style if fortran is 1) array of the given
-shape with the given number of bytes per element.
-
-::
-
- int PyBuffer_FillInfo(PyBuffer *view, void *buf,
- Py_ssize_t len, int readonly, int infoflags)
-
-Fills in a buffer-info structure correctly for an exporter that can
-only share a contiguous chunk of memory of "unsigned bytes" of the
-given length. Returns 0 on success and -1 (with raising an error) on
-error.
-
-
-Additions to the struct string-syntax
-=====================================
-
-The struct string-syntax is missing some characters to fully
-implement data-format descriptions already available elsewhere (in
-ctypes and NumPy for example). The Python 2.5 specification is
-at http://docs.python.org/lib/module-struct.html
-
-Here are the proposed additions:
-
-
-================ ===========
-Character Description
-================ ===========
-'t' bit (number before states how many bits)
-'?' platform _Bool type
-'g' long double
-'c' ucs-1 (latin-1) encoding
-'u' ucs-2
-'w' ucs-4
-'O' pointer to Python Object
-'Z' complex (whatever the next specifier is)
-'&' specific pointer (prefix before another charater)
-'T{}' structure (detailed layout inside {})
-'(k1,k2,...,kn)' multi-dimensional array of whatever follows
-':name:' optional name of the preceeding element
-'X{}' pointer to a function (optional function
- signature inside {})
-' \n\t' ignored (allow better readability)
- -- this may already be true
-================ ===========
-
-The struct module will be changed to understand these as well and
-return appropriate Python objects on unpacking. Unpacking a
-long-double will return a decimal object or a ctypes long-double.
-Unpacking 'u' or 'w' will return Python unicode. Unpacking a
-multi-dimensional array will return a list (of lists if >1d).
-Unpacking a pointer will return a ctypes pointer object. Unpacking a
-function pointer will return a ctypes call-object (perhaps). Unpacking
-a bit will return a Python Bool. White-space in the struct-string
-syntax will be ignored if it isn't already. Unpacking a named-object
-will return some kind of named-tuple-like object that acts like a
-tuple but whose entries can also be accessed by name. Unpacking a
-nested structure will return a nested tuple.
-
-Endian-specification ('!', '@','=','>','<', '^') is also allowed
-inside the string so that it can change if needed. The
-previously-specified endian string is in force until changed. The
-default endian is '@' which means native data-types and alignment. If
-un-aligned, native data-types are requested, then the endian
-specification is '^'.
-
-According to the struct-module, a number can preceed a character
-code to specify how many of that type there are. The
-(k1,k2,...,kn) extension also allows specifying if the data is
-supposed to be viewed as a (C-style contiguous, last-dimension
-varies the fastest) multi-dimensional array of a particular format.
-
-Functions should be added to ctypes to create a ctypes object from
-a struct description, and add long-double, and ucs-2 to ctypes.
-
-Examples of Data-Format Descriptions
-====================================
-
-Here are some examples of C-structures and how they would be
-represented using the struct-style syntax.
-
-<named> is the constructor for a named-tuple (not-specified yet).
-
-float
- 'f' <--> Python float
-complex double
- 'Zd' <--> Python complex
-RGB Pixel data
- 'BBB' <--> (int, int, int)
- 'B:r: B:g: B:b:' <--> <named>((int, int, int), ('r','g','b'))
-
-Mixed endian (weird but possible)
- '>i:big: <i:little:' <--> <named>((int, int), ('big', 'little'))
-
-Nested structure
- ::
-
- struct {
- int ival;
- struct {
- unsigned short sval;
- unsigned char bval;
- unsigned char cval;
- } sub;
- }
- """i:ival:
- T{
- H:sval:
- B:bval:
- B:cval:
- }:sub:
- """
-Nested array
- ::
-
- struct {
- int ival;
- double data[16*4];
- }
- """i:ival:
- (16,4)d:data:
- """
-
-
-Code to be affected
-===================
-
-All objects and modules in Python that export or consume the old
-buffer interface will be modified. Here is a partial list.
-
-* buffer object
-* bytes object
-* string object
-* array module
-* struct module
-* mmap module
-* ctypes module
-
-Anything else using the buffer API.
-
-
-Issues and Details
-==================
-
-It is intended that this PEP will be back-ported to Python 2.6 by
-adding the C-API and the two functions to the existing buffer
-protocol.
-
-The proposed locking mechanism relies entirely on the exporter object
-to not invalidate any of the memory pointed to by the buffer structure
-until a corresponding releasebuffer is called. If it wants to be able
-to change its own shape and/or strides arrays, then it needs to create
-memory for these in the bufferinfo structure and copy information
-over.
-
-The sharing of strided memory and suboffsets is new and can be seen as
-a modification of the multiple-segment interface. It is motivated by
-NumPy and the PIL. NumPy objects should be able to share their
-strided memory with code that understands how to manage strided memory
-because strided memory is very common when interfacing with compute
-libraries.
-
-Also, with this approach it should be possible to write generic code
-that works with both kinds of memory.
-
-Memory management of the format string, the shape array, the strides
-array, and the suboffsets array in the bufferinfo structure is always
-the responsibility of the exporting object. The consumer should not
-set these pointers to any other memory or try to free them.
-
-Several ideas were discussed and rejected:
-
- Having a "releaser" object whose release-buffer was called. This
- was deemed unacceptable because it caused the protocol to be
- asymmetric (you called release on something different than you
- "got" the buffer from). It also complicated the protocol without
- providing a real benefit.
-
- Passing all the struct variables separately into the function.
- This had the advantage that it allowed one to set NULL to
- variables that were not of interest, but it also made the function
- call more difficult. The flags variable allows the same
- ability of consumers to be "simple" in how they call the protocol.
-
-Code
-========
-
-The authors of the PEP promise to contribute and maintain the code for
-this proposal but will welcome any help.
-
-
-
-
-Examples
-=========
-
-Ex. 1
------------
-
-This example shows how an image object that uses contiguous lines might expose its buffer.
-
-::
-
- struct rgba {
- unsigned char r, g, b, a;
- };
-
- struct ImageObject {
- PyObject_HEAD;
- ...
- struct rgba** lines;
- Py_ssize_t height;
- Py_ssize_t width;
- Py_ssize_t shape_array[2];
- Py_ssize_t stride_array[2];
- Py_ssize_t view_count;
- };
-
-"lines" points to malloced 1-D array of (struct rgba*). Each pointer
-in THAT block points to a seperately malloced array of (struct rgba).
-
-In order to access, say, the red value of the pixel at x=30, y=50, you'd use "lines[50][30].r".
-
-So what does ImageObject's getbuffer do? Leaving error checking out::
-
- int Image_getbuffer(PyObject *self, PyBuffer *view, int flags) {
-
- static Py_ssize_t suboffsets[2] = { -1, 0 };
-
- view->buf = self->lines;
- view->len = self->height*self->width;
- view->readonly = 0;
- view->ndims = 2;
- self->shape_array[0] = height;
- self->shape_array[1] = width;
- view->shape = &self->shape_array;
- self->stride_array[0] = sizeof(struct rgba*);
- self->stride_array[1] = sizeof(struct rgba);
- view->strides = &self->stride_array;
- view->suboffsets = suboffsets;
-
- self->view_count ++;
-
- return 0;
- }
-
-
- int Image_releasebuffer(PyObject *self, PyBuffer *view) {
- self->view_count--;
- return 0;
- }
-
-
-Ex. 2
------------
-
-This example shows how an object that wants to expose a contiguous
-chunk of memory (which will never be re-allocated while the object is
-alive) would do that.
-
-::
-
- int myobject_getbuffer(PyObject *self, PyBuffer *view, int flags) {
-
- void *buf;
- Py_ssize_t len;
- int readonly=0;
-
- buf = /* Point to buffer */
- len = /* Set to size of buffer */
- readonly = /* Set to 1 if readonly */
-
- return PyObject_FillBufferInfo(view, buf, len, readonly, flags);
- }
-
-No releasebuffer is necessary because the memory will never
-be re-allocated so the locking mechanism is not needed.
-
-Ex. 3
------------
-
-A consumer that wants to only get a simple contiguous chunk of bytes
-from a Python object, obj would do the following:
-
-::
-
- PyBuffer view;
- int ret;
-
- if (PyObject_GetBuffer(obj, &view, Py_BUF_SIMPLE) < 0) {
- /* error return */
- }
-
- /* Now, view.buf is the pointer to memory
- view.len is the length
- view.readonly is whether or not the memory is read-only.
- */
-
-
- /* After using the information and you don't need it anymore */
-
- if (PyObject_ReleaseBuffer(obj, &view) < 0) {
- /* error return */
- }
-
-
-Ex. 4
------------
-
-A consumer that wants to be able to use any object's memory but is
-writing an algorithm that only handle contiguous memory could do the following:
-
-::
-
- void *buf;
- Py_ssize_t len;
- char *format;
-
- if (PyObject_GetContiguous(obj, &buf, &len, &format, 0) < 0) {
- /* error return */
- }
-
- /* process memory pointed to by buffer if format is correct */
-
- /* Optional:
-
- if, after processing, we want to copy data from buffer back
- into the the object
-
- we could do
- */
-
- if (PyObject_CopyToObject(obj, buf, len, 0) < 0) {
- /* error return */
- }
-
-
-Copyright
-=========
-
-This PEP is placed in the public domain
diff --git a/numpy/doc/reference/performance.py b/numpy/doc/performance.py
index 1429e232f..1429e232f 100644
--- a/numpy/doc/reference/performance.py
+++ b/numpy/doc/performance.py
diff --git a/numpy/doc/pyrex/MANIFEST b/numpy/doc/pyrex/MANIFEST
deleted file mode 100644
index feb3ec22a..000000000
--- a/numpy/doc/pyrex/MANIFEST
+++ /dev/null
@@ -1,2 +0,0 @@
-numpyx.pyx
-setup.py
diff --git a/numpy/doc/pyrex/Makefile b/numpy/doc/pyrex/Makefile
deleted file mode 100644
index b5905e7be..000000000
--- a/numpy/doc/pyrex/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-all:
- python setup.py build_ext --inplace
-
-test: all
- python run_test.py
-
-.PHONY: clean
-clean:
- rm -rf *~ *.so *.c *.o build
diff --git a/numpy/doc/pyrex/README.txt b/numpy/doc/pyrex/README.txt
deleted file mode 100644
index 9df1e6c8e..000000000
--- a/numpy/doc/pyrex/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-WARNING: this code is deprecated and slated for removal soon. See the
-doc/cython directory for the replacement, which uses Cython (the actively
-maintained version of Pyrex).
diff --git a/numpy/doc/pyrex/c_numpy.pxd b/numpy/doc/pyrex/c_numpy.pxd
deleted file mode 100644
index 511acc4b1..000000000
--- a/numpy/doc/pyrex/c_numpy.pxd
+++ /dev/null
@@ -1,125 +0,0 @@
-# :Author: Travis Oliphant
-
-cdef extern from "numpy/arrayobject.h":
-
- cdef enum NPY_TYPES:
- NPY_BOOL
- NPY_BYTE
- NPY_UBYTE
- NPY_SHORT
- NPY_USHORT
- NPY_INT
- NPY_UINT
- NPY_LONG
- NPY_ULONG
- NPY_LONGLONG
- NPY_ULONGLONG
- NPY_FLOAT
- NPY_DOUBLE
- NPY_LONGDOUBLE
- NPY_CFLOAT
- NPY_CDOUBLE
- NPY_CLONGDOUBLE
- NPY_OBJECT
- NPY_STRING
- NPY_UNICODE
- NPY_VOID
- NPY_NTYPES
- NPY_NOTYPE
-
- cdef enum requirements:
- NPY_CONTIGUOUS
- NPY_FORTRAN
- NPY_OWNDATA
- NPY_FORCECAST
- NPY_ENSURECOPY
- NPY_ENSUREARRAY
- NPY_ELEMENTSTRIDES
- NPY_ALIGNED
- NPY_NOTSWAPPED
- NPY_WRITEABLE
- NPY_UPDATEIFCOPY
- NPY_ARR_HAS_DESCR
-
- NPY_BEHAVED
- NPY_BEHAVED_NS
- NPY_CARRAY
- NPY_CARRAY_RO
- NPY_FARRAY
- NPY_FARRAY_RO
- NPY_DEFAULT
-
- NPY_IN_ARRAY
- NPY_OUT_ARRAY
- NPY_INOUT_ARRAY
- NPY_IN_FARRAY
- NPY_OUT_FARRAY
- NPY_INOUT_FARRAY
-
- NPY_UPDATE_ALL
-
- cdef enum defines:
- # Note: as of Pyrex 0.9.5, enums are type-checked more strictly, so this
- # can't be used as an integer.
- NPY_MAXDIMS
-
- ctypedef struct npy_cdouble:
- double real
- double imag
-
- ctypedef struct npy_cfloat:
- double real
- double imag
-
- ctypedef int npy_intp
-
- ctypedef extern class numpy.dtype [object PyArray_Descr]:
- cdef int type_num, elsize, alignment
- cdef char type, kind, byteorder, hasobject
- cdef object fields, typeobj
-
- ctypedef extern class numpy.ndarray [object PyArrayObject]:
- cdef char *data
- cdef int nd
- cdef npy_intp *dimensions
- cdef npy_intp *strides
- cdef object base
- cdef dtype descr
- cdef int flags
-
- ctypedef extern class numpy.flatiter [object PyArrayIterObject]:
- cdef int nd_m1
- cdef npy_intp index, size
- cdef ndarray ao
- cdef char *dataptr
-
- ctypedef extern class numpy.broadcast [object PyArrayMultiIterObject]:
- cdef int numiter
- cdef npy_intp size, index
- cdef int nd
- # These next two should be arrays of [NPY_MAXITER], but that is
- # difficult to cleanly specify in Pyrex. Fortunately, it doesn't matter.
- cdef npy_intp *dimensions
- cdef void **iters
-
- object PyArray_ZEROS(int ndims, npy_intp* dims, NPY_TYPES type_num, int fortran)
- object PyArray_EMPTY(int ndims, npy_intp* dims, NPY_TYPES type_num, int fortran)
- dtype PyArray_DescrFromTypeNum(NPY_TYPES type_num)
- object PyArray_SimpleNew(int ndims, npy_intp* dims, NPY_TYPES type_num)
- int PyArray_Check(object obj)
- object PyArray_ContiguousFromAny(object obj, NPY_TYPES type,
- int mindim, int maxdim)
- npy_intp PyArray_SIZE(ndarray arr)
- npy_intp PyArray_NBYTES(ndarray arr)
- void *PyArray_DATA(ndarray arr)
- object PyArray_FromAny(object obj, dtype newtype, int mindim, int maxdim,
- int requirements, object context)
- object PyArray_FROMANY(object obj, NPY_TYPES type_num, int min,
- int max, int requirements)
- object PyArray_NewFromDescr(object subtype, dtype newtype, int nd,
- npy_intp* dims, npy_intp* strides, void* data,
- int flags, object parent)
-
- void PyArray_ITER_NEXT(flatiter it)
-
- void import_array()
diff --git a/numpy/doc/pyrex/c_python.pxd b/numpy/doc/pyrex/c_python.pxd
deleted file mode 100644
index 53f6d9b19..000000000
--- a/numpy/doc/pyrex/c_python.pxd
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- Mode: Python -*- Not really, but close enough
-
-# Expose as much of the Python C API as we need here
-
-cdef extern from "stdlib.h":
- ctypedef int size_t
-
-cdef extern from "Python.h":
- ctypedef int Py_intptr_t
- void* PyMem_Malloc(size_t)
- void* PyMem_Realloc(void *p, size_t n)
- void PyMem_Free(void *p)
- char* PyString_AsString(object string)
- object PyString_FromString(char *v)
- object PyString_InternFromString(char *v)
- int PyErr_CheckSignals()
- object PyFloat_FromDouble(double v)
- void Py_XINCREF(object o)
- void Py_XDECREF(object o)
- void Py_CLEAR(object o) # use instead of decref
diff --git a/numpy/doc/pyrex/notes b/numpy/doc/pyrex/notes
deleted file mode 100644
index 301581cee..000000000
--- a/numpy/doc/pyrex/notes
+++ /dev/null
@@ -1,3 +0,0 @@
-- cimport with a .pxd file vs 'include foo.pxi'?
-
-- the need to repeat: pyrex does NOT parse C headers. \ No newline at end of file
diff --git a/numpy/doc/pyrex/numpyx.c b/numpy/doc/pyrex/numpyx.c
deleted file mode 100644
index e250eae19..000000000
--- a/numpy/doc/pyrex/numpyx.c
+++ /dev/null
@@ -1,1037 +0,0 @@
-/* Generated by Pyrex 0.9.5.1 on Wed Jan 31 11:57:10 2007 */
-
-#include "Python.h"
-#include "structmember.h"
-#ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
-#endif
-#ifdef __cplusplus
-#define __PYX_EXTERN_C extern "C"
-#else
-#define __PYX_EXTERN_C extern
-#endif
-__PYX_EXTERN_C double pow(double, double);
-#include "stdlib.h"
-#include "numpy/arrayobject.h"
-
-
-typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
-typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
-
-static PyObject *__pyx_m;
-static PyObject *__pyx_b;
-static int __pyx_lineno;
-static char *__pyx_filename;
-static char **__pyx_f;
-
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-
-static int __Pyx_PrintItem(PyObject *); /*proto*/
-static int __Pyx_PrintNewline(void); /*proto*/
-
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
-
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
-
-/* Declarations from c_python */
-
-
-/* Declarations from c_numpy */
-
-static PyTypeObject *__pyx_ptype_7c_numpy_dtype = 0;
-static PyTypeObject *__pyx_ptype_7c_numpy_ndarray = 0;
-static PyTypeObject *__pyx_ptype_7c_numpy_flatiter = 0;
-static PyTypeObject *__pyx_ptype_7c_numpy_broadcast = 0;
-
-/* Declarations from numpyx */
-
-static PyObject *(__pyx_f_6numpyx_print_elements(char (*),Py_intptr_t (*),Py_intptr_t (*),int ,int ,PyObject *)); /*proto*/
-
-
-/* Implementation of numpyx */
-
-
-static PyObject *__pyx_n_c_python;
-static PyObject *__pyx_n_c_numpy;
-static PyObject *__pyx_n_numpy;
-static PyObject *__pyx_n_print_array_info;
-static PyObject *__pyx_n_test_methods;
-static PyObject *__pyx_n_test;
-
-static PyObject *__pyx_n_dtype;
-
-static PyObject *__pyx_k2p;
-static PyObject *__pyx_k3p;
-static PyObject *__pyx_k4p;
-static PyObject *__pyx_k5p;
-static PyObject *__pyx_k6p;
-static PyObject *__pyx_k7p;
-static PyObject *__pyx_k8p;
-static PyObject *__pyx_k9p;
-
-static char (__pyx_k2[]) = "-=";
-static char (__pyx_k3[]) = "printing array info for ndarray at 0x%0lx";
-static char (__pyx_k4[]) = "print number of dimensions:";
-static char (__pyx_k5[]) = "address of strides: 0x%0lx";
-static char (__pyx_k6[]) = "strides:";
-static char (__pyx_k7[]) = " stride %d:";
-static char (__pyx_k8[]) = "memory dump:";
-static char (__pyx_k9[]) = "-=";
-
-static PyObject *__pyx_f_6numpyx_print_array_info(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6numpyx_print_array_info(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyArrayObject *__pyx_v_arr = 0;
- int __pyx_v_i;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- int __pyx_3;
- static char *__pyx_argnames[] = {"arr",0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_arr)) return 0;
- Py_INCREF(__pyx_v_arr);
- if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_7c_numpy_ndarray, 1, "arr")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":13 */
- __pyx_1 = PyInt_FromLong(10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
- __pyx_2 = PyNumber_Multiply(__pyx_k2p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__Pyx_PrintItem(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":14 */
- __pyx_1 = PyInt_FromLong(((int )__pyx_v_arr)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
- __pyx_1 = 0;
- __pyx_1 = PyNumber_Remainder(__pyx_k3p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintItem(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":15 */
- if (__Pyx_PrintItem(__pyx_k4p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
- __pyx_2 = PyInt_FromLong(__pyx_v_arr->nd); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
- if (__Pyx_PrintItem(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":16 */
- __pyx_1 = PyInt_FromLong(((int )__pyx_v_arr->strides)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
- __pyx_1 = 0;
- __pyx_1 = PyNumber_Remainder(__pyx_k5p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintItem(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":17 */
- if (__Pyx_PrintItem(__pyx_k6p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":18 */
- __pyx_3 = __pyx_v_arr->nd;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":20 */
- __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
- __pyx_1 = PyNumber_Remainder(__pyx_k7p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintItem(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_2 = PyInt_FromLong(((int )(__pyx_v_arr->strides[__pyx_v_i]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
- if (__Pyx_PrintItem(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
- }
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":21 */
- if (__Pyx_PrintItem(__pyx_k8p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":22 */
- __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_n_dtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
- __pyx_2 = __pyx_f_6numpyx_print_elements(__pyx_v_arr->data,__pyx_v_arr->strides,__pyx_v_arr->dimensions,__pyx_v_arr->nd,(sizeof(double )),__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":24 */
- __pyx_1 = PyInt_FromLong(10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
- __pyx_2 = PyNumber_Multiply(__pyx_k9p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__Pyx_PrintItem(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":25 */
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;}
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- __Pyx_AddTraceback("numpyx.print_array_info");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_arr);
- return __pyx_r;
-}
-
-static PyObject *__pyx_n_object_;
-static PyObject *__pyx_n_float64;
-static PyObject *__pyx_n_name;
-
-static PyObject *__pyx_k10p;
-static PyObject *__pyx_k11p;
-static PyObject *__pyx_k12p;
-static PyObject *__pyx_k13p;
-static PyObject *__pyx_k14p;
-
-static char (__pyx_k10[]) = " print_elements() not (yet) implemented for dtype %s";
-static char (__pyx_k11[]) = " ";
-static char (__pyx_k12[]) = " ";
-static char (__pyx_k13[]) = " ";
-static char (__pyx_k14[]) = " ";
-
-static PyObject *__pyx_f_6numpyx_print_elements(char (*__pyx_v_data),Py_intptr_t (*__pyx_v_strides),Py_intptr_t (*__pyx_v_dimensions),int __pyx_v_nd,int __pyx_v_elsize,PyObject *__pyx_v_dtype) {
- Py_intptr_t __pyx_v_i;
- void (*__pyx_v_elptr);
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- PyObject *__pyx_4 = 0;
- int __pyx_5;
- Py_intptr_t __pyx_6;
- Py_INCREF(__pyx_v_dtype);
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":36 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_dtype); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_object_); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_dtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyList_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
- PyList_SET_ITEM(__pyx_1, 0, __pyx_3);
- PyList_SET_ITEM(__pyx_1, 1, __pyx_4);
- __pyx_3 = 0;
- __pyx_4 = 0;
- __pyx_5 = PySequence_Contains(__pyx_1, __pyx_v_dtype); if (__pyx_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
- __pyx_5 = !__pyx_5;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__pyx_5) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":38 */
- __pyx_2 = PyObject_GetAttr(__pyx_v_dtype, __pyx_n_name); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
- __pyx_3 = PyNumber_Remainder(__pyx_k10p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintItem(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":39 */
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- goto __pyx_L2;
- }
- __pyx_L2:;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":41 */
- __pyx_5 = (__pyx_v_nd == 0);
- if (__pyx_5) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":42 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_dtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_object_); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (PyObject_Cmp(__pyx_v_dtype, __pyx_2, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
- __pyx_5 = __pyx_5 == 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__pyx_5) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":43 */
- __pyx_v_elptr = (((void (*(*)))__pyx_v_data)[0]);
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":44 */
- if (__Pyx_PrintItem(__pyx_k11p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
- __pyx_3 = (PyObject *)__pyx_v_elptr;
- Py_INCREF(__pyx_3);
- if (__Pyx_PrintItem(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
- goto __pyx_L4;
- }
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_1, __pyx_n_dtype); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyObject_Cmp(__pyx_v_dtype, __pyx_2, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
- __pyx_5 = __pyx_5 == 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__pyx_5) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":46 */
- if (__Pyx_PrintItem(__pyx_k12p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;}
- __pyx_3 = PyFloat_FromDouble((((double (*))__pyx_v_data)[0])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;}
- if (__Pyx_PrintItem(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;}
- goto __pyx_L4;
- }
- __pyx_L4:;
- goto __pyx_L3;
- }
- __pyx_5 = (__pyx_v_nd == 1);
- if (__pyx_5) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":48 */
- __pyx_6 = (__pyx_v_dimensions[0]);
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_6; ++__pyx_v_i) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":49 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_dtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_object_); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (PyObject_Cmp(__pyx_v_dtype, __pyx_2, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
- __pyx_5 = __pyx_5 == 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__pyx_5) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":50 */
- __pyx_v_elptr = (((void (*(*)))__pyx_v_data)[0]);
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":51 */
- if (__Pyx_PrintItem(__pyx_k13p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
- __pyx_3 = (PyObject *)__pyx_v_elptr;
- Py_INCREF(__pyx_3);
- if (__Pyx_PrintItem(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
- goto __pyx_L7;
- }
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_1, __pyx_n_dtype); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyObject_Cmp(__pyx_v_dtype, __pyx_2, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
- __pyx_5 = __pyx_5 == 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__pyx_5) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":53 */
- if (__Pyx_PrintItem(__pyx_k14p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
- __pyx_3 = PyFloat_FromDouble((((double (*))__pyx_v_data)[0])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
- if (__Pyx_PrintItem(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":54 */
- __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":56 */
- __pyx_6 = (__pyx_v_dimensions[0]);
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_6; ++__pyx_v_i) {
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":57 */
- __pyx_4 = __pyx_f_6numpyx_print_elements(__pyx_v_data,(__pyx_v_strides + 1),(__pyx_v_dimensions + 1),(__pyx_v_nd - 1),__pyx_v_elsize,__pyx_v_dtype); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":58 */
- __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
- }
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- Py_XDECREF(__pyx_4);
- __Pyx_AddTraceback("numpyx.print_elements");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_dtype);
- return __pyx_r;
-}
-
-static PyObject *__pyx_n_any;
-
-static PyObject *__pyx_k15p;
-static PyObject *__pyx_k16p;
-static PyObject *__pyx_k17p;
-
-static char (__pyx_k15[]) = "arr.any() :";
-static char (__pyx_k16[]) = "arr.nd :";
-static char (__pyx_k17[]) = "arr.flags :";
-
-static PyObject *__pyx_f_6numpyx_test_methods(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6numpyx_test_methods[] = "Test a few attribute accesses for an array.\n \n This illustrates how the pyrex-visible object is in practice a strange\n hybrid of the C PyArrayObject struct and the python object. Some\n properties (like .nd) are visible here but not in python, while others\n like flags behave very differently: in python flags appears as a separate,\n object while here we see the raw int holding the bit pattern.\n\n This makes sense when we think of how pyrex resolves arr.foo: if foo is\n listed as a field in the c_numpy.ndarray struct description, it will be\n directly accessed as a C variable without going through Python at all.\n This is why for arr.flags, we see the actual int which holds all the flags\n as bit fields. However, for any other attribute not listed in the struct,\n it simply forwards the attribute lookup to python at runtime, just like\n python would (which means that AttributeError can be raised for\n non-existent attributes, for example).";
-static PyObject *__pyx_f_6numpyx_test_methods(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyArrayObject *__pyx_v_arr = 0;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- static char *__pyx_argnames[] = {"arr",0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_arr)) return 0;
- Py_INCREF(__pyx_v_arr);
- if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_7c_numpy_ndarray, 1, "arr")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":78 */
- if (__Pyx_PrintItem(__pyx_k15p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
- __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__Pyx_PrintItem(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":79 */
- if (__Pyx_PrintItem(__pyx_k16p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
- __pyx_1 = PyInt_FromLong(__pyx_v_arr->nd); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
- if (__Pyx_PrintItem(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":80 */
- if (__Pyx_PrintItem(__pyx_k17p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
- __pyx_2 = PyInt_FromLong(__pyx_v_arr->flags); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
- if (__Pyx_PrintItem(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- __Pyx_AddTraceback("numpyx.test_methods");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_arr);
- return __pyx_r;
-}
-
-static PyObject *__pyx_n_array;
-static PyObject *__pyx_n_arange;
-static PyObject *__pyx_n_shape;
-static PyObject *__pyx_n_one;
-static PyObject *__pyx_n_two;
-
-
-static PyObject *__pyx_f_6numpyx_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6numpyx_test[] = "this function is pure Python";
-static PyObject *__pyx_f_6numpyx_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_arr1;
- PyObject *__pyx_v_arr2;
- PyObject *__pyx_v_arr3;
- PyObject *__pyx_v_four;
- PyObject *__pyx_v_arr4;
- PyObject *__pyx_v_arr5;
- PyObject *__pyx_v_arr;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- PyObject *__pyx_4 = 0;
- PyObject *__pyx_5 = 0;
- static char *__pyx_argnames[] = {0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
- __pyx_v_arr1 = Py_None; Py_INCREF(Py_None);
- __pyx_v_arr2 = Py_None; Py_INCREF(Py_None);
- __pyx_v_arr3 = Py_None; Py_INCREF(Py_None);
- __pyx_v_four = Py_None; Py_INCREF(Py_None);
- __pyx_v_arr4 = Py_None; Py_INCREF(Py_None);
- __pyx_v_arr5 = Py_None; Py_INCREF(Py_None);
- __pyx_v_arr = Py_None; Py_INCREF(Py_None);
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":84 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyFloat_FromDouble((-1e-30)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
- __pyx_1 = 0;
- __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (PyDict_SetItem(__pyx_1, __pyx_n_dtype, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_v_arr1);
- __pyx_v_arr1 = __pyx_4;
- __pyx_4 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":85 */
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_3 = PyFloat_FromDouble(1.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- __pyx_1 = PyFloat_FromDouble(2.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble(3.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- __pyx_5 = PyList_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- PyList_SET_ITEM(__pyx_5, 0, __pyx_3);
- PyList_SET_ITEM(__pyx_5, 1, __pyx_1);
- PyList_SET_ITEM(__pyx_5, 2, __pyx_4);
- __pyx_3 = 0;
- __pyx_1 = 0;
- __pyx_4 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (PyDict_SetItem(__pyx_1, __pyx_n_dtype, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_v_arr2);
- __pyx_v_arr2 = __pyx_4;
- __pyx_4 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":87 */
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_arange); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_3 = PyInt_FromLong(9); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_float64); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- if (PyDict_SetItem(__pyx_4, __pyx_n_dtype, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_v_arr3);
- __pyx_v_arr3 = __pyx_5;
- __pyx_5 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":88 */
- __pyx_3 = PyInt_FromLong(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
- __pyx_2 = PyInt_FromLong(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
- __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
- PyTuple_SET_ITEM(__pyx_1, 1, __pyx_2);
- __pyx_3 = 0;
- __pyx_2 = 0;
- if (PyObject_SetAttr(__pyx_v_arr3, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":90 */
- __pyx_4 = PyInt_FromLong(4); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
- Py_DECREF(__pyx_v_four);
- __pyx_v_four = __pyx_4;
- __pyx_4 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":91 */
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_array); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_2 = PyInt_FromLong(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- __pyx_1 = PyList_New(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- Py_INCREF(__pyx_n_one);
- PyList_SET_ITEM(__pyx_1, 0, __pyx_n_one);
- Py_INCREF(__pyx_n_two);
- PyList_SET_ITEM(__pyx_1, 1, __pyx_n_two);
- PyList_SET_ITEM(__pyx_1, 2, __pyx_2);
- Py_INCREF(__pyx_v_four);
- PyList_SET_ITEM(__pyx_1, 3, __pyx_v_four);
- __pyx_2 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
- __pyx_1 = 0;
- __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_object_); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (PyDict_SetItem(__pyx_5, __pyx_n_dtype, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_2 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- Py_DECREF(__pyx_v_arr4);
- __pyx_v_arr4 = __pyx_2;
- __pyx_2 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":93 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
- __pyx_5 = PyInt_FromLong(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
- __pyx_2 = PyInt_FromLong(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
- __pyx_1 = PyList_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
- PyList_SET_ITEM(__pyx_1, 0, __pyx_4);
- PyList_SET_ITEM(__pyx_1, 1, __pyx_5);
- PyList_SET_ITEM(__pyx_1, 2, __pyx_2);
- __pyx_4 = 0;
- __pyx_5 = 0;
- __pyx_2 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
- __pyx_1 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_v_arr5);
- __pyx_v_arr5 = __pyx_5;
- __pyx_5 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":95 */
- __pyx_2 = PyList_New(5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
- Py_INCREF(__pyx_v_arr1);
- PyList_SET_ITEM(__pyx_2, 0, __pyx_v_arr1);
- Py_INCREF(__pyx_v_arr2);
- PyList_SET_ITEM(__pyx_2, 1, __pyx_v_arr2);
- Py_INCREF(__pyx_v_arr3);
- PyList_SET_ITEM(__pyx_2, 2, __pyx_v_arr3);
- Py_INCREF(__pyx_v_arr4);
- PyList_SET_ITEM(__pyx_2, 3, __pyx_v_arr4);
- Py_INCREF(__pyx_v_arr5);
- PyList_SET_ITEM(__pyx_2, 4, __pyx_v_arr5);
- __pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- for (;;) {
- __pyx_3 = PyIter_Next(__pyx_1);
- if (!__pyx_3) {
- if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
- break;
- }
- Py_DECREF(__pyx_v_arr);
- __pyx_v_arr = __pyx_3;
- __pyx_3 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":96 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_print_array_info); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
- Py_INCREF(__pyx_v_arr);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_arr);
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
- Py_DECREF(__pyx_1); __pyx_1 = 0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- Py_XDECREF(__pyx_4);
- Py_XDECREF(__pyx_5);
- __Pyx_AddTraceback("numpyx.test");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_arr1);
- Py_DECREF(__pyx_v_arr2);
- Py_DECREF(__pyx_v_arr3);
- Py_DECREF(__pyx_v_four);
- Py_DECREF(__pyx_v_arr4);
- Py_DECREF(__pyx_v_arr5);
- Py_DECREF(__pyx_v_arr);
- return __pyx_r;
-}
-
-static __Pyx_InternTabEntry __pyx_intern_tab[] = {
- {&__pyx_n_any, "any"},
- {&__pyx_n_arange, "arange"},
- {&__pyx_n_array, "array"},
- {&__pyx_n_c_numpy, "c_numpy"},
- {&__pyx_n_c_python, "c_python"},
- {&__pyx_n_dtype, "dtype"},
- {&__pyx_n_float64, "float64"},
- {&__pyx_n_name, "name"},
- {&__pyx_n_numpy, "numpy"},
- {&__pyx_n_object_, "object_"},
- {&__pyx_n_one, "one"},
- {&__pyx_n_print_array_info, "print_array_info"},
- {&__pyx_n_shape, "shape"},
- {&__pyx_n_test, "test"},
- {&__pyx_n_test_methods, "test_methods"},
- {&__pyx_n_two, "two"},
- {0, 0}
-};
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_k2p, __pyx_k2, sizeof(__pyx_k2)},
- {&__pyx_k3p, __pyx_k3, sizeof(__pyx_k3)},
- {&__pyx_k4p, __pyx_k4, sizeof(__pyx_k4)},
- {&__pyx_k5p, __pyx_k5, sizeof(__pyx_k5)},
- {&__pyx_k6p, __pyx_k6, sizeof(__pyx_k6)},
- {&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7)},
- {&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8)},
- {&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9)},
- {&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10)},
- {&__pyx_k11p, __pyx_k11, sizeof(__pyx_k11)},
- {&__pyx_k12p, __pyx_k12, sizeof(__pyx_k12)},
- {&__pyx_k13p, __pyx_k13, sizeof(__pyx_k13)},
- {&__pyx_k14p, __pyx_k14, sizeof(__pyx_k14)},
- {&__pyx_k15p, __pyx_k15, sizeof(__pyx_k15)},
- {&__pyx_k16p, __pyx_k16, sizeof(__pyx_k16)},
- {&__pyx_k17p, __pyx_k17, sizeof(__pyx_k17)},
- {0, 0, 0}
-};
-
-static struct PyMethodDef __pyx_methods[] = {
- {"print_array_info", (PyCFunction)__pyx_f_6numpyx_print_array_info, METH_VARARGS|METH_KEYWORDS, 0},
- {"test_methods", (PyCFunction)__pyx_f_6numpyx_test_methods, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6numpyx_test_methods},
- {"test", (PyCFunction)__pyx_f_6numpyx_test, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6numpyx_test},
- {0, 0, 0, 0}
-};
-
-static void __pyx_init_filenames(void); /*proto*/
-
-PyMODINIT_FUNC initnumpyx(void); /*proto*/
-PyMODINIT_FUNC initnumpyx(void) {
- PyObject *__pyx_1 = 0;
- __pyx_init_filenames();
- __pyx_m = Py_InitModule4("numpyx", __pyx_methods, 0, 0, PYTHON_API_VERSION);
- if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
- __pyx_b = PyImport_AddModule("__builtin__");
- if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
- if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
- __pyx_ptype_7c_numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (!__pyx_ptype_7c_numpy_dtype) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; goto __pyx_L1;}
- __pyx_ptype_7c_numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (!__pyx_ptype_7c_numpy_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; goto __pyx_L1;}
- __pyx_ptype_7c_numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (!__pyx_ptype_7c_numpy_flatiter) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; goto __pyx_L1;}
- __pyx_ptype_7c_numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (!__pyx_ptype_7c_numpy_broadcast) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; goto __pyx_L1;}
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":5 */
- __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
- if (PyObject_SetAttr(__pyx_m, __pyx_n_numpy, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":8 */
- import_array();
-
- /* "/Users/rkern/svn/numpy/numpy/doc/pyrex/numpyx.pyx":82 */
- return;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- __Pyx_AddTraceback("numpyx");
-}
-
-static char *__pyx_filenames[] = {
- "numpyx.pyx",
- "c_numpy.pxd",
-};
-
-/* Runtime support code */
-
-static void __pyx_init_filenames(void) {
- __pyx_f = __pyx_filenames;
-}
-
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) {
- if (!type) {
- PyErr_Format(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type))
- return 1;
- PyErr_Format(PyExc_TypeError,
- "Argument '%s' has incorrect type (expected %s, got %s)",
- name, type->tp_name, obj->ob_type->tp_name);
- return 0;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
- PyObject *__import__ = 0;
- PyObject *empty_list = 0;
- PyObject *module = 0;
- PyObject *global_dict = 0;
- PyObject *empty_dict = 0;
- PyObject *list;
- __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
- if (!__import__)
- goto bad;
- if (from_list)
- list = from_list;
- else {
- empty_list = PyList_New(0);
- if (!empty_list)
- goto bad;
- list = empty_list;
- }
- global_dict = PyModule_GetDict(__pyx_m);
- if (!global_dict)
- goto bad;
- empty_dict = PyDict_New();
- if (!empty_dict)
- goto bad;
- module = PyObject_CallFunction(__import__, "OOOO",
- name, global_dict, empty_dict, list);
-bad:
- Py_XDECREF(empty_list);
- Py_XDECREF(__import__);
- Py_XDECREF(empty_dict);
- return module;
-}
-
-static PyObject *__Pyx_GetStdout(void) {
- PyObject *f = PySys_GetObject("stdout");
- if (!f) {
- PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
- }
- return f;
-}
-
-static int __Pyx_PrintItem(PyObject *v) {
- PyObject *f;
-
- if (!(f = __Pyx_GetStdout()))
- return -1;
- if (PyFile_SoftSpace(f, 1)) {
- if (PyFile_WriteString(" ", f) < 0)
- return -1;
- }
- if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
- return -1;
- if (PyString_Check(v)) {
- char *s = PyString_AsString(v);
- int len = PyString_Size(v);
- if (len > 0 &&
- isspace(Py_CHARMASK(s[len-1])) &&
- s[len-1] != ' ')
- PyFile_SoftSpace(f, 0);
- }
- return 0;
-}
-
-static int __Pyx_PrintNewline(void) {
- PyObject *f;
-
- if (!(f = __Pyx_GetStdout()))
- return -1;
- if (PyFile_WriteString("\n", f) < 0)
- return -1;
- PyFile_SoftSpace(f, 0);
- return 0;
-}
-
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
- PyObject *result;
- result = PyObject_GetAttr(dict, name);
- if (!result)
- PyErr_SetObject(PyExc_NameError, name);
- return result;
-}
-
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
- while (t->p) {
- *t->p = PyString_InternFromString(t->s);
- if (!*t->p)
- return -1;
- ++t;
- }
- return 0;
-}
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
- while (t->p) {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- if (!*t->p)
- return -1;
- ++t;
- }
- return 0;
-}
-
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
- long size)
-{
- PyObject *py_module_name = 0;
- PyObject *py_class_name = 0;
- PyObject *py_name_list = 0;
- PyObject *py_module = 0;
- PyObject *result = 0;
-
- py_module_name = PyString_FromString(module_name);
- if (!py_module_name)
- goto bad;
- py_class_name = PyString_FromString(class_name);
- if (!py_class_name)
- goto bad;
- py_name_list = PyList_New(1);
- if (!py_name_list)
- goto bad;
- Py_INCREF(py_class_name);
- if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)
- goto bad;
- py_module = __Pyx_Import(py_module_name, py_name_list);
- if (!py_module)
- goto bad;
- result = PyObject_GetAttr(py_module, py_class_name);
- if (!result)
- goto bad;
- if (!PyType_Check(result)) {
- PyErr_Format(PyExc_TypeError,
- "%s.%s is not a type object",
- module_name, class_name);
- goto bad;
- }
- if (((PyTypeObject *)result)->tp_basicsize != size) {
- PyErr_Format(PyExc_ValueError,
- "%s.%s does not appear to be the correct type object",
- module_name, class_name);
- goto bad;
- }
- goto done;
-bad:
- Py_XDECREF(result);
- result = 0;
-done:
- Py_XDECREF(py_module_name);
- Py_XDECREF(py_class_name);
- Py_XDECREF(py_name_list);
- return (PyTypeObject *)result;
-}
-
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-
-static void __Pyx_AddTraceback(char *funcname) {
- PyObject *py_srcfile = 0;
- PyObject *py_funcname = 0;
- PyObject *py_globals = 0;
- PyObject *empty_tuple = 0;
- PyObject *empty_string = 0;
- PyCodeObject *py_code = 0;
- PyFrameObject *py_frame = 0;
-
- py_srcfile = PyString_FromString(__pyx_filename);
- if (!py_srcfile) goto bad;
- py_funcname = PyString_FromString(funcname);
- if (!py_funcname) goto bad;
- py_globals = PyModule_GetDict(__pyx_m);
- if (!py_globals) goto bad;
- empty_tuple = PyTuple_New(0);
- if (!empty_tuple) goto bad;
- empty_string = PyString_FromString("");
- if (!empty_string) goto bad;
- py_code = PyCode_New(
- 0, /*int argcount,*/
- 0, /*int nlocals,*/
- 0, /*int stacksize,*/
- 0, /*int flags,*/
- empty_string, /*PyObject *code,*/
- empty_tuple, /*PyObject *consts,*/
- empty_tuple, /*PyObject *names,*/
- empty_tuple, /*PyObject *varnames,*/
- empty_tuple, /*PyObject *freevars,*/
- empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- __pyx_lineno, /*int firstlineno,*/
- empty_string /*PyObject *lnotab*/
- );
- if (!py_code) goto bad;
- py_frame = PyFrame_New(
- PyThreadState_Get(), /*PyThreadState *tstate,*/
- py_code, /*PyCodeObject *code,*/
- py_globals, /*PyObject *globals,*/
- 0 /*PyObject *locals*/
- );
- if (!py_frame) goto bad;
- py_frame->f_lineno = __pyx_lineno;
- PyTraceBack_Here(py_frame);
-bad:
- Py_XDECREF(py_srcfile);
- Py_XDECREF(py_funcname);
- Py_XDECREF(empty_tuple);
- Py_XDECREF(empty_string);
- Py_XDECREF(py_code);
- Py_XDECREF(py_frame);
-}
diff --git a/numpy/doc/pyrex/numpyx.pyx b/numpy/doc/pyrex/numpyx.pyx
deleted file mode 100644
index 068d251f6..000000000
--- a/numpy/doc/pyrex/numpyx.pyx
+++ /dev/null
@@ -1,101 +0,0 @@
-# -*- Mode: Python -*- Not really, but close enough
-"""WARNING: this code is deprecated and slated for removal soon. See the
-doc/cython directory for the replacement, which uses Cython (the actively
-maintained version of Pyrex).
-"""
-
-cimport c_python
-cimport c_numpy
-import numpy
-
-# Numpy must be initialized
-c_numpy.import_array()
-
-def print_array_info(c_numpy.ndarray arr):
- cdef int i
-
- print '-='*10
- print 'printing array info for ndarray at 0x%0lx'%(<c_python.Py_intptr_t>arr,)
- print 'print number of dimensions:',arr.nd
- print 'address of strides: 0x%0lx'%(<c_python.Py_intptr_t>arr.strides,)
- print 'strides:'
- for i from 0<=i<arr.nd:
- # print each stride
- print ' stride %d:'%i,<c_python.Py_intptr_t>arr.strides[i]
- print 'memory dump:'
- print_elements( arr.data, arr.strides, arr.dimensions,
- arr.nd, sizeof(double), arr.dtype )
- print '-='*10
- print
-
-cdef print_elements(char *data,
- c_python.Py_intptr_t* strides,
- c_python.Py_intptr_t* dimensions,
- int nd,
- int elsize,
- object dtype):
- cdef c_python.Py_intptr_t i,j
- cdef void* elptr
-
- if dtype not in [numpy.dtype(numpy.object_),
- numpy.dtype(numpy.float64)]:
- print ' print_elements() not (yet) implemented for dtype %s'%dtype.name
- return
-
- if nd ==0:
- if dtype==numpy.dtype(numpy.object_):
- elptr = (<void**>data)[0] #[0] dereferences pointer in Pyrex
- print ' ',<object>elptr
- elif dtype==numpy.dtype(numpy.float64):
- print ' ',(<double*>data)[0]
- elif nd == 1:
- for i from 0<=i<dimensions[0]:
- if dtype==numpy.dtype(numpy.object_):
- elptr = (<void**>data)[0]
- print ' ',<object>elptr
- elif dtype==numpy.dtype(numpy.float64):
- print ' ',(<double*>data)[0]
- data = data + strides[0]
- else:
- for i from 0<=i<dimensions[0]:
- print_elements(data, strides+1, dimensions+1, nd-1, elsize, dtype)
- data = data + strides[0]
-
-def test_methods(c_numpy.ndarray arr):
- """Test a few attribute accesses for an array.
-
- This illustrates how the pyrex-visible object is in practice a strange
- hybrid of the C PyArrayObject struct and the python object. Some
- properties (like .nd) are visible here but not in python, while others
- like flags behave very differently: in python flags appears as a separate,
- object while here we see the raw int holding the bit pattern.
-
- This makes sense when we think of how pyrex resolves arr.foo: if foo is
- listed as a field in the c_numpy.ndarray struct description, it will be
- directly accessed as a C variable without going through Python at all.
- This is why for arr.flags, we see the actual int which holds all the flags
- as bit fields. However, for any other attribute not listed in the struct,
- it simply forwards the attribute lookup to python at runtime, just like
- python would (which means that AttributeError can be raised for
- non-existent attributes, for example)."""
-
- print 'arr.any() :',arr.any()
- print 'arr.nd :',arr.nd
- print 'arr.flags :',arr.flags
-
-def test():
- """this function is pure Python"""
- arr1 = numpy.array(-1e-30,dtype=numpy.float64)
- arr2 = numpy.array([1.0,2.0,3.0],dtype=numpy.float64)
-
- arr3 = numpy.arange(9,dtype=numpy.float64)
- arr3.shape = 3,3
-
- four = 4
- arr4 = numpy.array(['one','two',3,four],dtype=numpy.object_)
-
- arr5 = numpy.array([1,2,3]) # int types not (yet) supported by print_elements
-
- for arr in [arr1,arr2,arr3,arr4,arr5]:
- print_array_info(arr)
-
diff --git a/numpy/doc/pyrex/run_test.py b/numpy/doc/pyrex/run_test.py
deleted file mode 100755
index 96388011e..000000000
--- a/numpy/doc/pyrex/run_test.py
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env python
-from numpyx import test
-test()
diff --git a/numpy/doc/pyrex/setup.py b/numpy/doc/pyrex/setup.py
deleted file mode 100644
index 7f7cf0fc1..000000000
--- a/numpy/doc/pyrex/setup.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-"""
-WARNING: this code is deprecated and slated for removal soon. See the
-doc/cython directory for the replacement, which uses Cython (the actively
-maintained version of Pyrex).
-
-
-Install file for example on how to use Pyrex with Numpy.
-
-For more details, see:
-http://www.scipy.org/Cookbook/Pyrex_and_NumPy
-http://www.scipy.org/Cookbook/ArrayStruct_and_Pyrex
-"""
-
-from distutils.core import setup
-from distutils.extension import Extension
-
-# Make this usable by people who don't have pyrex installed (I've committed
-# the generated C sources to SVN).
-try:
- from Pyrex.Distutils import build_ext
- has_pyrex = True
-except ImportError:
- has_pyrex = False
-
-import numpy
-
-# Define a pyrex-based extension module, using the generated sources if pyrex
-# is not available.
-if has_pyrex:
- pyx_sources = ['numpyx.pyx']
- cmdclass = {'build_ext': build_ext}
-else:
- pyx_sources = ['numpyx.c']
- cmdclass = {}
-
-
-pyx_ext = Extension('numpyx',
- pyx_sources,
- include_dirs = [numpy.get_include()])
-
-# Call the routine which does the real work
-setup(name = 'numpyx',
- description = 'Small example on using Pyrex to write a Numpy extension',
- url = 'http://www.scipy.org/Cookbook/Pyrex_and_NumPy',
- ext_modules = [pyx_ext],
- cmdclass = cmdclass,
- )
diff --git a/numpy/doc/records.txt b/numpy/doc/records.txt
deleted file mode 100644
index 6c4824d41..000000000
--- a/numpy/doc/records.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-
-The ndarray supports records intrinsically. None of the default
-descriptors have fields defined, but you can create new descriptors
-easily. The ndarray even supports nested arrays of records inside of
-a record. Any record that the array protocol can describe can be
-represented. The ndarray also supports partial field descriptors.
-Not every byte has to be accounted for.
-
-This was done by adding to the established ``PyArray_Descr *`` structure:
-
-1. A PyObject ``*fields`` member which contains a dictionary of "field
- name" : (``PyArray_Descr`` ``*field-type``, ``offset``, [optional field
- title]). If a title is given, then it is also inserted into the
- dictionary and used to key the same entry.
-
-2. A byteorder member. By default this is '=' (native), or '|'
- (not-applicable).
-
-3. An additional ``PyArray_ArrDescr`` ``*member`` of the structure which
- contains a simple representation of an array of another base-type.
- types. The ``PyArray_ArrayDescr`` structure has members
- ``PyArray_Descr *``, ``PyObject *``, for holding a reference to
- the base-type and the shape of the sub-array.
-
-4. The ``PyArray_Descr *`` as official Python object that fully describes
- a region of memory for the data
-
-
-Data type conversions
----------------------
-
-We can support additional data-type
-conversions. The data-type passed in is converted to a
-``PyArray_Descr *`` object.
-
-New possibilities for the "data-type"
-`````````````````````````````````````
-
-**List [data-type 1, data-type 2, ..., data-type n]**
- Equivalent to {'names':['f1','f2',...,'fn'],
- 'formats': [data-type 1, data-type 2, ..., data-type n]}
-
- This is a quick way to specify a record format with default field names.
-
-
-**Tuple (flexible type, itemsize) (fixed type, shape)**
- Get converted to a new ``PyArray_Descr *`` object with a flexible
- type. The latter structure also sets the ``PyArray_ArrayDescr`` field of the
- returned ``PyArray_Descr *``.
-
-
-**Dictionary (keys "names", "titles", and "formats")**
- This will be converted to a ``PyArray_VOID`` type with corresponding
- fields parameter (the formats list will be converted to actual
- ``PyArray_Descr *`` objects).
-
-
-**Objects (anything with an .itemsize and .fields attribute)**
- If its an instance of (a sub-class of) void type, then a new
- ``PyArray_Descr*`` structure is created corresponding to its
- typeobject (and ``PyArray_VOID``) typenumber. If the type is
- registered, then the registered type-number is used.
-
- Otherwise a new ``PyArray_VOID PyArray_Descr*`` structure is created
- and filled ->elsize and ->fields filled in appropriately.
-
- The itemsize attribute must return a number > 0. The fields
- attribute must return a dictionary with at least "names" and
- "formats" entries. The "formats" entry will be converted to a
- "proper" descr->fields entry (all generic data-types converted to
- ``PyArray_Descr *`` structure).
-
-
-Reference counting for ``PyArray_Descr *`` objects.
-```````````````````````````````````````````````````
-
-Most functions that take ``PyArary_Descr *`` as arguments and return a
-``PyObject *`` steal the reference unless otherwise noted in the code:
-
-Functions that return ``PyArray_Descr *`` objects return a new
-reference.
-
-.. tip::
-
- There is a new function and a new method of array objects both labelled
- dtypescr which can be used to try out the ``PyArray_DescrConverter``.
-
diff --git a/numpy/doc/reference/__init__.py b/numpy/doc/reference/__init__.py
deleted file mode 100644
index 8664ea04d..000000000
--- a/numpy/doc/reference/__init__.py
+++ /dev/null
@@ -1,12 +0,0 @@
-import os
-
-ref_dir = os.path.join(os.path.dirname(__file__))
-
-__all__ = [f[:-3] for f in os.listdir(ref_dir) if f.endswith('.py') and
- not f.startswith('__')]
-__all__.sort()
-
-__doc__ = 'The following topics are available:\n' + \
- '\n - '.join([''] + __all__)
-
-__all__.extend(['__doc__'])
diff --git a/numpy/doc/reference/structured_arrays.py b/numpy/doc/structured_arrays.py
index 7bbd0deda..7bbd0deda 100644
--- a/numpy/doc/reference/structured_arrays.py
+++ b/numpy/doc/structured_arrays.py
diff --git a/numpy/doc/subclassing.py b/numpy/doc/subclassing.py
new file mode 100644
index 000000000..859ab32f9
--- /dev/null
+++ b/numpy/doc/subclassing.py
@@ -0,0 +1,291 @@
+"""
+=============================
+Subclassing ndarray in python
+=============================
+
+Credits
+-------
+
+This page is based with thanks on the wiki page on subclassing by Pierre
+Gerard-Marchant - http://www.scipy.org/Subclasses.
+
+Introduction
+------------
+Subclassing ndarray is relatively simple, but you will need to
+understand some behavior of ndarrays to understand some minor
+complications to subclassing. There are examples at the bottom of the
+page, but you will probably want to read the background to understand
+why subclassing works as it does.
+
+ndarrays and object creation
+============================
+The creation of ndarrays is complicated by the need to return views of
+ndarrays, that are also ndarrays. For example::
+
+ >>> import numpy as np
+ >>> arr = np.zeros((3,))
+ >>> type(arr)
+ <type 'numpy.ndarray'>
+ >>> v = arr[1:]
+ >>> type(v)
+ <type 'numpy.ndarray'>
+ >>> v is arr
+ False
+
+So, when we take a view (here a slice) from the ndarray, we return a
+new ndarray, that points to the data in the original. When we
+subclass ndarray, taking a view (such as a slice) needs to return an
+object of our own class. There is machinery to do this, but it is
+this machinery that makes subclassing slightly non-standard.
+
+To allow subclassing, and views of subclasses, ndarray uses the
+ndarray ``__new__`` method for the main work of object initialization,
+rather then the more usual ``__init__`` method.
+
+``__new__`` and ``__init__``
+============================
+
+``__new__`` is a standard python method, and, if present, is called
+before ``__init__`` when we create a class instance. Consider the
+following::
+
+ class C(object):
+ def __new__(cls, *args):
+ print 'Args in __new__:', args
+ return object.__new__(cls, *args)
+ def __init__(self, *args):
+ print 'Args in __init__:', args
+
+ C('hello')
+
+The code gives the following output::
+
+ cls is: <class '__main__.C'>
+ Args in __new__: ('hello',)
+ self is : <__main__.C object at 0xb7dc720c>
+ Args in __init__: ('hello',)
+
+When we call ``C('hello')``, the ``__new__`` method gets its own class
+as first argument, and the passed argument, which is the string
+``'hello'``. After python calls ``__new__``, it usually (see below)
+calls our ``__init__`` method, with the output of ``__new__`` as the
+first argument (now a class instance), and the passed arguments
+following.
+
+As you can see, the object can be initialized in the ``__new__``
+method or the ``__init__`` method, or both, and in fact ndarray does
+not have an ``__init__`` method, because all the initialization is
+done in the ``__new__`` method.
+
+Why use ``__new__`` rather than just the usual ``__init__``? Because
+in some cases, as for ndarray, we want to be able to return an object
+of some other class. Consider the following::
+
+ class C(object):
+ def __new__(cls, *args):
+ print 'cls is:', cls
+ print 'Args in __new__:', args
+ return object.__new__(cls, *args)
+ def __init__(self, *args):
+ print 'self is :', self
+ print 'Args in __init__:', args
+
+ class D(C):
+ def __new__(cls, *args):
+ print 'D cls is:', cls
+ print 'D args in __new__:', args
+ return C.__new__(C, *args)
+ def __init__(self, *args):
+ print 'D self is :', self
+ print 'D args in __init__:', args
+
+ D('hello')
+
+which gives::
+
+ D cls is: <class '__main__.D'>
+ D args in __new__: ('hello',)
+ cls is: <class '__main__.C'>
+ Args in __new__: ('hello',)
+
+The definition of ``C`` is the same as before, but for ``D``, the
+``__new__`` method returns an instance of class ``C`` rather than
+``D``. Note that the ``__init__`` method of ``D`` does not get
+called. In general, when the ``__new__`` method returns an object of
+class other than the class in which it is defined, the ``__init__``
+method of that class is not called.
+
+This is how subclasses of the ndarray class are able to return views
+that preserve the class type. When taking a view, the standard
+ndarray machinery creates the new ndarray object with something
+like::
+
+ obj = ndarray.__new__(subtype, shape, ...
+
+where ``subdtype`` is the subclass. Thus the returned view is of the
+same class as the subclass, rather than being of class ``ndarray``.
+
+That solves the problem of returning views of the same type, but now
+we have a new problem. The machinery of ndarray can set the class
+this way, in its standard methods for taking views, but the ndarray
+``__new__`` method knows nothing of what we have done in our own
+``__new__`` method in order to set attributes, and so on. (Aside -
+why not call ``obj = subdtype.__new__(...`` then? Because we may not
+have a ``__new__`` method with the same call signature).
+
+So, when creating a new view object of our subclass, we need to be
+able to set any extra attributes from the original object of our
+class. This is the role of the ``__array_finalize__`` method of
+ndarray. ``__array_finalize__`` is called from within the
+ndarray machinery, each time we create an ndarray of our own class,
+and passes in the new view object, created as above, as well as the
+old object from which the view has been taken. In it we can take any
+attributes from the old object and put then into the new view object,
+or do any other related processing. Now we are ready for a simple
+example.
+
+Simple example - adding an extra attribute to ndarray
+-----------------------------------------------------
+
+::
+ import numpy as np
+
+ class InfoArray(np.ndarray):
+
+ def __new__(subtype, shape, dtype=float, buffer=None, offset=0,
+ strides=None, order=None, info=None):
+ # Create the ndarray instance of our type, given the usual
+ # input arguments. This will call the standard ndarray
+ # constructor, but return an object of our type
+ obj = np.ndarray.__new__(subtype, shape, dtype, buffer, offset, strides,
+ order)
+ # add the new attribute to the created instance
+ obj.info = info
+ # Finally, we must return the newly created object:
+ return obj
+
+ def __array_finalize__(self,obj):
+ # reset the attribute from passed original object
+ self.info = getattr(obj, 'info', None)
+ # We do not need to return anything
+
+ obj = InfoArray(shape=(3,), info='information')
+ print type(obj)
+ print obj.info
+ v = obj[1:]
+ print type(v)
+ print v.info
+
+which gives::
+
+ <class '__main__.InfoArray'>
+ information
+ <class '__main__.InfoArray'>
+ information
+
+This class isn't very useful, because it has the same constructor as
+the bare ndarray object, including passing in buffers and shapes and
+so on. We would probably prefer to be able to take an already formed
+ndarray from the usual numpy calls to ``np.array`` and return an
+object.
+
+Slightly more realistic example - attribute added to existing array
+-------------------------------------------------------------------
+Here is a class (with thanks to Pierre GM for the original example),
+that takes array that already exists, casts as our type, and adds an
+extra attribute::
+
+ import numpy as np
+
+ class RealisticInfoArray(np.ndarray):
+
+ def __new__(cls, input_array, info=None):
+ # Input array is an already formed ndarray instance
+ # We first cast to be our class type
+ obj = np.asarray(input_array).view(cls)
+ # add the new attribute to the created instance
+ obj.info = info
+ # Finally, we must return the newly created object:
+ return obj
+
+ def __array_finalize__(self,obj):
+ # reset the attribute from passed original object
+ self.info = getattr(obj, 'info', None)
+ # We do not need to return anything
+
+ arr = np.arange(5)
+ obj = RealisticInfoArray(arr, info='information')
+ print type(obj)
+ print obj.info
+ v = obj[1:]
+ print type(v)
+ print v.info
+
+which gives::
+
+ <class '__main__.RealisticInfoArray'>
+ information
+ <class '__main__.RealisticInfoArray'>
+ information
+
+``__array_wrap__`` for ufuncs
+-----------------------------
+
+Let's say you have an instance ``obj`` of your new subclass,
+``RealisticInfoArray``, and you pass it into a ufunc with another
+array::
+
+ arr = np.arange(5)
+ ret = np.multiply.outer(arr, obj)
+
+When a numpy ufunc is called on a subclass of ndarray, the
+__array_wrap__ method is called to transform the result into a new
+instance of the subclass. By default, __array_wrap__ will call
+__array_finalize__, and the attributes will be inherited.
+
+By defining a specific __array_wrap__ method for our subclass, we can
+tweak the output. The __array_wrap__ method requires one argument, the
+object on which the ufunc is applied, and an optional parameter
+*context*. This parameter is returned by some ufuncs as a 3-element
+tuple: (name of the ufunc, argument of the ufunc, domain of the
+ufunc). See the masked array subclass for an implementation.
+
+Extra gotchas - custom __del__ methods and ndarray.base
+-------------------------------------------------------
+One of the problems that ndarray solves is that of memory ownership of
+ndarrays and their views. Consider the case where we have created an
+ndarray, ``arr`` and then taken a view with ``v = arr[1:]``. If we
+then do ``del v``, we need to make sure that the ``del`` does not
+delete the memory pointed to by the view, because we still need it for
+the original ``arr`` object. Numpy therefore keeps track of where the
+data came from for a particular array or view, with the ``base`` attribute::
+
+ import numpy as np
+
+ # A normal ndarray, that owns its own data
+ arr = np.zeros((4,))
+ # In this case, base is None
+ assert arr.base is None
+ # We take a view
+ v1 = arr[1:]
+ # base now points to the array that it derived from
+ assert v1.base is arr
+ # Take a view of a view
+ v2 = v1[1:]
+ # base points to the view it derived from
+ assert v2.base is v1
+
+The assertions all succeed in this case. In general, if the array
+owns its own memory, as for ``arr`` in this case, then ``arr.base``
+will be None - there are some exceptions to this - see the numpy book
+for more details.
+
+The ``base`` attribute is useful in being able to tell whether we have
+a view or the original array. This in turn can be useful if we need
+to know whether or not to do some specific cleanup when the subclassed
+array is deleted. For example, we may only want to do the cleanup if
+the original array is deleted, but not the views. For an example of
+how this can work, have a look at the ``memmap`` class in
+``numpy.core``.
+
+"""
diff --git a/numpy/doc/swig/Makefile b/numpy/doc/swig/Makefile
deleted file mode 100644
index b64492f45..000000000
--- a/numpy/doc/swig/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# List all of the subdirectories here for recursive make
-SUBDIRS = test doc
-
-# Default target
-.PHONY : default
-default:
- @echo "There is no default make target for this Makefile"
- @echo "Valid make targets are:"
- @echo " test - Compile and run tests of numpy.i"
- @echo " doc - Generate numpy.i documentation"
- @echo " all - make test + doc"
- @echo " clean - Remove generated files recursively"
-
-# Target all
-.PHONY : all
-all: $(SUBDIRS)
-
-# Target test
-.PHONY : test
-test:
- cd $@ && make $@
-
-# Target doc
-.PHONY : doc
-doc:
- cd $@ && make
-
-# Target clean
-.PHONY : clean
-clean:
- @for dir in $(SUBDIRS); do \
- echo ; \
- echo Running \'make clean\' in $$dir; \
- cd $$dir && make clean && cd ..; \
- done; \
- echo
diff --git a/numpy/doc/swig/README b/numpy/doc/swig/README
deleted file mode 100644
index d557b305f..000000000
--- a/numpy/doc/swig/README
+++ /dev/null
@@ -1,130 +0,0 @@
-Notes for the numpy/doc/swig directory
-======================================
-
-This set of files is for developing and testing file numpy.i, which is
-intended to be a set of typemaps for helping SWIG interface between C
-and C++ code that uses C arrays and the python module NumPy. It is
-ultimately hoped that numpy.i will be included as part of the SWIG
-distribution.
-
-Documentation
--------------
-Documentation for how to use numpy.i is in the doc directory. The
-primary source file here is numpy_swig.txt, a restructured text file
-that documents how to use numpy.i. The Makefile in doc allows for the
-conversion of numpy_swig.txt to HTML (if you have docutils installed)
-and to PDF (if you have docutils and latex/pdftex installed). This
-should not be necessary, however, as numpy_swig.html and
-numpy_swig.pdf are stored in the repository.
-
-The same is true for a file called doc/testing.txt, which describes
-the testing system used here.
-
-If you have the prerequisites installed and wish to build the HTML and
-PDF documentation, this can be achieved by calling::
-
- $ make doc
-
-from the shell.
-
-Testing
--------
-The tests are a good example of what we are trying to do with numpy.i.
-The files related to testing are are in the test subdirectory::
-
- Vector.h
- Vector.cxx
- Vector.i
- testVector.py
-
- Matrix.h
- Matrix.cxx
- Matrix.i
- testMatrix.py
-
- Tensor.h
- Tensor.cxx
- Tensor.i
- testTensor.py
-
-The header files contain prototypes for functions that illustrate the
-wrapping issues we wish to address. Right now, this consists of
-functions with argument signatures of the following forms. Vector.h::
-
- (type IN_ARRAY1[ANY])
- (type* IN_ARRAY1, int DIM1)
- (int DIM1, type* IN_ARRAY1)
-
- (type INPLACE_ARRAY1[ANY])
- (type* INPLACE_ARRAY1, int DIM1)
- (int DIM1, type* INPLACE_ARRAY1)
-
- (type ARGOUT_ARRAY1[ANY])
- (type* ARGOUT_ARRAY1, int DIM1)
- (int DIM1, type* ARGOUT_ARRAY1)
-
-Matrix.h::
-
- (type IN_ARRAY2[ANY][ANY])
- (type* IN_ARRAY2, int DIM1, int DIM2)
- (int DIM1, int DIM2, type* IN_ARRAY2)
-
- (type INPLACE_ARRAY2[ANY][ANY])
- (type* INPLACE_ARRAY2, int DIM1, int DIM2)
- (int DIM1, int DIM2, type* INPLACE_ARRAY2)
-
- (type ARGOUT_ARRAY2[ANY][ANY])
-
-Tensor.h::
-
- (type IN_ARRAY3[ANY][ANY][ANY])
- (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3)
- (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3)
-
- (type INPLACE_ARRAY3[ANY][ANY][ANY])
- (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3)
- (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3)
-
- (type ARGOUT_ARRAY3[ANY][ANY][ANY])
-
-These function signatures take a pointer to an array of type "type",
-whose length is specified by the integer(s) DIM1 (and DIM2, and DIM3).
-
-The objective for the IN_ARRAY signatures is for SWIG to generate
-python wrappers that take a container that constitutes a valid
-argument to the numpy array constructor, and can be used to build an
-array of type "type". Currently, types "signed char", "unsigned
-char", "short", "unsigned short", "int", "unsigned int", "long",
-"unsigned long", "long long", "unsigned long long", "float", and
-"double" are supported and tested.
-
-The objective for the INPLACE_ARRAY signatures is for SWIG to generate
-python wrappers that accept a numpy array of any of the above-listed
-types.
-
-The source files Vector.cxx, Matrix.cxx and Tensor.cxx contain the
-actual implementations of the functions described in Vector.h,
-Matrix.h and Tensor.h. The python scripts testVector.py,
-testMatrix.py and testTensor.py test the resulting python wrappers
-using the unittest module.
-
-The SWIG interface files Vector.i, Matrix.i and Tensor.i are used to
-generate the wrapper code. The SWIG_FILE_WITH_INIT macro allows
-numpy.i to be used with multiple python modules. If it is specified,
-then the %init block found in Vector.i, Matrix.i and Tensor.i are
-required. The other things done in Vector.i, Matrix.i and Tensor.i
-are the inclusion of the appropriate header file and numpy.i file, and
-the "%apply" directives to force the functions to use the typemaps.
-
-The setup.py script is a standard python distutils script. It defines
-_Vector, _Matrix and _Tensor extension modules and Vector, Matrix and
-Tensor python modules. The Makefile automates everything, setting up
-the dependencies, calling swig to generate the wrappers, and calling
-setup.py to compile the wrapper code and generate the shared objects.
-Targets "all" (default), "test", "doc" and "clean" are supported. The
-"doc" target creates HTML documentation (with make target "html"), and
-PDF documentation (with make targets "tex" and "pdf").
-
-To build and run the test code, simply execute from the shell::
-
- $ make test
diff --git a/numpy/doc/swig/doc/Makefile b/numpy/doc/swig/doc/Makefile
deleted file mode 100644
index 9223f0481..000000000
--- a/numpy/doc/swig/doc/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-# ReStructured Text
-RST2HTML = rst2html.py
-RST2LATEX = rst2latex.py
-RFLAGS = --generator --time
-HTML_FLAGS = --no-xml-declaration
-LATEX_FLAGS =
-LATEX = pdflatex
-
-# Web pages that need to be made
-WEB_PAGES = numpy_swig.html testing.html
-
-# LaTeX files that need to be made
-LATEX_FILES = numpy_swig.tex testing.tex
-
-# PDF files that need to be made
-PDF_FILES = numpy_swig.pdf testing.pdf
-
-# Default target: documentation
-.PHONY : doc
-doc: html pdf
-
-# HTML target
-.PHONY : html
-html: $(WEB_PAGES)
-
-# Rule: %.txt -> %.html
-%.html: %.txt
- $(RST2HTML) $(RFLAGS) $(HTML_FLAGS) $< $@
-
-# LaTeX target
-.PHONY : tex
-tex: $(LATEX_FILES)
-
-# Rule: %.txt -> %.tex
-%.tex: %.txt
- $(RST2LATEX) $(RFLAGS) $(LATEX_FLAGS) $< $@
-
-# PDF target
-.PHONY : pdf
-pdf: $(PDF_FILES)
-
-# Rule: %.tex -> %.pdf
-%.pdf: %.tex
- $(LATEX) $<
- $(LATEX) $<
-
-# Clean target
-.PHONY : clean
-clean:
- $(RM) $(LATEX_FILES)
- $(RM) *.pyc *.aux *.dvi *.log *.out *~
diff --git a/numpy/doc/swig/doc/numpy_swig.html b/numpy/doc/swig/doc/numpy_swig.html
deleted file mode 100644
index ed127f330..000000000
--- a/numpy/doc/swig/doc/numpy_swig.html
+++ /dev/null
@@ -1,1244 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
-<title>numpy.i: a SWIG Interface File for NumPy</title>
-<meta name="author" content="Bill Spotz" />
-<meta name="date" content="1 December, 2007" />
-<style type="text/css">
-
-/*
-:Author: David Goodger
-:Contact: goodger@users.sourceforge.net
-:Date: $Date: 2005-12-18 01:56:14 +0100 (Sun, 18 Dec 2005) $
-:Revision: $Revision: 4224 $
-:Copyright: This stylesheet has been placed in the public domain.
-
-Default cascading style sheet for the HTML output of Docutils.
-
-See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
-customize this style sheet.
-*/
-
-/* used to remove borders from tables and images */
-.borderless, table.borderless td, table.borderless th {
- border: 0 }
-
-table.borderless td, table.borderless th {
- /* Override padding for "table.docutils td" with "! important".
- The right padding separates the table cells. */
- padding: 0 0.5em 0 0 ! important }
-
-.first {
- /* Override more specific margin styles with "! important". */
- margin-top: 0 ! important }
-
-.last, .with-subtitle {
- margin-bottom: 0 ! important }
-
-.hidden {
- display: none }
-
-a.toc-backref {
- text-decoration: none ;
- color: black }
-
-blockquote.epigraph {
- margin: 2em 5em ; }
-
-dl.docutils dd {
- margin-bottom: 0.5em }
-
-/* Uncomment (and remove this text!) to get bold-faced definition list terms
-dl.docutils dt {
- font-weight: bold }
-*/
-
-div.abstract {
- margin: 2em 5em }
-
-div.abstract p.topic-title {
- font-weight: bold ;
- text-align: center }
-
-div.admonition, div.attention, div.caution, div.danger, div.error,
-div.hint, div.important, div.note, div.tip, div.warning {
- margin: 2em ;
- border: medium outset ;
- padding: 1em }
-
-div.admonition p.admonition-title, div.hint p.admonition-title,
-div.important p.admonition-title, div.note p.admonition-title,
-div.tip p.admonition-title {
- font-weight: bold ;
- font-family: sans-serif }
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
- color: red ;
- font-weight: bold ;
- font-family: sans-serif }
-
-/* Uncomment (and remove this text!) to get reduced vertical space in
- compound paragraphs.
-div.compound .compound-first, div.compound .compound-middle {
- margin-bottom: 0.5em }
-
-div.compound .compound-last, div.compound .compound-middle {
- margin-top: 0.5em }
-*/
-
-div.dedication {
- margin: 2em 5em ;
- text-align: center ;
- font-style: italic }
-
-div.dedication p.topic-title {
- font-weight: bold ;
- font-style: normal }
-
-div.figure {
- margin-left: 2em ;
- margin-right: 2em }
-
-div.footer, div.header {
- clear: both;
- font-size: smaller }
-
-div.line-block {
- display: block ;
- margin-top: 1em ;
- margin-bottom: 1em }
-
-div.line-block div.line-block {
- margin-top: 0 ;
- margin-bottom: 0 ;
- margin-left: 1.5em }
-
-div.sidebar {
- margin-left: 1em ;
- border: medium outset ;
- padding: 1em ;
- background-color: #ffffee ;
- width: 40% ;
- float: right ;
- clear: right }
-
-div.sidebar p.rubric {
- font-family: sans-serif ;
- font-size: medium }
-
-div.system-messages {
- margin: 5em }
-
-div.system-messages h1 {
- color: red }
-
-div.system-message {
- border: medium outset ;
- padding: 1em }
-
-div.system-message p.system-message-title {
- color: red ;
- font-weight: bold }
-
-div.topic {
- margin: 2em }
-
-h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
-h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
- margin-top: 0.4em }
-
-h1.title {
- text-align: center }
-
-h2.subtitle {
- text-align: center }
-
-hr.docutils {
- width: 75% }
-
-img.align-left {
- clear: left }
-
-img.align-right {
- clear: right }
-
-ol.simple, ul.simple {
- margin-bottom: 1em }
-
-ol.arabic {
- list-style: decimal }
-
-ol.loweralpha {
- list-style: lower-alpha }
-
-ol.upperalpha {
- list-style: upper-alpha }
-
-ol.lowerroman {
- list-style: lower-roman }
-
-ol.upperroman {
- list-style: upper-roman }
-
-p.attribution {
- text-align: right ;
- margin-left: 50% }
-
-p.caption {
- font-style: italic }
-
-p.credits {
- font-style: italic ;
- font-size: smaller }
-
-p.label {
- white-space: nowrap }
-
-p.rubric {
- font-weight: bold ;
- font-size: larger ;
- color: maroon ;
- text-align: center }
-
-p.sidebar-title {
- font-family: sans-serif ;
- font-weight: bold ;
- font-size: larger }
-
-p.sidebar-subtitle {
- font-family: sans-serif ;
- font-weight: bold }
-
-p.topic-title {
- font-weight: bold }
-
-pre.address {
- margin-bottom: 0 ;
- margin-top: 0 ;
- font-family: serif ;
- font-size: 100% }
-
-pre.literal-block, pre.doctest-block {
- margin-left: 2em ;
- margin-right: 2em ;
- background-color: #eeeeee }
-
-span.classifier {
- font-family: sans-serif ;
- font-style: oblique }
-
-span.classifier-delimiter {
- font-family: sans-serif ;
- font-weight: bold }
-
-span.interpreted {
- font-family: sans-serif }
-
-span.option {
- white-space: nowrap }
-
-span.pre {
- white-space: pre }
-
-span.problematic {
- color: red }
-
-span.section-subtitle {
- /* font-size relative to parent (h1..h6 element) */
- font-size: 80% }
-
-table.citation {
- border-left: solid 1px gray;
- margin-left: 1px }
-
-table.docinfo {
- margin: 2em 4em }
-
-table.docutils {
- margin-top: 0.5em ;
- margin-bottom: 0.5em }
-
-table.footnote {
- border-left: solid 1px black;
- margin-left: 1px }
-
-table.docutils td, table.docutils th,
-table.docinfo td, table.docinfo th {
- padding-left: 0.5em ;
- padding-right: 0.5em ;
- vertical-align: top }
-
-table.docutils th.field-name, table.docinfo th.docinfo-name {
- font-weight: bold ;
- text-align: left ;
- white-space: nowrap ;
- padding-left: 0 }
-
-h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
-h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
- font-size: 100% }
-
-tt.docutils {
- background-color: #eeeeee }
-
-ul.auto-toc {
- list-style-type: none }
-
-</style>
-</head>
-<body>
-<div class="document" id="numpy-i-a-swig-interface-file-for-numpy">
-<h1 class="title">numpy.i: a SWIG Interface File for NumPy</h1>
-<table class="docinfo" frame="void" rules="none">
-<col class="docinfo-name" />
-<col class="docinfo-content" />
-<tbody valign="top">
-<tr><th class="docinfo-name">Author:</th>
-<td>Bill Spotz</td></tr>
-<tr class="field"><th class="docinfo-name">Institution:</th><td class="field-body">Sandia National Laboratories</td>
-</tr>
-<tr><th class="docinfo-name">Date:</th>
-<td>1 December, 2007</td></tr>
-</tbody>
-</table>
-<div class="contents topic">
-<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
-<ul class="simple">
-<li><a class="reference" href="#introduction" id="id1" name="id1">Introduction</a></li>
-<li><a class="reference" href="#using-numpy-i" id="id2" name="id2">Using numpy.i</a></li>
-<li><a class="reference" href="#available-typemaps" id="id3" name="id3">Available Typemaps</a><ul>
-<li><a class="reference" href="#input-arrays" id="id4" name="id4">Input Arrays</a></li>
-<li><a class="reference" href="#in-place-arrays" id="id5" name="id5">In-Place Arrays</a></li>
-<li><a class="reference" href="#argout-arrays" id="id6" name="id6">Argout Arrays</a></li>
-<li><a class="reference" href="#argoutview-arrays" id="id7" name="id7">Argoutview Arrays</a></li>
-<li><a class="reference" href="#output-arrays" id="id8" name="id8">Output Arrays</a></li>
-<li><a class="reference" href="#other-common-types-bool" id="id9" name="id9">Other Common Types: bool</a></li>
-<li><a class="reference" href="#other-common-types-complex" id="id10" name="id10">Other Common Types: complex</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#numpy-array-scalars-and-swig" id="id11" name="id11">NumPy Array Scalars and SWIG</a><ul>
-<li><a class="reference" href="#why-is-there-a-second-file" id="id12" name="id12">Why is There a Second File?</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#helper-functions" id="id13" name="id13">Helper Functions</a><ul>
-<li><a class="reference" href="#macros" id="id14" name="id14">Macros</a></li>
-<li><a class="reference" href="#routines" id="id15" name="id15">Routines</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#beyond-the-provided-typemaps" id="id16" name="id16">Beyond the Provided Typemaps</a><ul>
-<li><a class="reference" href="#a-common-example" id="id17" name="id17">A Common Example</a></li>
-<li><a class="reference" href="#other-situations" id="id18" name="id18">Other Situations</a></li>
-<li><a class="reference" href="#a-final-note" id="id19" name="id19">A Final Note</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#summary" id="id20" name="id20">Summary</a></li>
-<li><a class="reference" href="#acknowledgements" id="id21" name="id21">Acknowledgements</a></li>
-</ul>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id1" id="introduction" name="introduction">Introduction</a></h1>
-<p>The Simple Wrapper and Interface Generator (or <a class="reference" href="http://www.swig.org">SWIG</a>) is a powerful tool for generating wrapper
-code for interfacing to a wide variety of scripting languages.
-<a class="reference" href="http://www.swig.org">SWIG</a> can parse header files, and using only the code prototypes,
-create an interface to the target language. But <a class="reference" href="http://www.swig.org">SWIG</a> is not
-omnipotent. For example, it cannot know from the prototype:</p>
-<pre class="literal-block">
-double rms(double* seq, int n);
-</pre>
-<p>what exactly <tt class="docutils literal"><span class="pre">seq</span></tt> is. Is it a single value to be altered in-place?
-Is it an array, and if so what is its length? Is it input-only?
-Output-only? Input-output? <a class="reference" href="http://www.swig.org">SWIG</a> cannot determine these details,
-and does not attempt to do so.</p>
-<p>If we designed <tt class="docutils literal"><span class="pre">rms</span></tt>, we probably made it a routine that takes an
-input-only array of length <tt class="docutils literal"><span class="pre">n</span></tt> of <tt class="docutils literal"><span class="pre">double</span></tt> values called <tt class="docutils literal"><span class="pre">seq</span></tt>
-and returns the root mean square. The default behavior of <a class="reference" href="http://www.swig.org">SWIG</a>,
-however, will be to create a wrapper function that compiles, but is
-nearly impossible to use from the scripting language in the way the C
-routine was intended.</p>
-<p>For <a class="reference" href="http://www.python.org">python</a>, the preferred way of handling
-contiguous (or technically, <em>strided</em>) blocks of homogeneous data is
-with the module <a class="reference" href="http://numpy.scipy.org">NumPy</a>, which provides full
-object-oriented access to multidimensial arrays of data. Therefore,
-the most logical <a class="reference" href="http://www.python.org">python</a> interface for the <tt class="docutils literal"><span class="pre">rms</span></tt> function would be
-(including doc string):</p>
-<pre class="literal-block">
-def rms(seq):
- &quot;&quot;&quot;
- rms: return the root mean square of a sequence
- rms(numpy.ndarray) -&gt; double
- rms(list) -&gt; double
- rms(tuple) -&gt; double
- &quot;&quot;&quot;
-</pre>
-<p>where <tt class="docutils literal"><span class="pre">seq</span></tt> would be a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array of <tt class="docutils literal"><span class="pre">double</span></tt> values, and its
-length <tt class="docutils literal"><span class="pre">n</span></tt> would be extracted from <tt class="docutils literal"><span class="pre">seq</span></tt> internally before being
-passed to the C routine. Even better, since <a class="reference" href="http://numpy.scipy.org">NumPy</a> supports
-construction of arrays from arbitrary <a class="reference" href="http://www.python.org">python</a> sequences, <tt class="docutils literal"><span class="pre">seq</span></tt>
-itself could be a nearly arbitrary sequence (so long as each element
-can be converted to a <tt class="docutils literal"><span class="pre">double</span></tt>) and the wrapper code would
-internally convert it to a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array before extracting its data
-and length.</p>
-<p><a class="reference" href="http://www.swig.org">SWIG</a> allows these types of conversions to be defined via a
-mechanism called typemaps. This document provides information on how
-to use <tt class="docutils literal"><span class="pre">numpy.i</span></tt>, a <a class="reference" href="http://www.swig.org">SWIG</a> interface file that defines a series of
-typemaps intended to make the type of array-related conversions
-described above relatively simple to implement. For example, suppose
-that the <tt class="docutils literal"><span class="pre">rms</span></tt> function prototype defined above was in a header file
-named <tt class="docutils literal"><span class="pre">rms.h</span></tt>. To obtain the <a class="reference" href="http://www.python.org">python</a> interface discussed above,
-your <a class="reference" href="http://www.swig.org">SWIG</a> interface file would need the following:</p>
-<pre class="literal-block">
-%{
-#define SWIG_FILE_WITH_INIT
-#include &quot;rms.h&quot;
-%}
-
-%include &quot;numpy.i&quot;
-
-%init %{
-import_array();
-%}
-
-%apply (double* IN_ARRAY1, int DIM1) {(double* seq, int n)};
-%include &quot;rms.h&quot;
-</pre>
-<p>Typemaps are keyed off a list of one or more function arguments,
-either by type or by type and name. We will refer to such lists as
-<em>signatures</em>. One of the many typemaps defined by <tt class="docutils literal"><span class="pre">numpy.i</span></tt> is used
-above and has the signature <tt class="docutils literal"><span class="pre">(double*</span> <span class="pre">IN_ARRAY1,</span> <span class="pre">int</span> <span class="pre">DIM1)</span></tt>. The
-argument names are intended to suggest that the <tt class="docutils literal"><span class="pre">double*</span></tt> argument
-is an input array of one dimension and that the <tt class="docutils literal"><span class="pre">int</span></tt> represents
-that dimension. This is precisely the pattern in the <tt class="docutils literal"><span class="pre">rms</span></tt>
-prototype.</p>
-<p>Most likely, no actual prototypes to be wrapped will have the argument
-names <tt class="docutils literal"><span class="pre">IN_ARRAY1</span></tt> and <tt class="docutils literal"><span class="pre">DIM1</span></tt>. We use the <tt class="docutils literal"><span class="pre">%apply</span></tt> directive to
-apply the typemap for one-dimensional input arrays of type <tt class="docutils literal"><span class="pre">double</span></tt>
-to the actual prototype used by <tt class="docutils literal"><span class="pre">rms</span></tt>. Using <tt class="docutils literal"><span class="pre">numpy.i</span></tt>
-effectively, therefore, requires knowing what typemaps are available
-and what they do.</p>
-<p>A <a class="reference" href="http://www.swig.org">SWIG</a> interface file that includes the <a class="reference" href="http://www.swig.org">SWIG</a> directives given
-above will produce wrapper code that looks something like:</p>
-<pre class="literal-block">
- 1 PyObject *_wrap_rms(PyObject *args) {
- 2 PyObject *resultobj = 0;
- 3 double *arg1 = (double *) 0 ;
- 4 int arg2 ;
- 5 double result;
- 6 PyArrayObject *array1 = NULL ;
- 7 int is_new_object1 = 0 ;
- 8 PyObject * obj0 = 0 ;
- 9
-10 if (!PyArg_ParseTuple(args,(char *)&quot;O:rms&quot;,&amp;obj0)) SWIG_fail;
-11 {
-12 array1 = obj_to_array_contiguous_allow_conversion(
-13 obj0, NPY_DOUBLE, &amp;is_new_object1);
-14 npy_intp size[1] = {
-15 -1
-16 };
-17 if (!array1 || !require_dimensions(array1, 1) ||
-18 !require_size(array1, size, 1)) SWIG_fail;
-19 arg1 = (double*) array1-&gt;data;
-20 arg2 = (int) array1-&gt;dimensions[0];
-21 }
-22 result = (double)rms(arg1,arg2);
-23 resultobj = SWIG_From_double((double)(result));
-24 {
-25 if (is_new_object1 &amp;&amp; array1) Py_DECREF(array1);
-26 }
-27 return resultobj;
-28 fail:
-29 {
-30 if (is_new_object1 &amp;&amp; array1) Py_DECREF(array1);
-31 }
-32 return NULL;
-33 }
-</pre>
-<p>The typemaps from <tt class="docutils literal"><span class="pre">numpy.i</span></tt> are responsible for the following lines
-of code: 12--20, 25 and 30. Line 10 parses the input to the <tt class="docutils literal"><span class="pre">rms</span></tt>
-function. From the format string <tt class="docutils literal"><span class="pre">&quot;O:rms&quot;</span></tt>, we can see that the
-argument list is expected to be a single <a class="reference" href="http://www.python.org">python</a> object (specified
-by the <tt class="docutils literal"><span class="pre">O</span></tt> before the colon) and whose pointer is stored in
-<tt class="docutils literal"><span class="pre">obj0</span></tt>. A number of functions, supplied by <tt class="docutils literal"><span class="pre">numpy.i</span></tt>, are called
-to make and check the (possible) conversion from a generic <a class="reference" href="http://www.python.org">python</a>
-object to a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array. These functions are explained in the
-section <a class="reference" href="#helper-functions">Helper Functions</a>, but hopefully their names are
-self-explanatory. At line 12 we use <tt class="docutils literal"><span class="pre">obj0</span></tt> to construct a <a class="reference" href="http://numpy.scipy.org">NumPy</a>
-array. At line 17, we check the validity of the result: that it is
-non-null and that it has a single dimension of arbitrary length. Once
-these states are verified, we extract the data buffer and length in
-lines 19 and 20 so that we can call the underlying C function at line
-22. Line 25 performs memory management for the case where we have
-created a new array that is no longer needed.</p>
-<p>This code has a significant amount of error handling. Note the
-<tt class="docutils literal"><span class="pre">SWIG_fail</span></tt> is a macro for <tt class="docutils literal"><span class="pre">goto</span> <span class="pre">fail</span></tt>, refering to the label at
-line 28. If the user provides the wrong number of arguments, this
-will be caught at line 10. If construction of the <a class="reference" href="http://numpy.scipy.org">NumPy</a> array
-fails or produces an array with the wrong number of dimensions, these
-errors are caught at line 17. And finally, if an error is detected,
-memory is still managed correctly at line 30.</p>
-<p>Note that if the C function signature was in a different order:</p>
-<pre class="literal-block">
-double rms(int n, double* seq);
-</pre>
-<p>that <a class="reference" href="http://www.swig.org">SWIG</a> would not match the typemap signature given above with
-the argument list for <tt class="docutils literal"><span class="pre">rms</span></tt>. Fortunately, <tt class="docutils literal"><span class="pre">numpy.i</span></tt> has a set of
-typemaps with the data pointer given last:</p>
-<pre class="literal-block">
-%apply (int DIM1, double* IN_ARRAY1) {(int n, double* seq)};
-</pre>
-<p>This simply has the effect of switching the definitions of <tt class="docutils literal"><span class="pre">arg1</span></tt>
-and <tt class="docutils literal"><span class="pre">arg2</span></tt> in lines 3 and 4 of the generated code above, and their
-assignments in lines 19 and 20.</p>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id2" id="using-numpy-i" name="using-numpy-i">Using numpy.i</a></h1>
-<p>The <tt class="docutils literal"><span class="pre">numpy.i</span></tt> file is currently located in the <tt class="docutils literal"><span class="pre">numpy/docs/swig</span></tt>
-sub-directory under the <tt class="docutils literal"><span class="pre">numpy</span></tt> installation directory. Typically,
-you will want to copy it to the directory where you are developing
-your wrappers. If it is ever adopted by <a class="reference" href="http://www.swig.org">SWIG</a> developers, then it
-will be installed in a standard place where <a class="reference" href="http://www.swig.org">SWIG</a> can find it.</p>
-<p>A simple module that only uses a single <a class="reference" href="http://www.swig.org">SWIG</a> interface file should
-include the following:</p>
-<pre class="literal-block">
-%{
-#define SWIG_FILE_WITH_INIT
-%}
-%include &quot;numpy.i&quot;
-%init %{
-import_array();
-%}
-</pre>
-<p>Within a compiled <a class="reference" href="http://www.python.org">python</a> module, <tt class="docutils literal"><span class="pre">import_array()</span></tt> should only get
-called once. This could be in a C/C++ file that you have written and
-is linked to the module. If this is the case, then none of your
-interface files should <tt class="docutils literal"><span class="pre">#define</span> <span class="pre">SWIG_FILE_WITH_INIT</span></tt> or call
-<tt class="docutils literal"><span class="pre">import_array()</span></tt>. Or, this initialization call could be in a
-wrapper file generated by <a class="reference" href="http://www.swig.org">SWIG</a> from an interface file that has the
-<tt class="docutils literal"><span class="pre">%init</span></tt> block as above. If this is the case, and you have more than
-one <a class="reference" href="http://www.swig.org">SWIG</a> interface file, then only one interface file should
-<tt class="docutils literal"><span class="pre">#define</span> <span class="pre">SWIG_FILE_WITH_INIT</span></tt> and call <tt class="docutils literal"><span class="pre">import_array()</span></tt>.</p>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id3" id="available-typemaps" name="available-typemaps">Available Typemaps</a></h1>
-<p>The typemap directives provided by <tt class="docutils literal"><span class="pre">numpy.i</span></tt> for arrays of different
-data types, say <tt class="docutils literal"><span class="pre">double</span></tt> and <tt class="docutils literal"><span class="pre">int</span></tt>, and dimensions of different
-types, say <tt class="docutils literal"><span class="pre">int</span></tt> or <tt class="docutils literal"><span class="pre">long</span></tt>, are identical to one another except
-for the C and <a class="reference" href="http://numpy.scipy.org">NumPy</a> type specifications. The typemaps are
-therefore implemented (typically behind the scenes) via a macro:</p>
-<pre class="literal-block">
-%numpy_typemaps(DATA_TYPE, DATA_TYPECODE, DIM_TYPE)
-</pre>
-<p>that can be invoked for appropriate <tt class="docutils literal"><span class="pre">(DATA_TYPE,</span> <span class="pre">DATA_TYPECODE,</span>
-<span class="pre">DIM_TYPE)</span></tt> triplets. For example:</p>
-<pre class="literal-block">
-%numpy_typemaps(double, NPY_DOUBLE, int)
-%numpy_typemaps(int, NPY_INT , int)
-</pre>
-<p>The <tt class="docutils literal"><span class="pre">numpy.i</span></tt> interface file uses the <tt class="docutils literal"><span class="pre">%numpy_typemaps</span></tt> macro to
-implement typemaps for the following C data types and <tt class="docutils literal"><span class="pre">int</span></tt>
-dimension types:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">signed</span> <span class="pre">char</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">char</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">short</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">short</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">int</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">long</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">long</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">long</span> <span class="pre">long</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">long</span> <span class="pre">long</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">float</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">double</span></tt></li>
-</ul>
-</blockquote>
-<p>In the following descriptions, we reference a generic <tt class="docutils literal"><span class="pre">DATA_TYPE</span></tt>, which
-could be any of the C data types listed above, and <tt class="docutils literal"><span class="pre">DIM_TYPE</span></tt> which
-should be one of the many types of integers.</p>
-<p>The typemap signatures are largely differentiated on the name given to
-the buffer pointer. Names with <tt class="docutils literal"><span class="pre">FARRAY</span></tt> are for FORTRAN-ordered
-arrays, and names with <tt class="docutils literal"><span class="pre">ARRAY</span></tt> are for C-ordered (or 1D arrays).</p>
-<div class="section">
-<h2><a class="toc-backref" href="#id4" id="input-arrays" name="input-arrays">Input Arrays</a></h2>
-<p>Input arrays are defined as arrays of data that are passed into a
-routine but are not altered in-place or returned to the user. The
-<a class="reference" href="http://www.python.org">python</a> input array is therefore allowed to be almost any <a class="reference" href="http://www.python.org">python</a>
-sequence (such as a list) that can be converted to the requested type
-of array. The input array signatures are</p>
-<p>1D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">IN_ARRAY1[ANY]</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_ARRAY1,</span> <span class="pre">int</span> <span class="pre">DIM1</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_ARRAY1</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>2D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">IN_ARRAY2[ANY][ANY]</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_ARRAY2,</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_ARRAY2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_FARRAY2,</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_FARRAY2</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>3D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">IN_ARRAY3[ANY][ANY][ANY]</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_ARRAY3,</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">int</span> <span class="pre">DIM3</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">int</span> <span class="pre">DIM3,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_ARRAY3</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_FARRAY3,</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">int</span> <span class="pre">DIM3</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">int</span> <span class="pre">DIM3,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">IN_FARRAY3</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>The first signature listed, <tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">IN_ARRAY[ANY]</span> <span class="pre">)</span></tt> is for
-one-dimensional arrays with hard-coded dimensions. Likewise,
-<tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">IN_ARRAY2[ANY][ANY]</span> <span class="pre">)</span></tt> is for two-dimensional arrays
-with hard-coded dimensions, and similarly for three-dimensional.</p>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id5" id="in-place-arrays" name="in-place-arrays">In-Place Arrays</a></h2>
-<p>In-place arrays are defined as arrays that are modified in-place. The
-input values may or may not be used, but the values at the time the
-function returns are significant. The provided <a class="reference" href="http://www.python.org">python</a> argument
-must therefore be a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array of the required type. The in-place
-signatures are</p>
-<p>1D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">INPLACE_ARRAY1[ANY]</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_ARRAY1,</span> <span class="pre">int</span> <span class="pre">DIM1</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_ARRAY1</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>2D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">INPLACE_ARRAY2[ANY][ANY]</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_ARRAY2,</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_ARRAY2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_FARRAY2,</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_FARRAY2</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>3D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">INPLACE_ARRAY3[ANY][ANY][ANY]</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_ARRAY3,</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">int</span> <span class="pre">DIM3</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">int</span> <span class="pre">DIM3,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_ARRAY3</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_FARRAY3,</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">int</span> <span class="pre">DIM3</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">int</span> <span class="pre">DIM2,</span> <span class="pre">int</span> <span class="pre">DIM3,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">INPLACE_FARRAY3</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>These typemaps now check to make sure that the <tt class="docutils literal"><span class="pre">INPLACE_ARRAY</span></tt>
-arguments use native byte ordering. If not, an exception is raised.</p>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id6" id="argout-arrays" name="argout-arrays">Argout Arrays</a></h2>
-<p>Argout arrays are arrays that appear in the input arguments in C, but
-are in fact output arrays. This pattern occurs often when there is
-more than one output variable and the single return argument is
-therefore not sufficient. In <a class="reference" href="http://www.python.org">python</a>, the convential way to return
-multiple arguments is to pack them into a sequence (tuple, list, etc.)
-and return the sequence. This is what the argout typemaps do. If a
-wrapped function that uses these argout typemaps has more than one
-return argument, they are packed into a tuple or list, depending on
-the version of <a class="reference" href="http://www.python.org">python</a>. The <a class="reference" href="http://www.python.org">python</a> user does not pass these
-arrays in, they simply get returned. For the case where a dimension
-is specified, the python user must provide that dimension as an
-argument. The argout signatures are</p>
-<p>1D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">ARGOUT_ARRAY1[ANY]</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE*</span> <span class="pre">ARGOUT_ARRAY1,</span> <span class="pre">int</span> <span class="pre">DIM1</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">int</span> <span class="pre">DIM1,</span> <span class="pre">DATA_TYPE*</span> <span class="pre">ARGOUT_ARRAY1</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>2D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">ARGOUT_ARRAY2[ANY][ANY]</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>3D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE</span> <span class="pre">ARGOUT_ARRAY3[ANY][ANY][ANY]</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>These are typically used in situations where in C/C++, you would
-allocate a(n) array(s) on the heap, and call the function to fill the
-array(s) values. In <a class="reference" href="http://www.python.org">python</a>, the arrays are allocated for you and
-returned as new array objects.</p>
-<p>Note that we support <tt class="docutils literal"><span class="pre">DATA_TYPE*</span></tt> argout typemaps in 1D, but not 2D
-or 3D. This is because of a quirk with the <a class="reference" href="http://www.swig.org">SWIG</a> typemap syntax and
-cannot be avoided. Note that for these types of 1D typemaps, the
-<a class="reference" href="http://www.python.org">python</a> function will take a single argument representing <tt class="docutils literal"><span class="pre">DIM1</span></tt>.</p>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id7" id="argoutview-arrays" name="argoutview-arrays">Argoutview Arrays</a></h2>
-<p>Argoutview arrays are for when your C code provides you with a view of
-its internal data and does not require any memory to be allocated by
-the user. This can be dangerous. There is almost no way to guarantee
-that the internal data from the C code will remain in existence for
-the entire lifetime of the <a class="reference" href="http://numpy.scipy.org">NumPy</a> array that encapsulates it. If
-the user destroys the object that provides the view of the data before
-destroying the <a class="reference" href="http://numpy.scipy.org">NumPy</a> array, then using that array my result in bad
-memory references or segmentation faults. Nevertheless, there are
-situations, working with large data sets, where you simply have no
-other choice.</p>
-<p>The C code to be wrapped for argoutview arrays are characterized by
-pointers: pointers to the dimensions and double pointers to the data,
-so that these values can be passed back to the user. The argoutview
-typemap signatures are therefore</p>
-<p>1D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_ARRAY1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_ARRAY1</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>2D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_ARRAY2,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM2,</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_ARRAY2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_FARRAY2,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM2</span> <span class="pre">)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM2,</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_FARRAY2</span> <span class="pre">)</span></tt></li>
-</ul>
-</blockquote>
-<p>3D:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_ARRAY3,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM2,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM3)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM2,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM3,</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_ARRAY3)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_FARRAY3,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM2,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM3)</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">(</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM1,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM2,</span> <span class="pre">DIM_TYPE*</span> <span class="pre">DIM3,</span> <span class="pre">DATA_TYPE**</span> <span class="pre">ARGOUTVIEW_FARRAY3)</span></tt></li>
-</ul>
-</blockquote>
-<p>Note that arrays with hard-coded dimensions are not supported. These
-cannot follow the double pointer signatures of these typemaps.</p>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id8" id="output-arrays" name="output-arrays">Output Arrays</a></h2>
-<p>The <tt class="docutils literal"><span class="pre">numpy.i</span></tt> interface file does not support typemaps for output
-arrays, for several reasons. First, C/C++ return arguments are
-limited to a single value. This prevents obtaining dimension
-information in a general way. Second, arrays with hard-coded lengths
-are not permitted as return arguments. In other words:</p>
-<pre class="literal-block">
-double[3] newVector(double x, double y, double z);
-</pre>
-<p>is not legal C/C++ syntax. Therefore, we cannot provide typemaps of
-the form:</p>
-<pre class="literal-block">
-%typemap(out) (TYPE[ANY]);
-</pre>
-<p>If you run into a situation where a function or method is returning a
-pointer to an array, your best bet is to write your own version of the
-function to be wrapped, either with <tt class="docutils literal"><span class="pre">%extend</span></tt> for the case of class
-methods or <tt class="docutils literal"><span class="pre">%ignore</span></tt> and <tt class="docutils literal"><span class="pre">%rename</span></tt> for the case of functions.</p>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id9" id="other-common-types-bool" name="other-common-types-bool">Other Common Types: bool</a></h2>
-<p>Note that C++ type <tt class="docutils literal"><span class="pre">bool</span></tt> is not supported in the list in the
-<a class="reference" href="#available-typemaps">Available Typemaps</a> section. NumPy bools are a single byte, while
-the C++ <tt class="docutils literal"><span class="pre">bool</span></tt> is four bytes (at least on my system). Therefore:</p>
-<pre class="literal-block">
-%numpy_typemaps(bool, NPY_BOOL, int)
-</pre>
-<p>will result in typemaps that will produce code that reference
-improper data lengths. You can implement the following macro
-expansion:</p>
-<pre class="literal-block">
-%numpy_typemaps(bool, NPY_UINT, int)
-</pre>
-<p>to fix the data length problem, and <a class="reference" href="#input-arrays">Input Arrays</a> will work fine,
-but <a class="reference" href="#in-place-arrays">In-Place Arrays</a> might fail type-checking.</p>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id10" id="other-common-types-complex" name="other-common-types-complex">Other Common Types: complex</a></h2>
-<p>Typemap conversions for complex floating-point types is also not
-supported automatically. This is because <a class="reference" href="http://www.python.org">python</a> and <a class="reference" href="http://numpy.scipy.org">NumPy</a> are
-written in C, which does not have native complex types. Both
-<a class="reference" href="http://www.python.org">python</a> and <a class="reference" href="http://numpy.scipy.org">NumPy</a> implement their own (essentially equivalent)
-<tt class="docutils literal"><span class="pre">struct</span></tt> definitions for complex variables:</p>
-<pre class="literal-block">
-/* Python */
-typedef struct {double real; double imag;} Py_complex;
-
-/* NumPy */
-typedef struct {float real, imag;} npy_cfloat;
-typedef struct {double real, imag;} npy_cdouble;
-</pre>
-<p>We could have implemented:</p>
-<pre class="literal-block">
-%numpy_typemaps(Py_complex , NPY_CDOUBLE, int)
-%numpy_typemaps(npy_cfloat , NPY_CFLOAT , int)
-%numpy_typemaps(npy_cdouble, NPY_CDOUBLE, int)
-</pre>
-<p>which would have provided automatic type conversions for arrays of
-type <tt class="docutils literal"><span class="pre">Py_complex</span></tt>, <tt class="docutils literal"><span class="pre">npy_cfloat</span></tt> and <tt class="docutils literal"><span class="pre">npy_cdouble</span></tt>. However, it
-seemed unlikely that there would be any independent (non-<a class="reference" href="http://www.python.org">python</a>,
-non-<a class="reference" href="http://numpy.scipy.org">NumPy</a>) application code that people would be using <a class="reference" href="http://www.swig.org">SWIG</a> to
-generate a <a class="reference" href="http://www.python.org">python</a> interface to, that also used these definitions
-for complex types. More likely, these application codes will define
-their own complex types, or in the case of C++, use <tt class="docutils literal"><span class="pre">std::complex</span></tt>.
-Assuming these data structures are compatible with <a class="reference" href="http://www.python.org">python</a> and
-<a class="reference" href="http://numpy.scipy.org">NumPy</a> complex types, <tt class="docutils literal"><span class="pre">%numpy_typemap</span></tt> expansions as above (with
-the user's complex type substituted for the first argument) should
-work.</p>
-</div>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id11" id="numpy-array-scalars-and-swig" name="numpy-array-scalars-and-swig">NumPy Array Scalars and SWIG</a></h1>
-<p><a class="reference" href="http://www.swig.org">SWIG</a> has sophisticated type checking for numerical types. For
-example, if your C/C++ routine expects an integer as input, the code
-generated by <a class="reference" href="http://www.swig.org">SWIG</a> will check for both <a class="reference" href="http://www.python.org">python</a> integers and
-<a class="reference" href="http://www.python.org">python</a> long integers, and raise an overflow error if the provided
-<a class="reference" href="http://www.python.org">python</a> integer is too big to cast down to a C integer. With the
-introduction of <a class="reference" href="http://numpy.scipy.org">NumPy</a> scalar arrays into your <a class="reference" href="http://www.python.org">python</a> code, you
-might conceivably extract an integer from a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array and attempt
-to pass this to a <a class="reference" href="http://www.swig.org">SWIG</a>-wrapped C/C++ function that expects an
-<tt class="docutils literal"><span class="pre">int</span></tt>, but the <a class="reference" href="http://www.swig.org">SWIG</a> type checking will not recognize the <a class="reference" href="http://numpy.scipy.org">NumPy</a>
-array scalar as an integer. (Often, this does in fact work -- it
-depends on whether <a class="reference" href="http://numpy.scipy.org">NumPy</a> recognizes the integer type you are using
-as inheriting from the <a class="reference" href="http://www.python.org">python</a> integer type on the platform you are
-using. Sometimes, this means that code that works on a 32-bit machine
-will fail on a 64-bit machine.)</p>
-<p>If you get a <a class="reference" href="http://www.python.org">python</a> error that looks like the following:</p>
-<pre class="literal-block">
-TypeError: in method 'MyClass_MyMethod', argument 2 of type 'int'
-</pre>
-<p>and the argument you are passing is an integer extracted from a
-<a class="reference" href="http://numpy.scipy.org">NumPy</a> array, then you have stumbled upon this problem. The
-solution is to modify the <a class="reference" href="http://www.swig.org">SWIG</a> type conversion system to accept
-<a class="reference" href="http://numpy.scipy.org">Numpy</a> array scalars in addition to the standard integer types.
-Fortunately, this capabilitiy has been provided for you. Simply copy
-the file:</p>
-<pre class="literal-block">
-pyfragments.swg
-</pre>
-<p>to the working build directory for you project, and this problem will
-be fixed. It is suggested that you do this anyway, as it only
-increases the capabilities of your <a class="reference" href="http://www.python.org">python</a> interface.</p>
-<div class="section">
-<h2><a class="toc-backref" href="#id12" id="why-is-there-a-second-file" name="why-is-there-a-second-file">Why is There a Second File?</a></h2>
-<p>The <a class="reference" href="http://www.swig.org">SWIG</a> type checking and conversion system is a complicated
-combination of C macros, <a class="reference" href="http://www.swig.org">SWIG</a> macros, <a class="reference" href="http://www.swig.org">SWIG</a> typemaps and <a class="reference" href="http://www.swig.org">SWIG</a>
-fragments. Fragments are a way to conditionally insert code into your
-wrapper file if it is needed, and not insert it if not needed. If
-multiple typemaps require the same fragment, the fragment only gets
-inserted into your wrapper code once.</p>
-<p>There is a fragment for converting a <a class="reference" href="http://www.python.org">python</a> integer to a C
-<tt class="docutils literal"><span class="pre">long</span></tt>. There is a different fragment that converts a <a class="reference" href="http://www.python.org">python</a>
-integer to a C <tt class="docutils literal"><span class="pre">int</span></tt>, that calls the rountine defined in the
-<tt class="docutils literal"><span class="pre">long</span></tt> fragment. We can make the changes we want here by changing
-the definition for the <tt class="docutils literal"><span class="pre">long</span></tt> fragment. <a class="reference" href="http://www.swig.org">SWIG</a> determines the
-active definition for a fragment using a &quot;first come, first served&quot;
-system. That is, we need to define the fragment for <tt class="docutils literal"><span class="pre">long</span></tt>
-conversions prior to <a class="reference" href="http://www.swig.org">SWIG</a> doing it internally. <a class="reference" href="http://www.swig.org">SWIG</a> allows us
-to do this by putting our fragment definitions in the file
-<tt class="docutils literal"><span class="pre">pyfragments.swg</span></tt>. If we were to put the new fragment definitions
-in <tt class="docutils literal"><span class="pre">numpy.i</span></tt>, they would be ignored.</p>
-</div>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id13" id="helper-functions" name="helper-functions">Helper Functions</a></h1>
-<p>The <tt class="docutils literal"><span class="pre">numpy.i</span></tt> file containes several macros and routines that it
-uses internally to build its typemaps. However, these functions may
-be useful elsewhere in your interface file. These macros and routines
-are implemented as fragments, which are described briefly in the
-previous section. If you try to use one or more of the following
-macros or functions, but your compiler complains that it does not
-recognize the symbol, then you need to force these fragments to appear
-in your code using:</p>
-<pre class="literal-block">
-%fragment(&quot;NumPy_Fragments&quot;);
-</pre>
-<p>in your <a class="reference" href="http://www.swig.org">SWIG</a> interface file.</p>
-<div class="section">
-<h2><a class="toc-backref" href="#id14" id="macros" name="macros">Macros</a></h2>
-<blockquote>
-<dl class="docutils">
-<dt><strong>is_array(a)</strong></dt>
-<dd>Evaluates as true if <tt class="docutils literal"><span class="pre">a</span></tt> is non-<tt class="docutils literal"><span class="pre">NULL</span></tt> and can be cast to a
-<tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>.</dd>
-<dt><strong>array_type(a)</strong></dt>
-<dd>Evaluates to the integer data type code of <tt class="docutils literal"><span class="pre">a</span></tt>, assuming <tt class="docutils literal"><span class="pre">a</span></tt> can
-be cast to a <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>.</dd>
-<dt><strong>array_numdims(a)</strong></dt>
-<dd>Evaluates to the integer number of dimensions of <tt class="docutils literal"><span class="pre">a</span></tt>, assuming
-<tt class="docutils literal"><span class="pre">a</span></tt> can be cast to a <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>.</dd>
-<dt><strong>array_dimensions(a)</strong></dt>
-<dd>Evaluates to an array of type <tt class="docutils literal"><span class="pre">npy_intp</span></tt> and length
-<tt class="docutils literal"><span class="pre">array_numdims(a)</span></tt>, giving the lengths of all of the dimensions
-of <tt class="docutils literal"><span class="pre">a</span></tt>, assuming <tt class="docutils literal"><span class="pre">a</span></tt> can be cast to a <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>.</dd>
-<dt><strong>array_size(a,i)</strong></dt>
-<dd>Evaluates to the <tt class="docutils literal"><span class="pre">i</span></tt>-th dimension size of <tt class="docutils literal"><span class="pre">a</span></tt>, assuming <tt class="docutils literal"><span class="pre">a</span></tt>
-can be cast to a <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>.</dd>
-<dt><strong>array_data(a)</strong></dt>
-<dd>Evaluates to a pointer of type <tt class="docutils literal"><span class="pre">void*</span></tt> that points to the data
-buffer of <tt class="docutils literal"><span class="pre">a</span></tt>, assuming <tt class="docutils literal"><span class="pre">a</span></tt> can be cast to a <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>.</dd>
-<dt><strong>array_is_contiguous(a)</strong></dt>
-<dd>Evaluates as true if <tt class="docutils literal"><span class="pre">a</span></tt> is a contiguous array. Equivalent to
-<tt class="docutils literal"><span class="pre">(PyArray_ISCONTIGUOUS(a))</span></tt>.</dd>
-<dt><strong>array_is_native(a)</strong></dt>
-<dd>Evaluates as true if the data buffer of <tt class="docutils literal"><span class="pre">a</span></tt> uses native byte
-order. Equivalent to <tt class="docutils literal"><span class="pre">(PyArray_ISNOTSWAPPED(a))</span></tt>.</dd>
-<dt><strong>array_is_fortran(a)</strong></dt>
-<dd>Evaluates as true if <tt class="docutils literal"><span class="pre">a</span></tt> is FORTRAN ordered.</dd>
-</dl>
-</blockquote>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id15" id="routines" name="routines">Routines</a></h2>
-<blockquote>
-<p><strong>pytype_string()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">char*</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyObject*</span> <span class="pre">py_obj</span></tt>, a general <a class="reference" href="http://www.python.org">python</a> object.</li>
-</ul>
-<p>Return a string describing the type of <tt class="docutils literal"><span class="pre">py_obj</span></tt>.</p>
-</blockquote>
-<p><strong>typecode_string()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">char*</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">typecode</span></tt>, a <a class="reference" href="http://numpy.scipy.org">NumPy</a> integer typecode.</li>
-</ul>
-<p>Return a string describing the type corresponding to the <a class="reference" href="http://numpy.scipy.org">NumPy</a>
-<tt class="docutils literal"><span class="pre">typecode</span></tt>.</p>
-</blockquote>
-<p><strong>type_match()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">int</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">actual_type</span></tt>, the <a class="reference" href="http://numpy.scipy.org">NumPy</a> typecode of a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">desired_type</span></tt>, the desired <a class="reference" href="http://numpy.scipy.org">NumPy</a> typecode.</li>
-</ul>
-<p>Make sure that <tt class="docutils literal"><span class="pre">actual_type</span></tt> is compatible with
-<tt class="docutils literal"><span class="pre">desired_type</span></tt>. For example, this allows character and
-byte types, or int and long types, to match. This is now
-equivalent to <tt class="docutils literal"><span class="pre">PyArray_EquivTypenums()</span></tt>.</p>
-</blockquote>
-<p><strong>obj_to_array_no_conversion()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyObject*</span> <span class="pre">input</span></tt>, a general <a class="reference" href="http://www.python.org">python</a> object.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">typecode</span></tt>, the desired <a class="reference" href="http://numpy.scipy.org">NumPy</a> typecode.</li>
-</ul>
-<p>Cast <tt class="docutils literal"><span class="pre">input</span></tt> to a <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt> if legal, and ensure that
-it is of type <tt class="docutils literal"><span class="pre">typecode</span></tt>. If <tt class="docutils literal"><span class="pre">input</span></tt> cannot be cast, or the
-<tt class="docutils literal"><span class="pre">typecode</span></tt> is wrong, set a <a class="reference" href="http://www.python.org">python</a> error and return <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
-</blockquote>
-<p><strong>obj_to_array_allow_conversion()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyObject*</span> <span class="pre">input</span></tt>, a general <a class="reference" href="http://www.python.org">python</a> object.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">typecode</span></tt>, the desired <a class="reference" href="http://numpy.scipy.org">NumPy</a> typecode of the resulting
-array.</li>
-<li><tt class="docutils literal"><span class="pre">int*</span> <span class="pre">is_new_object</span></tt>, returns a value of 0 if no conversion
-performed, else 1.</li>
-</ul>
-<p>Convert <tt class="docutils literal"><span class="pre">input</span></tt> to a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array with the given <tt class="docutils literal"><span class="pre">typecode</span></tt>.
-On success, return a valid <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt> with the correct
-type. On failure, the <a class="reference" href="http://www.python.org">python</a> error string will be set and the
-routine returns <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
-</blockquote>
-<p><strong>make_contiguous()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyArrayObject*</span> <span class="pre">ary</span></tt>, a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array.</li>
-<li><tt class="docutils literal"><span class="pre">int*</span> <span class="pre">is_new_object</span></tt>, returns a value of 0 if no conversion
-performed, else 1.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">min_dims</span></tt>, minimum allowable dimensions.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">max_dims</span></tt>, maximum allowable dimensions.</li>
-</ul>
-<p>Check to see if <tt class="docutils literal"><span class="pre">ary</span></tt> is contiguous. If so, return the input
-pointer and flag it as not a new object. If it is not contiguous,
-create a new <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt> using the original data, flag it
-as a new object and return the pointer.</p>
-</blockquote>
-<p><strong>obj_to_array_contiguous_allow_conversion()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyObject*</span> <span class="pre">input</span></tt>, a general <a class="reference" href="http://www.python.org">python</a> object.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">typecode</span></tt>, the desired <a class="reference" href="http://numpy.scipy.org">NumPy</a> typecode of the resulting
-array.</li>
-<li><tt class="docutils literal"><span class="pre">int*</span> <span class="pre">is_new_object</span></tt>, returns a value of 0 if no conversion
-performed, else 1.</li>
-</ul>
-<p>Convert <tt class="docutils literal"><span class="pre">input</span></tt> to a contiguous <tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt> of the
-specified type. If the input object is not a contiguous
-<tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>, a new one will be created and the new object
-flag will be set.</p>
-</blockquote>
-<p><strong>require_contiguous()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">int</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyArrayObject*</span> <span class="pre">ary</span></tt>, a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array.</li>
-</ul>
-<p>Test whether <tt class="docutils literal"><span class="pre">ary</span></tt> is contiguous. If so, return 1. Otherwise,
-set a <a class="reference" href="http://www.python.org">python</a> error and return 0.</p>
-</blockquote>
-<p><strong>require_native()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">int</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyArray_Object*</span> <span class="pre">ary</span></tt>, a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array.</li>
-</ul>
-<p>Require that <tt class="docutils literal"><span class="pre">ary</span></tt> is not byte-swapped. If the array is not
-byte-swapped, return 1. Otherwise, set a <a class="reference" href="http://www.python.org">python</a> error and
-return 0.</p>
-</blockquote>
-<p><strong>require_dimensions()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">int</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyArrayObject*</span> <span class="pre">ary</span></tt>, a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">exact_dimensions</span></tt>, the desired number of dimensions.</li>
-</ul>
-<p>Require <tt class="docutils literal"><span class="pre">ary</span></tt> to have a specified number of dimensions. If the
-array has the specified number of dimensions, return 1.
-Otherwise, set a <a class="reference" href="http://www.python.org">python</a> error and return 0.</p>
-</blockquote>
-<p><strong>require_dimensions_n()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">int</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyArrayObject*</span> <span class="pre">ary</span></tt>, a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array.</li>
-<li><tt class="docutils literal"><span class="pre">int*</span> <span class="pre">exact_dimensions</span></tt>, an array of integers representing
-acceptable numbers of dimensions.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">n</span></tt>, the length of <tt class="docutils literal"><span class="pre">exact_dimensions</span></tt>.</li>
-</ul>
-<p>Require <tt class="docutils literal"><span class="pre">ary</span></tt> to have one of a list of specified number of
-dimensions. If the array has one of the specified number of
-dimensions, return 1. Otherwise, set the <a class="reference" href="http://www.python.org">python</a> error string
-and return 0.</p>
-</blockquote>
-<p><strong>require_size()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">int</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyArrayObject*</span> <span class="pre">ary</span></tt>, a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array.</li>
-<li><tt class="docutils literal"><span class="pre">npy_int*</span> <span class="pre">size</span></tt>, an array representing the desired lengths of
-each dimension.</li>
-<li><tt class="docutils literal"><span class="pre">int</span> <span class="pre">n</span></tt>, the length of <tt class="docutils literal"><span class="pre">size</span></tt>.</li>
-</ul>
-<p>Require <tt class="docutils literal"><span class="pre">ary</span></tt> to have a specified shape. If the array has the
-specified shape, return 1. Otherwise, set the <a class="reference" href="http://www.python.org">python</a> error
-string and return 0.</p>
-</blockquote>
-<p><strong>require_fortran()</strong></p>
-<blockquote>
-<p>Return type: <tt class="docutils literal"><span class="pre">int</span></tt></p>
-<p>Arguments:</p>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">PyArrayObject*</span> <span class="pre">ary</span></tt>, a <a class="reference" href="http://numpy.scipy.org">NumPy</a> array.</li>
-</ul>
-<p>Require the given <tt class="docutils literal"><span class="pre">PyArrayObject</span></tt> to to be FORTRAN ordered. If
-the the <tt class="docutils literal"><span class="pre">PyArrayObject</span></tt> is already FORTRAN ordered, do nothing.
-Else, set the FORTRAN ordering flag and recompute the strides.</p>
-</blockquote>
-</blockquote>
-</div>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id16" id="beyond-the-provided-typemaps" name="beyond-the-provided-typemaps">Beyond the Provided Typemaps</a></h1>
-<p>There are many C or C++ array/<a class="reference" href="http://numpy.scipy.org">NumPy</a> array situations not covered by
-a simple <tt class="docutils literal"><span class="pre">%include</span> <span class="pre">&quot;numpy.i&quot;</span></tt> and subsequent <tt class="docutils literal"><span class="pre">%apply</span></tt> directives.</p>
-<div class="section">
-<h2><a class="toc-backref" href="#id17" id="a-common-example" name="a-common-example">A Common Example</a></h2>
-<p>Consider a reasonable prototype for a dot product function:</p>
-<pre class="literal-block">
-double dot(int len, double* vec1, double* vec2);
-</pre>
-<p>The <a class="reference" href="http://www.python.org">python</a> interface that we want is:</p>
-<pre class="literal-block">
-def dot(vec1, vec2):
- &quot;&quot;&quot;
- dot(PyObject,PyObject) -&gt; double
- &quot;&quot;&quot;
-</pre>
-<p>The problem here is that there is one dimension argument and two array
-arguments, and our typemaps are set up for dimensions that apply to a
-single array (in fact, <a class="reference" href="http://www.swig.org">SWIG</a> does not provide a mechanism for
-associating <tt class="docutils literal"><span class="pre">len</span></tt> with <tt class="docutils literal"><span class="pre">vec2</span></tt> that takes two <a class="reference" href="http://www.python.org">python</a> input
-arguments). The recommended solution is the following:</p>
-<pre class="literal-block">
-%apply (int DIM1, double* IN_ARRAY1) {(int len1, double* vec1),
- (int len2, double* vec2)}
-%rename (dot) my_dot;
-%exception my_dot {
- $action
- if (PyErr_Occurred()) SWIG_fail;
-}
-%inline %{
-double my_dot(int len1, double* vec1, int len2, double* vec2) {
- if (len1 != len2) {
- PyErr_Format(PyExc_ValueError,
- &quot;Arrays of lengths (%d,%d) given&quot;,
- len1, len2);
- return 0.0;
- }
- return dot(len1, vec1, vec2);
-}
-%}
-</pre>
-<p>If the header file that contains the prototype for <tt class="docutils literal"><span class="pre">double</span> <span class="pre">dot()</span></tt>
-also contains other prototypes that you want to wrap, so that you need
-to <tt class="docutils literal"><span class="pre">%include</span></tt> this header file, then you will also need a <tt class="docutils literal"><span class="pre">%ignore</span>
-<span class="pre">dot;</span></tt> directive, placed after the <tt class="docutils literal"><span class="pre">%rename</span></tt> and before the
-<tt class="docutils literal"><span class="pre">%include</span></tt> directives. Or, if the function in question is a class
-method, you will want to use <tt class="docutils literal"><span class="pre">%extend</span></tt> rather than <tt class="docutils literal"><span class="pre">%inline</span></tt> in
-addition to <tt class="docutils literal"><span class="pre">%ignore</span></tt>.</p>
-<p><strong>A note on error handling:</strong> Note that <tt class="docutils literal"><span class="pre">my_dot</span></tt> returns a
-<tt class="docutils literal"><span class="pre">double</span></tt> but that it can also raise a <a class="reference" href="http://www.python.org">python</a> error. The
-resulting wrapper function will return a <a class="reference" href="http://www.python.org">python</a> float
-representation of 0.0 when the vector lengths do not match. Since
-this is not <tt class="docutils literal"><span class="pre">NULL</span></tt>, the <a class="reference" href="http://www.python.org">python</a> interpreter will not know to check
-for an error. For this reason, we add the <tt class="docutils literal"><span class="pre">%exception</span></tt> directive
-above for <tt class="docutils literal"><span class="pre">my_dot</span></tt> to get the behavior we want (note that
-<tt class="docutils literal"><span class="pre">$action</span></tt> is a macro that gets expanded to a valid call to
-<tt class="docutils literal"><span class="pre">my_dot</span></tt>). In general, you will probably want to write a <a class="reference" href="http://www.swig.org">SWIG</a>
-macro to perform this task.</p>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id18" id="other-situations" name="other-situations">Other Situations</a></h2>
-<p>There are other wrapping situations in which <tt class="docutils literal"><span class="pre">numpy.i</span></tt> may be
-helpful when you encounter them.</p>
-<blockquote>
-<ul>
-<li><p class="first">In some situations, it is possible that you could use the
-<tt class="docutils literal"><span class="pre">%numpy_templates</span></tt> macro to implement typemaps for your own
-types. See the <a class="reference" href="#other-common-types-bool">Other Common Types: bool</a> or <a class="reference" href="#other-common-types-complex">Other Common
-Types: complex</a> sections for examples. Another situation is if
-your dimensions are of a type other than <tt class="docutils literal"><span class="pre">int</span></tt> (say <tt class="docutils literal"><span class="pre">long</span></tt> for
-example):</p>
-<pre class="literal-block">
-%numpy_typemaps(double, NPY_DOUBLE, long)
-</pre>
-</li>
-<li><p class="first">You can use the code in <tt class="docutils literal"><span class="pre">numpy.i</span></tt> to write your own typemaps.
-For example, if you had a four-dimensional array as a function
-argument, you could cut-and-paste the appropriate
-three-dimensional typemaps into your interface file. The
-modifications for the fourth dimension would be trivial.</p>
-</li>
-<li><p class="first">Sometimes, the best approach is to use the <tt class="docutils literal"><span class="pre">%extend</span></tt> directive
-to define new methods for your classes (or overload existing ones)
-that take a <tt class="docutils literal"><span class="pre">PyObject*</span></tt> (that either is or can be converted to a
-<tt class="docutils literal"><span class="pre">PyArrayObject*</span></tt>) instead of a pointer to a buffer. In this
-case, the helper routines in <tt class="docutils literal"><span class="pre">numpy.i</span></tt> can be very useful.</p>
-</li>
-<li><p class="first">Writing typemaps can be a bit nonintuitive. If you have specific
-questions about writing <a class="reference" href="http://www.swig.org">SWIG</a> typemaps for <a class="reference" href="http://numpy.scipy.org">NumPy</a>, the
-developers of <tt class="docutils literal"><span class="pre">numpy.i</span></tt> do monitor the
-<a class="reference" href="mailto:Numpy-discussion&#64;scipy.org">Numpy-discussion</a> and
-<a class="reference" href="mailto:Swig-user&#64;lists.sourceforge.net">Swig-user</a> mail lists.</p>
-</li>
-</ul>
-</blockquote>
-</div>
-<div class="section">
-<h2><a class="toc-backref" href="#id19" id="a-final-note" name="a-final-note">A Final Note</a></h2>
-<p>When you use the <tt class="docutils literal"><span class="pre">%apply</span></tt> directive, as is usually necessary to use
-<tt class="docutils literal"><span class="pre">numpy.i</span></tt>, it will remain in effect until you tell <a class="reference" href="http://www.swig.org">SWIG</a> that it
-shouldn't be. If the arguments to the functions or methods that you
-are wrapping have common names, such as <tt class="docutils literal"><span class="pre">length</span></tt> or <tt class="docutils literal"><span class="pre">vector</span></tt>,
-these typemaps may get applied in situations you do not expect or
-want. Therefore, it is always a good idea to add a <tt class="docutils literal"><span class="pre">%clear</span></tt>
-directive after you are done with a specific typemap:</p>
-<pre class="literal-block">
-%apply (double* IN_ARRAY1, int DIM1) {(double* vector, int length)}
-%include &quot;my_header.h&quot;
-%clear (double* vector, int length);
-</pre>
-<p>In general, you should target these typemap signatures specifically
-where you want them, and then clear them after you are done.</p>
-</div>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id20" id="summary" name="summary">Summary</a></h1>
-<p>Out of the box, <tt class="docutils literal"><span class="pre">numpy.i</span></tt> provides typemaps that support conversion
-between <a class="reference" href="http://numpy.scipy.org">NumPy</a> arrays and C arrays:</p>
-<blockquote>
-<ul class="simple">
-<li>That can be one of 12 different scalar types: <tt class="docutils literal"><span class="pre">signed</span> <span class="pre">char</span></tt>,
-<tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">char</span></tt>, <tt class="docutils literal"><span class="pre">short</span></tt>, <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">short</span></tt>, <tt class="docutils literal"><span class="pre">int</span></tt>,
-<tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt>, <tt class="docutils literal"><span class="pre">long</span></tt>, <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">long</span></tt>, <tt class="docutils literal"><span class="pre">long</span> <span class="pre">long</span></tt>,
-<tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">long</span> <span class="pre">long</span></tt>, <tt class="docutils literal"><span class="pre">float</span></tt> and <tt class="docutils literal"><span class="pre">double</span></tt>.</li>
-<li>That support 41 different argument signatures for each data type,
-including:<ul>
-<li>One-dimensional, two-dimensional and three-dimensional arrays.</li>
-<li>Input-only, in-place, argout and argoutview behavior.</li>
-<li>Hard-coded dimensions, data-buffer-then-dimensions
-specification, and dimensions-then-data-buffer specification.</li>
-<li>Both C-ordering (&quot;last dimension fastest&quot;) or FORTRAN-ordering
-(&quot;first dimension fastest&quot;) support for 2D and 3D arrays.</li>
-</ul>
-</li>
-</ul>
-</blockquote>
-<p>The <tt class="docutils literal"><span class="pre">numpy.i</span></tt> interface file also provides additional tools for
-wrapper developers, including:</p>
-<blockquote>
-<ul class="simple">
-<li>A <a class="reference" href="http://www.swig.org">SWIG</a> macro (<tt class="docutils literal"><span class="pre">%numpy_typemaps</span></tt>) with three arguments for
-implementing the 41 argument signatures for the user's choice of
-(1) C data type, (2) <a class="reference" href="http://numpy.scipy.org">NumPy</a> data type (assuming they match), and
-(3) dimension type.</li>
-<li>Nine C macros and 13 C functions that can be used to write
-specialized typemaps, extensions, or inlined functions that handle
-cases not covered by the provided typemaps.</li>
-</ul>
-</blockquote>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id21" id="acknowledgements" name="acknowledgements">Acknowledgements</a></h1>
-<p>Many people have worked to glue <a class="reference" href="http://www.swig.org">SWIG</a> and <a class="reference" href="http://numpy.scipy.org">NumPy</a> together (as well
-as <a class="reference" href="http://www.swig.org">SWIG</a> and the predecessors of <a class="reference" href="http://numpy.scipy.org">NumPy</a>, Numeric and numarray).
-The effort to standardize this work into <tt class="docutils literal"><span class="pre">numpy.i</span></tt> began at the 2005
-<a class="reference" href="http://scipy.org">SciPy</a> Conference with a conversation between
-Fernando Perez and myself. Fernando collected helper functions and
-typemaps from Eric Jones, Michael Hunter, Anna Omelchenko and Michael
-Sanner. Sebastian Hasse and Georg Holzmann have also provided
-additional error checking and use cases. The work of these
-contributors has made this end result possible.</p>
-</div>
-</div>
-<div class="footer">
-<hr class="footer" />
-Generated on: 2007-12-01 18:17 UTC.
-Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
-
-</div>
-</body>
-</html>
diff --git a/numpy/doc/swig/doc/numpy_swig.pdf b/numpy/doc/swig/doc/numpy_swig.pdf
deleted file mode 100644
index 1d4642cf7..000000000
--- a/numpy/doc/swig/doc/numpy_swig.pdf
+++ /dev/null
Binary files differ
diff --git a/numpy/doc/swig/doc/numpy_swig.txt b/numpy/doc/swig/doc/numpy_swig.txt
deleted file mode 100644
index bfde018bf..000000000
--- a/numpy/doc/swig/doc/numpy_swig.txt
+++ /dev/null
@@ -1,950 +0,0 @@
-==========================================
- numpy.i: a SWIG Interface File for NumPy
-==========================================
-
-:Author: Bill Spotz
-:Institution: Sandia National Laboratories
-:Date: 1 December, 2007
-
-.. contents::
-
-Introduction
-============
-
-The Simple Wrapper and Interface Generator (or `SWIG
-<http://www.swig.org>`_) is a powerful tool for generating wrapper
-code for interfacing to a wide variety of scripting languages.
-`SWIG`_ can parse header files, and using only the code prototypes,
-create an interface to the target language. But `SWIG`_ is not
-omnipotent. For example, it cannot know from the prototype::
-
- double rms(double* seq, int n);
-
-what exactly ``seq`` is. Is it a single value to be altered in-place?
-Is it an array, and if so what is its length? Is it input-only?
-Output-only? Input-output? `SWIG`_ cannot determine these details,
-and does not attempt to do so.
-
-If we designed ``rms``, we probably made it a routine that takes an
-input-only array of length ``n`` of ``double`` values called ``seq``
-and returns the root mean square. The default behavior of `SWIG`_,
-however, will be to create a wrapper function that compiles, but is
-nearly impossible to use from the scripting language in the way the C
-routine was intended.
-
-For `python <http://www.python.org>`_, the preferred way of handling
-contiguous (or technically, *strided*) blocks of homogeneous data is
-with the module `NumPy <http://numpy.scipy.org>`_, which provides full
-object-oriented access to multidimensial arrays of data. Therefore,
-the most logical `python`_ interface for the ``rms`` function would be
-(including doc string)::
-
- def rms(seq):
- """
- rms: return the root mean square of a sequence
- rms(numpy.ndarray) -> double
- rms(list) -> double
- rms(tuple) -> double
- """
-
-where ``seq`` would be a `NumPy`_ array of ``double`` values, and its
-length ``n`` would be extracted from ``seq`` internally before being
-passed to the C routine. Even better, since `NumPy`_ supports
-construction of arrays from arbitrary `python`_ sequences, ``seq``
-itself could be a nearly arbitrary sequence (so long as each element
-can be converted to a ``double``) and the wrapper code would
-internally convert it to a `NumPy`_ array before extracting its data
-and length.
-
-`SWIG`_ allows these types of conversions to be defined via a
-mechanism called typemaps. This document provides information on how
-to use ``numpy.i``, a `SWIG`_ interface file that defines a series of
-typemaps intended to make the type of array-related conversions
-described above relatively simple to implement. For example, suppose
-that the ``rms`` function prototype defined above was in a header file
-named ``rms.h``. To obtain the `python`_ interface discussed above,
-your `SWIG`_ interface file would need the following::
-
- %{
- #define SWIG_FILE_WITH_INIT
- #include "rms.h"
- %}
-
- %include "numpy.i"
-
- %init %{
- import_array();
- %}
-
- %apply (double* IN_ARRAY1, int DIM1) {(double* seq, int n)};
- %include "rms.h"
-
-Typemaps are keyed off a list of one or more function arguments,
-either by type or by type and name. We will refer to such lists as
-*signatures*. One of the many typemaps defined by ``numpy.i`` is used
-above and has the signature ``(double* IN_ARRAY1, int DIM1)``. The
-argument names are intended to suggest that the ``double*`` argument
-is an input array of one dimension and that the ``int`` represents
-that dimension. This is precisely the pattern in the ``rms``
-prototype.
-
-Most likely, no actual prototypes to be wrapped will have the argument
-names ``IN_ARRAY1`` and ``DIM1``. We use the ``%apply`` directive to
-apply the typemap for one-dimensional input arrays of type ``double``
-to the actual prototype used by ``rms``. Using ``numpy.i``
-effectively, therefore, requires knowing what typemaps are available
-and what they do.
-
-A `SWIG`_ interface file that includes the `SWIG`_ directives given
-above will produce wrapper code that looks something like::
-
- 1 PyObject *_wrap_rms(PyObject *args) {
- 2 PyObject *resultobj = 0;
- 3 double *arg1 = (double *) 0 ;
- 4 int arg2 ;
- 5 double result;
- 6 PyArrayObject *array1 = NULL ;
- 7 int is_new_object1 = 0 ;
- 8 PyObject * obj0 = 0 ;
- 9
- 10 if (!PyArg_ParseTuple(args,(char *)"O:rms",&obj0)) SWIG_fail;
- 11 {
- 12 array1 = obj_to_array_contiguous_allow_conversion(
- 13 obj0, NPY_DOUBLE, &is_new_object1);
- 14 npy_intp size[1] = {
- 15 -1
- 16 };
- 17 if (!array1 || !require_dimensions(array1, 1) ||
- 18 !require_size(array1, size, 1)) SWIG_fail;
- 19 arg1 = (double*) array1->data;
- 20 arg2 = (int) array1->dimensions[0];
- 21 }
- 22 result = (double)rms(arg1,arg2);
- 23 resultobj = SWIG_From_double((double)(result));
- 24 {
- 25 if (is_new_object1 && array1) Py_DECREF(array1);
- 26 }
- 27 return resultobj;
- 28 fail:
- 29 {
- 30 if (is_new_object1 && array1) Py_DECREF(array1);
- 31 }
- 32 return NULL;
- 33 }
-
-The typemaps from ``numpy.i`` are responsible for the following lines
-of code: 12--20, 25 and 30. Line 10 parses the input to the ``rms``
-function. From the format string ``"O:rms"``, we can see that the
-argument list is expected to be a single `python`_ object (specified
-by the ``O`` before the colon) and whose pointer is stored in
-``obj0``. A number of functions, supplied by ``numpy.i``, are called
-to make and check the (possible) conversion from a generic `python`_
-object to a `NumPy`_ array. These functions are explained in the
-section `Helper Functions`_, but hopefully their names are
-self-explanatory. At line 12 we use ``obj0`` to construct a `NumPy`_
-array. At line 17, we check the validity of the result: that it is
-non-null and that it has a single dimension of arbitrary length. Once
-these states are verified, we extract the data buffer and length in
-lines 19 and 20 so that we can call the underlying C function at line
-22. Line 25 performs memory management for the case where we have
-created a new array that is no longer needed.
-
-This code has a significant amount of error handling. Note the
-``SWIG_fail`` is a macro for ``goto fail``, refering to the label at
-line 28. If the user provides the wrong number of arguments, this
-will be caught at line 10. If construction of the `NumPy`_ array
-fails or produces an array with the wrong number of dimensions, these
-errors are caught at line 17. And finally, if an error is detected,
-memory is still managed correctly at line 30.
-
-Note that if the C function signature was in a different order::
-
- double rms(int n, double* seq);
-
-that `SWIG`_ would not match the typemap signature given above with
-the argument list for ``rms``. Fortunately, ``numpy.i`` has a set of
-typemaps with the data pointer given last::
-
- %apply (int DIM1, double* IN_ARRAY1) {(int n, double* seq)};
-
-This simply has the effect of switching the definitions of ``arg1``
-and ``arg2`` in lines 3 and 4 of the generated code above, and their
-assignments in lines 19 and 20.
-
-Using numpy.i
-=============
-
-The ``numpy.i`` file is currently located in the ``numpy/docs/swig``
-sub-directory under the ``numpy`` installation directory. Typically,
-you will want to copy it to the directory where you are developing
-your wrappers. If it is ever adopted by `SWIG`_ developers, then it
-will be installed in a standard place where `SWIG`_ can find it.
-
-A simple module that only uses a single `SWIG`_ interface file should
-include the following::
-
- %{
- #define SWIG_FILE_WITH_INIT
- %}
- %include "numpy.i"
- %init %{
- import_array();
- %}
-
-Within a compiled `python`_ module, ``import_array()`` should only get
-called once. This could be in a C/C++ file that you have written and
-is linked to the module. If this is the case, then none of your
-interface files should ``#define SWIG_FILE_WITH_INIT`` or call
-``import_array()``. Or, this initialization call could be in a
-wrapper file generated by `SWIG`_ from an interface file that has the
-``%init`` block as above. If this is the case, and you have more than
-one `SWIG`_ interface file, then only one interface file should
-``#define SWIG_FILE_WITH_INIT`` and call ``import_array()``.
-
-Available Typemaps
-==================
-
-The typemap directives provided by ``numpy.i`` for arrays of different
-data types, say ``double`` and ``int``, and dimensions of different
-types, say ``int`` or ``long``, are identical to one another except
-for the C and `NumPy`_ type specifications. The typemaps are
-therefore implemented (typically behind the scenes) via a macro::
-
- %numpy_typemaps(DATA_TYPE, DATA_TYPECODE, DIM_TYPE)
-
-that can be invoked for appropriate ``(DATA_TYPE, DATA_TYPECODE,
-DIM_TYPE)`` triplets. For example::
-
- %numpy_typemaps(double, NPY_DOUBLE, int)
- %numpy_typemaps(int, NPY_INT , int)
-
-The ``numpy.i`` interface file uses the ``%numpy_typemaps`` macro to
-implement typemaps for the following C data types and ``int``
-dimension types:
-
- * ``signed char``
- * ``unsigned char``
- * ``short``
- * ``unsigned short``
- * ``int``
- * ``unsigned int``
- * ``long``
- * ``unsigned long``
- * ``long long``
- * ``unsigned long long``
- * ``float``
- * ``double``
-
-In the following descriptions, we reference a generic ``DATA_TYPE``, which
-could be any of the C data types listed above, and ``DIM_TYPE`` which
-should be one of the many types of integers.
-
-The typemap signatures are largely differentiated on the name given to
-the buffer pointer. Names with ``FARRAY`` are for FORTRAN-ordered
-arrays, and names with ``ARRAY`` are for C-ordered (or 1D arrays).
-
-Input Arrays
-------------
-
-Input arrays are defined as arrays of data that are passed into a
-routine but are not altered in-place or returned to the user. The
-`python`_ input array is therefore allowed to be almost any `python`_
-sequence (such as a list) that can be converted to the requested type
-of array. The input array signatures are
-
-1D:
-
- * ``( DATA_TYPE IN_ARRAY1[ANY] )``
- * ``( DATA_TYPE* IN_ARRAY1, int DIM1 )``
- * ``( int DIM1, DATA_TYPE* IN_ARRAY1 )``
-
-2D:
-
- * ``( DATA_TYPE IN_ARRAY2[ANY][ANY] )``
- * ``( DATA_TYPE* IN_ARRAY2, int DIM1, int DIM2 )``
- * ``( int DIM1, int DIM2, DATA_TYPE* IN_ARRAY2 )``
- * ``( DATA_TYPE* IN_FARRAY2, int DIM1, int DIM2 )``
- * ``( int DIM1, int DIM2, DATA_TYPE* IN_FARRAY2 )``
-
-3D:
-
- * ``( DATA_TYPE IN_ARRAY3[ANY][ANY][ANY] )``
- * ``( DATA_TYPE* IN_ARRAY3, int DIM1, int DIM2, int DIM3 )``
- * ``( int DIM1, int DIM2, int DIM3, DATA_TYPE* IN_ARRAY3 )``
- * ``( DATA_TYPE* IN_FARRAY3, int DIM1, int DIM2, int DIM3 )``
- * ``( int DIM1, int DIM2, int DIM3, DATA_TYPE* IN_FARRAY3 )``
-
-The first signature listed, ``( DATA_TYPE IN_ARRAY[ANY] )`` is for
-one-dimensional arrays with hard-coded dimensions. Likewise,
-``( DATA_TYPE IN_ARRAY2[ANY][ANY] )`` is for two-dimensional arrays
-with hard-coded dimensions, and similarly for three-dimensional.
-
-In-Place Arrays
----------------
-
-In-place arrays are defined as arrays that are modified in-place. The
-input values may or may not be used, but the values at the time the
-function returns are significant. The provided `python`_ argument
-must therefore be a `NumPy`_ array of the required type. The in-place
-signatures are
-
-1D:
-
- * ``( DATA_TYPE INPLACE_ARRAY1[ANY] )``
- * ``( DATA_TYPE* INPLACE_ARRAY1, int DIM1 )``
- * ``( int DIM1, DATA_TYPE* INPLACE_ARRAY1 )``
-
-2D:
-
- * ``( DATA_TYPE INPLACE_ARRAY2[ANY][ANY] )``
- * ``( DATA_TYPE* INPLACE_ARRAY2, int DIM1, int DIM2 )``
- * ``( int DIM1, int DIM2, DATA_TYPE* INPLACE_ARRAY2 )``
- * ``( DATA_TYPE* INPLACE_FARRAY2, int DIM1, int DIM2 )``
- * ``( int DIM1, int DIM2, DATA_TYPE* INPLACE_FARRAY2 )``
-
-3D:
-
- * ``( DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY] )``
- * ``( DATA_TYPE* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3 )``
- * ``( int DIM1, int DIM2, int DIM3, DATA_TYPE* INPLACE_ARRAY3 )``
- * ``( DATA_TYPE* INPLACE_FARRAY3, int DIM1, int DIM2, int DIM3 )``
- * ``( int DIM1, int DIM2, int DIM3, DATA_TYPE* INPLACE_FARRAY3 )``
-
-These typemaps now check to make sure that the ``INPLACE_ARRAY``
-arguments use native byte ordering. If not, an exception is raised.
-
-Argout Arrays
--------------
-
-Argout arrays are arrays that appear in the input arguments in C, but
-are in fact output arrays. This pattern occurs often when there is
-more than one output variable and the single return argument is
-therefore not sufficient. In `python`_, the convential way to return
-multiple arguments is to pack them into a sequence (tuple, list, etc.)
-and return the sequence. This is what the argout typemaps do. If a
-wrapped function that uses these argout typemaps has more than one
-return argument, they are packed into a tuple or list, depending on
-the version of `python`_. The `python`_ user does not pass these
-arrays in, they simply get returned. For the case where a dimension
-is specified, the python user must provide that dimension as an
-argument. The argout signatures are
-
-1D:
-
- * ``( DATA_TYPE ARGOUT_ARRAY1[ANY] )``
- * ``( DATA_TYPE* ARGOUT_ARRAY1, int DIM1 )``
- * ``( int DIM1, DATA_TYPE* ARGOUT_ARRAY1 )``
-
-2D:
-
- * ``( DATA_TYPE ARGOUT_ARRAY2[ANY][ANY] )``
-
-3D:
-
- * ``( DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY] )``
-
-These are typically used in situations where in C/C++, you would
-allocate a(n) array(s) on the heap, and call the function to fill the
-array(s) values. In `python`_, the arrays are allocated for you and
-returned as new array objects.
-
-Note that we support ``DATA_TYPE*`` argout typemaps in 1D, but not 2D
-or 3D. This is because of a quirk with the `SWIG`_ typemap syntax and
-cannot be avoided. Note that for these types of 1D typemaps, the
-`python`_ function will take a single argument representing ``DIM1``.
-
-Argoutview Arrays
------------------
-
-Argoutview arrays are for when your C code provides you with a view of
-its internal data and does not require any memory to be allocated by
-the user. This can be dangerous. There is almost no way to guarantee
-that the internal data from the C code will remain in existence for
-the entire lifetime of the `NumPy`_ array that encapsulates it. If
-the user destroys the object that provides the view of the data before
-destroying the `NumPy`_ array, then using that array my result in bad
-memory references or segmentation faults. Nevertheless, there are
-situations, working with large data sets, where you simply have no
-other choice.
-
-The C code to be wrapped for argoutview arrays are characterized by
-pointers: pointers to the dimensions and double pointers to the data,
-so that these values can be passed back to the user. The argoutview
-typemap signatures are therefore
-
-1D:
-
- * ``( DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1 )``
- * ``( DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1 )``
-
-2D:
-
- * ``( DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2 )``
- * ``( DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2 )``
- * ``( DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2 )``
- * ``( DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2 )``
-
-3D:
-
- * ``( DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)``
- * ``( DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3)``
- * ``( DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)``
- * ``( DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)``
-
-Note that arrays with hard-coded dimensions are not supported. These
-cannot follow the double pointer signatures of these typemaps.
-
-Output Arrays
--------------
-
-The ``numpy.i`` interface file does not support typemaps for output
-arrays, for several reasons. First, C/C++ return arguments are
-limited to a single value. This prevents obtaining dimension
-information in a general way. Second, arrays with hard-coded lengths
-are not permitted as return arguments. In other words::
-
- double[3] newVector(double x, double y, double z);
-
-is not legal C/C++ syntax. Therefore, we cannot provide typemaps of
-the form::
-
- %typemap(out) (TYPE[ANY]);
-
-If you run into a situation where a function or method is returning a
-pointer to an array, your best bet is to write your own version of the
-function to be wrapped, either with ``%extend`` for the case of class
-methods or ``%ignore`` and ``%rename`` for the case of functions.
-
-Other Common Types: bool
-------------------------
-
-Note that C++ type ``bool`` is not supported in the list in the
-`Available Typemaps`_ section. NumPy bools are a single byte, while
-the C++ ``bool`` is four bytes (at least on my system). Therefore::
-
- %numpy_typemaps(bool, NPY_BOOL, int)
-
-will result in typemaps that will produce code that reference
-improper data lengths. You can implement the following macro
-expansion::
-
- %numpy_typemaps(bool, NPY_UINT, int)
-
-to fix the data length problem, and `Input Arrays`_ will work fine,
-but `In-Place Arrays`_ might fail type-checking.
-
-Other Common Types: complex
----------------------------
-
-Typemap conversions for complex floating-point types is also not
-supported automatically. This is because `python`_ and `NumPy`_ are
-written in C, which does not have native complex types. Both
-`python`_ and `NumPy`_ implement their own (essentially equivalent)
-``struct`` definitions for complex variables::
-
- /* Python */
- typedef struct {double real; double imag;} Py_complex;
-
- /* NumPy */
- typedef struct {float real, imag;} npy_cfloat;
- typedef struct {double real, imag;} npy_cdouble;
-
-We could have implemented::
-
- %numpy_typemaps(Py_complex , NPY_CDOUBLE, int)
- %numpy_typemaps(npy_cfloat , NPY_CFLOAT , int)
- %numpy_typemaps(npy_cdouble, NPY_CDOUBLE, int)
-
-which would have provided automatic type conversions for arrays of
-type ``Py_complex``, ``npy_cfloat`` and ``npy_cdouble``. However, it
-seemed unlikely that there would be any independent (non-`python`_,
-non-`NumPy`_) application code that people would be using `SWIG`_ to
-generate a `python`_ interface to, that also used these definitions
-for complex types. More likely, these application codes will define
-their own complex types, or in the case of C++, use ``std::complex``.
-Assuming these data structures are compatible with `python`_ and
-`NumPy`_ complex types, ``%numpy_typemap`` expansions as above (with
-the user's complex type substituted for the first argument) should
-work.
-
-NumPy Array Scalars and SWIG
-============================
-
-`SWIG`_ has sophisticated type checking for numerical types. For
-example, if your C/C++ routine expects an integer as input, the code
-generated by `SWIG`_ will check for both `python`_ integers and
-`python`_ long integers, and raise an overflow error if the provided
-`python`_ integer is too big to cast down to a C integer. With the
-introduction of `NumPy`_ scalar arrays into your `python`_ code, you
-might conceivably extract an integer from a `NumPy`_ array and attempt
-to pass this to a `SWIG`_-wrapped C/C++ function that expects an
-``int``, but the `SWIG`_ type checking will not recognize the `NumPy`_
-array scalar as an integer. (Often, this does in fact work -- it
-depends on whether `NumPy`_ recognizes the integer type you are using
-as inheriting from the `python`_ integer type on the platform you are
-using. Sometimes, this means that code that works on a 32-bit machine
-will fail on a 64-bit machine.)
-
-If you get a `python`_ error that looks like the following::
-
- TypeError: in method 'MyClass_MyMethod', argument 2 of type 'int'
-
-and the argument you are passing is an integer extracted from a
-`NumPy`_ array, then you have stumbled upon this problem. The
-solution is to modify the `SWIG`_ type conversion system to accept
-`Numpy`_ array scalars in addition to the standard integer types.
-Fortunately, this capabilitiy has been provided for you. Simply copy
-the file::
-
- pyfragments.swg
-
-to the working build directory for you project, and this problem will
-be fixed. It is suggested that you do this anyway, as it only
-increases the capabilities of your `python`_ interface.
-
-Why is There a Second File?
----------------------------
-
-The `SWIG`_ type checking and conversion system is a complicated
-combination of C macros, `SWIG`_ macros, `SWIG`_ typemaps and `SWIG`_
-fragments. Fragments are a way to conditionally insert code into your
-wrapper file if it is needed, and not insert it if not needed. If
-multiple typemaps require the same fragment, the fragment only gets
-inserted into your wrapper code once.
-
-There is a fragment for converting a `python`_ integer to a C
-``long``. There is a different fragment that converts a `python`_
-integer to a C ``int``, that calls the rountine defined in the
-``long`` fragment. We can make the changes we want here by changing
-the definition for the ``long`` fragment. `SWIG`_ determines the
-active definition for a fragment using a "first come, first served"
-system. That is, we need to define the fragment for ``long``
-conversions prior to `SWIG`_ doing it internally. `SWIG`_ allows us
-to do this by putting our fragment definitions in the file
-``pyfragments.swg``. If we were to put the new fragment definitions
-in ``numpy.i``, they would be ignored.
-
-Helper Functions
-================
-
-The ``numpy.i`` file containes several macros and routines that it
-uses internally to build its typemaps. However, these functions may
-be useful elsewhere in your interface file. These macros and routines
-are implemented as fragments, which are described briefly in the
-previous section. If you try to use one or more of the following
-macros or functions, but your compiler complains that it does not
-recognize the symbol, then you need to force these fragments to appear
-in your code using::
-
- %fragment("NumPy_Fragments");
-
-in your `SWIG`_ interface file.
-
-Macros
-------
-
- **is_array(a)**
- Evaluates as true if ``a`` is non-``NULL`` and can be cast to a
- ``PyArrayObject*``.
-
- **array_type(a)**
- Evaluates to the integer data type code of ``a``, assuming ``a`` can
- be cast to a ``PyArrayObject*``.
-
- **array_numdims(a)**
- Evaluates to the integer number of dimensions of ``a``, assuming
- ``a`` can be cast to a ``PyArrayObject*``.
-
- **array_dimensions(a)**
- Evaluates to an array of type ``npy_intp`` and length
- ``array_numdims(a)``, giving the lengths of all of the dimensions
- of ``a``, assuming ``a`` can be cast to a ``PyArrayObject*``.
-
- **array_size(a,i)**
- Evaluates to the ``i``-th dimension size of ``a``, assuming ``a``
- can be cast to a ``PyArrayObject*``.
-
- **array_data(a)**
- Evaluates to a pointer of type ``void*`` that points to the data
- buffer of ``a``, assuming ``a`` can be cast to a ``PyArrayObject*``.
-
- **array_is_contiguous(a)**
- Evaluates as true if ``a`` is a contiguous array. Equivalent to
- ``(PyArray_ISCONTIGUOUS(a))``.
-
- **array_is_native(a)**
- Evaluates as true if the data buffer of ``a`` uses native byte
- order. Equivalent to ``(PyArray_ISNOTSWAPPED(a))``.
-
- **array_is_fortran(a)**
- Evaluates as true if ``a`` is FORTRAN ordered.
-
-Routines
---------
-
- **pytype_string()**
-
- Return type: ``char*``
-
- Arguments:
-
- * ``PyObject* py_obj``, a general `python`_ object.
-
- Return a string describing the type of ``py_obj``.
-
-
- **typecode_string()**
-
- Return type: ``char*``
-
- Arguments:
-
- * ``int typecode``, a `NumPy`_ integer typecode.
-
- Return a string describing the type corresponding to the `NumPy`_
- ``typecode``.
-
- **type_match()**
-
- Return type: ``int``
-
- Arguments:
-
- * ``int actual_type``, the `NumPy`_ typecode of a `NumPy`_ array.
-
- * ``int desired_type``, the desired `NumPy`_ typecode.
-
- Make sure that ``actual_type`` is compatible with
- ``desired_type``. For example, this allows character and
- byte types, or int and long types, to match. This is now
- equivalent to ``PyArray_EquivTypenums()``.
-
-
- **obj_to_array_no_conversion()**
-
- Return type: ``PyArrayObject*``
-
- Arguments:
-
- * ``PyObject* input``, a general `python`_ object.
-
- * ``int typecode``, the desired `NumPy`_ typecode.
-
- Cast ``input`` to a ``PyArrayObject*`` if legal, and ensure that
- it is of type ``typecode``. If ``input`` cannot be cast, or the
- ``typecode`` is wrong, set a `python`_ error and return ``NULL``.
-
-
- **obj_to_array_allow_conversion()**
-
- Return type: ``PyArrayObject*``
-
- Arguments:
-
- * ``PyObject* input``, a general `python`_ object.
-
- * ``int typecode``, the desired `NumPy`_ typecode of the resulting
- array.
-
- * ``int* is_new_object``, returns a value of 0 if no conversion
- performed, else 1.
-
- Convert ``input`` to a `NumPy`_ array with the given ``typecode``.
- On success, return a valid ``PyArrayObject*`` with the correct
- type. On failure, the `python`_ error string will be set and the
- routine returns ``NULL``.
-
-
- **make_contiguous()**
-
- Return type: ``PyArrayObject*``
-
- Arguments:
-
- * ``PyArrayObject* ary``, a `NumPy`_ array.
-
- * ``int* is_new_object``, returns a value of 0 if no conversion
- performed, else 1.
-
- * ``int min_dims``, minimum allowable dimensions.
-
- * ``int max_dims``, maximum allowable dimensions.
-
- Check to see if ``ary`` is contiguous. If so, return the input
- pointer and flag it as not a new object. If it is not contiguous,
- create a new ``PyArrayObject*`` using the original data, flag it
- as a new object and return the pointer.
-
-
- **obj_to_array_contiguous_allow_conversion()**
-
- Return type: ``PyArrayObject*``
-
- Arguments:
-
- * ``PyObject* input``, a general `python`_ object.
-
- * ``int typecode``, the desired `NumPy`_ typecode of the resulting
- array.
-
- * ``int* is_new_object``, returns a value of 0 if no conversion
- performed, else 1.
-
- Convert ``input`` to a contiguous ``PyArrayObject*`` of the
- specified type. If the input object is not a contiguous
- ``PyArrayObject*``, a new one will be created and the new object
- flag will be set.
-
-
- **require_contiguous()**
-
- Return type: ``int``
-
- Arguments:
-
- * ``PyArrayObject* ary``, a `NumPy`_ array.
-
- Test whether ``ary`` is contiguous. If so, return 1. Otherwise,
- set a `python`_ error and return 0.
-
-
- **require_native()**
-
- Return type: ``int``
-
- Arguments:
-
- * ``PyArray_Object* ary``, a `NumPy`_ array.
-
- Require that ``ary`` is not byte-swapped. If the array is not
- byte-swapped, return 1. Otherwise, set a `python`_ error and
- return 0.
-
- **require_dimensions()**
-
- Return type: ``int``
-
- Arguments:
-
- * ``PyArrayObject* ary``, a `NumPy`_ array.
-
- * ``int exact_dimensions``, the desired number of dimensions.
-
- Require ``ary`` to have a specified number of dimensions. If the
- array has the specified number of dimensions, return 1.
- Otherwise, set a `python`_ error and return 0.
-
-
- **require_dimensions_n()**
-
- Return type: ``int``
-
- Arguments:
-
- * ``PyArrayObject* ary``, a `NumPy`_ array.
-
- * ``int* exact_dimensions``, an array of integers representing
- acceptable numbers of dimensions.
-
- * ``int n``, the length of ``exact_dimensions``.
-
- Require ``ary`` to have one of a list of specified number of
- dimensions. If the array has one of the specified number of
- dimensions, return 1. Otherwise, set the `python`_ error string
- and return 0.
-
-
- **require_size()**
-
- Return type: ``int``
-
- Arguments:
-
- * ``PyArrayObject* ary``, a `NumPy`_ array.
-
- * ``npy_int* size``, an array representing the desired lengths of
- each dimension.
-
- * ``int n``, the length of ``size``.
-
- Require ``ary`` to have a specified shape. If the array has the
- specified shape, return 1. Otherwise, set the `python`_ error
- string and return 0.
-
-
- **require_fortran()**
-
- Return type: ``int``
-
- Arguments:
-
- * ``PyArrayObject* ary``, a `NumPy`_ array.
-
- Require the given ``PyArrayObject`` to to be FORTRAN ordered. If
- the the ``PyArrayObject`` is already FORTRAN ordered, do nothing.
- Else, set the FORTRAN ordering flag and recompute the strides.
-
-
-Beyond the Provided Typemaps
-============================
-
-There are many C or C++ array/`NumPy`_ array situations not covered by
-a simple ``%include "numpy.i"`` and subsequent ``%apply`` directives.
-
-A Common Example
-----------------
-
-Consider a reasonable prototype for a dot product function::
-
- double dot(int len, double* vec1, double* vec2);
-
-The `python`_ interface that we want is::
-
- def dot(vec1, vec2):
- """
- dot(PyObject,PyObject) -> double
- """
-
-The problem here is that there is one dimension argument and two array
-arguments, and our typemaps are set up for dimensions that apply to a
-single array (in fact, `SWIG`_ does not provide a mechanism for
-associating ``len`` with ``vec2`` that takes two `python`_ input
-arguments). The recommended solution is the following::
-
- %apply (int DIM1, double* IN_ARRAY1) {(int len1, double* vec1),
- (int len2, double* vec2)}
- %rename (dot) my_dot;
- %exception my_dot {
- $action
- if (PyErr_Occurred()) SWIG_fail;
- }
- %inline %{
- double my_dot(int len1, double* vec1, int len2, double* vec2) {
- if (len1 != len2) {
- PyErr_Format(PyExc_ValueError,
- "Arrays of lengths (%d,%d) given",
- len1, len2);
- return 0.0;
- }
- return dot(len1, vec1, vec2);
- }
- %}
-
-If the header file that contains the prototype for ``double dot()``
-also contains other prototypes that you want to wrap, so that you need
-to ``%include`` this header file, then you will also need a ``%ignore
-dot;`` directive, placed after the ``%rename`` and before the
-``%include`` directives. Or, if the function in question is a class
-method, you will want to use ``%extend`` rather than ``%inline`` in
-addition to ``%ignore``.
-
-**A note on error handling:** Note that ``my_dot`` returns a
-``double`` but that it can also raise a `python`_ error. The
-resulting wrapper function will return a `python`_ float
-representation of 0.0 when the vector lengths do not match. Since
-this is not ``NULL``, the `python`_ interpreter will not know to check
-for an error. For this reason, we add the ``%exception`` directive
-above for ``my_dot`` to get the behavior we want (note that
-``$action`` is a macro that gets expanded to a valid call to
-``my_dot``). In general, you will probably want to write a `SWIG`_
-macro to perform this task.
-
-Other Situations
-----------------
-
-There are other wrapping situations in which ``numpy.i`` may be
-helpful when you encounter them.
-
- * In some situations, it is possible that you could use the
- ``%numpy_templates`` macro to implement typemaps for your own
- types. See the `Other Common Types: bool`_ or `Other Common
- Types: complex`_ sections for examples. Another situation is if
- your dimensions are of a type other than ``int`` (say ``long`` for
- example)::
-
- %numpy_typemaps(double, NPY_DOUBLE, long)
-
- * You can use the code in ``numpy.i`` to write your own typemaps.
- For example, if you had a four-dimensional array as a function
- argument, you could cut-and-paste the appropriate
- three-dimensional typemaps into your interface file. The
- modifications for the fourth dimension would be trivial.
-
- * Sometimes, the best approach is to use the ``%extend`` directive
- to define new methods for your classes (or overload existing ones)
- that take a ``PyObject*`` (that either is or can be converted to a
- ``PyArrayObject*``) instead of a pointer to a buffer. In this
- case, the helper routines in ``numpy.i`` can be very useful.
-
- * Writing typemaps can be a bit nonintuitive. If you have specific
- questions about writing `SWIG`_ typemaps for `NumPy`_, the
- developers of ``numpy.i`` do monitor the
- `Numpy-discussion <mailto:Numpy-discussion@scipy.org>`_ and
- `Swig-user <mailto:Swig-user@lists.sourceforge.net>`_ mail lists.
-
-A Final Note
-------------
-
-When you use the ``%apply`` directive, as is usually necessary to use
-``numpy.i``, it will remain in effect until you tell `SWIG`_ that it
-shouldn't be. If the arguments to the functions or methods that you
-are wrapping have common names, such as ``length`` or ``vector``,
-these typemaps may get applied in situations you do not expect or
-want. Therefore, it is always a good idea to add a ``%clear``
-directive after you are done with a specific typemap::
-
- %apply (double* IN_ARRAY1, int DIM1) {(double* vector, int length)}
- %include "my_header.h"
- %clear (double* vector, int length);
-
-In general, you should target these typemap signatures specifically
-where you want them, and then clear them after you are done.
-
-Summary
-=======
-
-Out of the box, ``numpy.i`` provides typemaps that support conversion
-between `NumPy`_ arrays and C arrays:
-
- * That can be one of 12 different scalar types: ``signed char``,
- ``unsigned char``, ``short``, ``unsigned short``, ``int``,
- ``unsigned int``, ``long``, ``unsigned long``, ``long long``,
- ``unsigned long long``, ``float`` and ``double``.
-
- * That support 41 different argument signatures for each data type,
- including:
-
- + One-dimensional, two-dimensional and three-dimensional arrays.
-
- + Input-only, in-place, argout and argoutview behavior.
-
- + Hard-coded dimensions, data-buffer-then-dimensions
- specification, and dimensions-then-data-buffer specification.
-
- + Both C-ordering ("last dimension fastest") or FORTRAN-ordering
- ("first dimension fastest") support for 2D and 3D arrays.
-
-The ``numpy.i`` interface file also provides additional tools for
-wrapper developers, including:
-
- * A `SWIG`_ macro (``%numpy_typemaps``) with three arguments for
- implementing the 41 argument signatures for the user's choice of
- (1) C data type, (2) `NumPy`_ data type (assuming they match), and
- (3) dimension type.
-
- * Nine C macros and 13 C functions that can be used to write
- specialized typemaps, extensions, or inlined functions that handle
- cases not covered by the provided typemaps.
-
-Acknowledgements
-================
-
-Many people have worked to glue `SWIG`_ and `NumPy`_ together (as well
-as `SWIG`_ and the predecessors of `NumPy`_, Numeric and numarray).
-The effort to standardize this work into ``numpy.i`` began at the 2005
-`SciPy <http://scipy.org>`_ Conference with a conversation between
-Fernando Perez and myself. Fernando collected helper functions and
-typemaps from Eric Jones, Michael Hunter, Anna Omelchenko and Michael
-Sanner. Sebastian Hasse and Georg Holzmann have also provided
-additional error checking and use cases. The work of these
-contributors has made this end result possible.
diff --git a/numpy/doc/swig/doc/testing.html b/numpy/doc/swig/doc/testing.html
deleted file mode 100644
index 3622550df..000000000
--- a/numpy/doc/swig/doc/testing.html
+++ /dev/null
@@ -1,482 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
-<title>Testing the numpy.i Typemaps</title>
-<meta name="author" content="Bill Spotz" />
-<meta name="date" content="6 April, 2007" />
-<style type="text/css">
-
-/*
-:Author: David Goodger
-:Contact: goodger@users.sourceforge.net
-:Date: $Date: 2005-12-18 01:56:14 +0100 (Sun, 18 Dec 2005) $
-:Revision: $Revision: 4224 $
-:Copyright: This stylesheet has been placed in the public domain.
-
-Default cascading style sheet for the HTML output of Docutils.
-
-See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
-customize this style sheet.
-*/
-
-/* used to remove borders from tables and images */
-.borderless, table.borderless td, table.borderless th {
- border: 0 }
-
-table.borderless td, table.borderless th {
- /* Override padding for "table.docutils td" with "! important".
- The right padding separates the table cells. */
- padding: 0 0.5em 0 0 ! important }
-
-.first {
- /* Override more specific margin styles with "! important". */
- margin-top: 0 ! important }
-
-.last, .with-subtitle {
- margin-bottom: 0 ! important }
-
-.hidden {
- display: none }
-
-a.toc-backref {
- text-decoration: none ;
- color: black }
-
-blockquote.epigraph {
- margin: 2em 5em ; }
-
-dl.docutils dd {
- margin-bottom: 0.5em }
-
-/* Uncomment (and remove this text!) to get bold-faced definition list terms
-dl.docutils dt {
- font-weight: bold }
-*/
-
-div.abstract {
- margin: 2em 5em }
-
-div.abstract p.topic-title {
- font-weight: bold ;
- text-align: center }
-
-div.admonition, div.attention, div.caution, div.danger, div.error,
-div.hint, div.important, div.note, div.tip, div.warning {
- margin: 2em ;
- border: medium outset ;
- padding: 1em }
-
-div.admonition p.admonition-title, div.hint p.admonition-title,
-div.important p.admonition-title, div.note p.admonition-title,
-div.tip p.admonition-title {
- font-weight: bold ;
- font-family: sans-serif }
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
- color: red ;
- font-weight: bold ;
- font-family: sans-serif }
-
-/* Uncomment (and remove this text!) to get reduced vertical space in
- compound paragraphs.
-div.compound .compound-first, div.compound .compound-middle {
- margin-bottom: 0.5em }
-
-div.compound .compound-last, div.compound .compound-middle {
- margin-top: 0.5em }
-*/
-
-div.dedication {
- margin: 2em 5em ;
- text-align: center ;
- font-style: italic }
-
-div.dedication p.topic-title {
- font-weight: bold ;
- font-style: normal }
-
-div.figure {
- margin-left: 2em ;
- margin-right: 2em }
-
-div.footer, div.header {
- clear: both;
- font-size: smaller }
-
-div.line-block {
- display: block ;
- margin-top: 1em ;
- margin-bottom: 1em }
-
-div.line-block div.line-block {
- margin-top: 0 ;
- margin-bottom: 0 ;
- margin-left: 1.5em }
-
-div.sidebar {
- margin-left: 1em ;
- border: medium outset ;
- padding: 1em ;
- background-color: #ffffee ;
- width: 40% ;
- float: right ;
- clear: right }
-
-div.sidebar p.rubric {
- font-family: sans-serif ;
- font-size: medium }
-
-div.system-messages {
- margin: 5em }
-
-div.system-messages h1 {
- color: red }
-
-div.system-message {
- border: medium outset ;
- padding: 1em }
-
-div.system-message p.system-message-title {
- color: red ;
- font-weight: bold }
-
-div.topic {
- margin: 2em }
-
-h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
-h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
- margin-top: 0.4em }
-
-h1.title {
- text-align: center }
-
-h2.subtitle {
- text-align: center }
-
-hr.docutils {
- width: 75% }
-
-img.align-left {
- clear: left }
-
-img.align-right {
- clear: right }
-
-ol.simple, ul.simple {
- margin-bottom: 1em }
-
-ol.arabic {
- list-style: decimal }
-
-ol.loweralpha {
- list-style: lower-alpha }
-
-ol.upperalpha {
- list-style: upper-alpha }
-
-ol.lowerroman {
- list-style: lower-roman }
-
-ol.upperroman {
- list-style: upper-roman }
-
-p.attribution {
- text-align: right ;
- margin-left: 50% }
-
-p.caption {
- font-style: italic }
-
-p.credits {
- font-style: italic ;
- font-size: smaller }
-
-p.label {
- white-space: nowrap }
-
-p.rubric {
- font-weight: bold ;
- font-size: larger ;
- color: maroon ;
- text-align: center }
-
-p.sidebar-title {
- font-family: sans-serif ;
- font-weight: bold ;
- font-size: larger }
-
-p.sidebar-subtitle {
- font-family: sans-serif ;
- font-weight: bold }
-
-p.topic-title {
- font-weight: bold }
-
-pre.address {
- margin-bottom: 0 ;
- margin-top: 0 ;
- font-family: serif ;
- font-size: 100% }
-
-pre.literal-block, pre.doctest-block {
- margin-left: 2em ;
- margin-right: 2em ;
- background-color: #eeeeee }
-
-span.classifier {
- font-family: sans-serif ;
- font-style: oblique }
-
-span.classifier-delimiter {
- font-family: sans-serif ;
- font-weight: bold }
-
-span.interpreted {
- font-family: sans-serif }
-
-span.option {
- white-space: nowrap }
-
-span.pre {
- white-space: pre }
-
-span.problematic {
- color: red }
-
-span.section-subtitle {
- /* font-size relative to parent (h1..h6 element) */
- font-size: 80% }
-
-table.citation {
- border-left: solid 1px gray;
- margin-left: 1px }
-
-table.docinfo {
- margin: 2em 4em }
-
-table.docutils {
- margin-top: 0.5em ;
- margin-bottom: 0.5em }
-
-table.footnote {
- border-left: solid 1px black;
- margin-left: 1px }
-
-table.docutils td, table.docutils th,
-table.docinfo td, table.docinfo th {
- padding-left: 0.5em ;
- padding-right: 0.5em ;
- vertical-align: top }
-
-table.docutils th.field-name, table.docinfo th.docinfo-name {
- font-weight: bold ;
- text-align: left ;
- white-space: nowrap ;
- padding-left: 0 }
-
-h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
-h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
- font-size: 100% }
-
-tt.docutils {
- background-color: #eeeeee }
-
-ul.auto-toc {
- list-style-type: none }
-
-</style>
-</head>
-<body>
-<div class="document" id="testing-the-numpy-i-typemaps">
-<h1 class="title">Testing the numpy.i Typemaps</h1>
-<table class="docinfo" frame="void" rules="none">
-<col class="docinfo-name" />
-<col class="docinfo-content" />
-<tbody valign="top">
-<tr><th class="docinfo-name">Author:</th>
-<td>Bill Spotz</td></tr>
-<tr class="field"><th class="docinfo-name">Institution:</th><td class="field-body">Sandia National Laboratories</td>
-</tr>
-<tr><th class="docinfo-name">Date:</th>
-<td>6 April, 2007</td></tr>
-</tbody>
-</table>
-<div class="contents topic">
-<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
-<ul class="simple">
-<li><a class="reference" href="#introduction" id="id1" name="id1">Introduction</a></li>
-<li><a class="reference" href="#testing-organization" id="id2" name="id2">Testing Organization</a></li>
-<li><a class="reference" href="#testing-header-files" id="id3" name="id3">Testing Header Files</a></li>
-<li><a class="reference" href="#testing-source-files" id="id4" name="id4">Testing Source Files</a></li>
-<li><a class="reference" href="#testing-swig-interface-files" id="id5" name="id5">Testing SWIG Interface Files</a></li>
-<li><a class="reference" href="#testing-python-scripts" id="id6" name="id6">Testing Python Scripts</a></li>
-</ul>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id1" id="introduction" name="introduction">Introduction</a></h1>
-<p>Writing tests for the <tt class="docutils literal"><span class="pre">numpy.i</span></tt> <a class="reference" href="http://www.swig.org">SWIG</a>
-interface file is a combinatorial headache. At present, 12 different
-data types are supported, each with 23 different argument signatures,
-for a total of 276 typemaps supported &quot;out of the box&quot;. Each of these
-typemaps, in turn, might require several unit tests in order to verify
-expected behavior for both proper and improper inputs. Currently,
-this results in 1,020 individual unit tests that are performed when
-<tt class="docutils literal"><span class="pre">make</span> <span class="pre">test</span></tt> is run in the <tt class="docutils literal"><span class="pre">numpy/docs/swig</span></tt> subdirectory.</p>
-<p>To facilitate this many similar unit tests, some high-level
-programming techniques are employed, including C and <a class="reference" href="http://www.swig.org">SWIG</a> macros,
-as well as <a class="reference" href="http://www.python.org">python</a> inheritance. The
-purpose of this document is to describe the testing infrastructure
-employed to verify that the <tt class="docutils literal"><span class="pre">numpy.i</span></tt> typemaps are working as
-expected.</p>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id2" id="testing-organization" name="testing-organization">Testing Organization</a></h1>
-<p>There are three indepedent testing frameworks supported, for one-,
-two-, and three-dimensional arrays respectively. For one-dimensional
-arrays, there are two C++ files, a header and a source, named:</p>
-<pre class="literal-block">
-Vector.h
-Vector.cxx
-</pre>
-<p>that contain prototypes and code for a variety of functions that have
-one-dimensional arrays as function arguments. The file:</p>
-<pre class="literal-block">
-Vector.i
-</pre>
-<p>is a <a class="reference" href="http://www.swig.org">SWIG</a> interface file that defines a python module <tt class="docutils literal"><span class="pre">Vector</span></tt>
-that wraps the functions in <tt class="docutils literal"><span class="pre">Vector.h</span></tt> while utilizing the typemaps
-in <tt class="docutils literal"><span class="pre">numpy.i</span></tt> to correctly handle the C arrays.</p>
-<p>The <tt class="docutils literal"><span class="pre">Makefile</span></tt> calls <tt class="docutils literal"><span class="pre">swig</span></tt> to generate <tt class="docutils literal"><span class="pre">Vector.py</span></tt> and
-<tt class="docutils literal"><span class="pre">Vector_wrap.cxx</span></tt>, and also executes the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script that
-compiles <tt class="docutils literal"><span class="pre">Vector_wrap.cxx</span></tt> and links together the extension module
-<tt class="docutils literal"><span class="pre">_Vector.so</span></tt> or <tt class="docutils literal"><span class="pre">_Vector.dylib</span></tt>, depending on the platform. This
-extension module and the proxy file <tt class="docutils literal"><span class="pre">Vector.py</span></tt> are both placed in a
-subdirectory under the <tt class="docutils literal"><span class="pre">build</span></tt> directory.</p>
-<p>The actual testing takes place with a <a class="reference" href="http://www.python.org">python</a> script named:</p>
-<pre class="literal-block">
-testVector.py
-</pre>
-<p>that uses the standard <a class="reference" href="http://www.python.org">python</a> library module <tt class="docutils literal"><span class="pre">unittest</span></tt>, which
-performs several tests of each function defined in <tt class="docutils literal"><span class="pre">Vector.h</span></tt> for
-each data type supported.</p>
-<p>Two-dimensional arrays are tested in exactly the same manner. The
-above description applies, but with <tt class="docutils literal"><span class="pre">Matrix</span></tt> substituted for
-<tt class="docutils literal"><span class="pre">Vector</span></tt>. For three-dimensional tests, substitute <tt class="docutils literal"><span class="pre">Tensor</span></tt> for
-<tt class="docutils literal"><span class="pre">Vector</span></tt>. For the descriptions that follow, we will reference the
-<tt class="docutils literal"><span class="pre">Vector</span></tt> tests, but the same information applies to <tt class="docutils literal"><span class="pre">Matrix</span></tt> and
-<tt class="docutils literal"><span class="pre">Tensor</span></tt> tests.</p>
-<p>The command <tt class="docutils literal"><span class="pre">make</span> <span class="pre">test</span></tt> will ensure that all of the test software is
-built and then run all three test scripts.</p>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id3" id="testing-header-files" name="testing-header-files">Testing Header Files</a></h1>
-<p><tt class="docutils literal"><span class="pre">Vector.h</span></tt> is a C++ header file that defines a C macro called
-<tt class="docutils literal"><span class="pre">TEST_FUNC_PROTOS</span></tt> that takes two arguments: <tt class="docutils literal"><span class="pre">TYPE</span></tt>, which is a
-data type name such as <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt>; and <tt class="docutils literal"><span class="pre">SNAME</span></tt>, which is a
-short name for the same data type with no spaces, e.g. <tt class="docutils literal"><span class="pre">uint</span></tt>. This
-macro defines several function prototypes that have the prefix
-<tt class="docutils literal"><span class="pre">SNAME</span></tt> and have at least one argument that is an array of type
-<tt class="docutils literal"><span class="pre">TYPE</span></tt>. Those functions that have return arguments return a
-<tt class="docutils literal"><span class="pre">TYPE</span></tt> value.</p>
-<p><tt class="docutils literal"><span class="pre">TEST_FUNC_PROTOS</span></tt> is then implemented for all of the data types
-supported by <tt class="docutils literal"><span class="pre">numpy.i</span></tt>:</p>
-<blockquote>
-<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">signed</span> <span class="pre">char</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">char</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">short</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">short</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">int</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">long</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">long</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">long</span> <span class="pre">long</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">long</span> <span class="pre">long</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">float</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">double</span></tt></li>
-</ul>
-</blockquote>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id4" id="testing-source-files" name="testing-source-files">Testing Source Files</a></h1>
-<p><tt class="docutils literal"><span class="pre">Vector.cxx</span></tt> is a C++ source file that implements compilable code
-for each of the function prototypes specified in <tt class="docutils literal"><span class="pre">Vector.h</span></tt>. It
-defines a C macro <tt class="docutils literal"><span class="pre">TEST_FUNCS</span></tt> that has the same arguments and works
-in the same way as <tt class="docutils literal"><span class="pre">TEST_FUNC_PROTOS</span></tt> does in <tt class="docutils literal"><span class="pre">Vector.h</span></tt>.
-<tt class="docutils literal"><span class="pre">TEST_FUNCS</span></tt> is implemented for each of the 12 data types as above.</p>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id5" id="testing-swig-interface-files" name="testing-swig-interface-files">Testing SWIG Interface Files</a></h1>
-<p><tt class="docutils literal"><span class="pre">Vector.i</span></tt> is a <a class="reference" href="http://www.swig.org">SWIG</a> interface file that defines python module
-<tt class="docutils literal"><span class="pre">Vector</span></tt>. It follows the conventions for using <tt class="docutils literal"><span class="pre">numpy.i</span></tt> as
-described in the <a class="reference" href="numpy_swig.html">numpy.i documentation</a>. It
-defines a <a class="reference" href="http://www.swig.org">SWIG</a> macro <tt class="docutils literal"><span class="pre">%apply_numpy_typemaps</span></tt> that has a single
-argument <tt class="docutils literal"><span class="pre">TYPE</span></tt>. It uses the <a class="reference" href="http://www.swig.org">SWIG</a> directive <tt class="docutils literal"><span class="pre">%apply</span></tt> as
-described in the <a class="reference" href="numpy_swig.html">numpy.i documentation</a> to apply the provided
-typemaps to the argument signatures found in <tt class="docutils literal"><span class="pre">Vector.h</span></tt>. This macro
-is then implemented for all of the data types supported by
-<tt class="docutils literal"><span class="pre">numpy.i</span></tt>. It then does a <tt class="docutils literal"><span class="pre">%include</span> <span class="pre">&quot;Vector.h&quot;</span></tt> to wrap all of
-the function prototypes in <tt class="docutils literal"><span class="pre">Vector.h</span></tt> using the typemaps in
-<tt class="docutils literal"><span class="pre">numpy.i</span></tt>.</p>
-</div>
-<div class="section">
-<h1><a class="toc-backref" href="#id6" id="testing-python-scripts" name="testing-python-scripts">Testing Python Scripts</a></h1>
-<p>After <tt class="docutils literal"><span class="pre">make</span></tt> is used to build the testing extension modules,
-<tt class="docutils literal"><span class="pre">testVector.py</span></tt> can be run to execute the tests. As with other
-scripts that use <tt class="docutils literal"><span class="pre">unittest</span></tt> to facilitate unit testing,
-<tt class="docutils literal"><span class="pre">testVector.py</span></tt> defines a class that inherits from
-<tt class="docutils literal"><span class="pre">unittest.TestCase</span></tt>:</p>
-<pre class="literal-block">
-class VectorTestCase(unittest.TestCase):
-</pre>
-<p>However, this class is not run directly. Rather, it serves as a base
-class to several other python classes, each one specific to a
-particular data type. The <tt class="docutils literal"><span class="pre">VectorTestCase</span></tt> class stores two strings
-for typing information:</p>
-<blockquote>
-<dl class="docutils">
-<dt><strong>self.typeStr</strong></dt>
-<dd>A string that matches one of the <tt class="docutils literal"><span class="pre">SNAME</span></tt> prefixes used in
-<tt class="docutils literal"><span class="pre">Vector.h</span></tt> and <tt class="docutils literal"><span class="pre">Vector.cxx</span></tt>. For example, <tt class="docutils literal"><span class="pre">&quot;double&quot;</span></tt>.</dd>
-<dt><strong>self.typeCode</strong></dt>
-<dd>A short (typically single-character) string that represents a
-data type in numpy and corresponds to <tt class="docutils literal"><span class="pre">self.typeStr</span></tt>. For
-example, if <tt class="docutils literal"><span class="pre">self.typeStr</span></tt> is <tt class="docutils literal"><span class="pre">&quot;double&quot;</span></tt>, then
-<tt class="docutils literal"><span class="pre">self.typeCode</span></tt> should be <tt class="docutils literal"><span class="pre">&quot;d&quot;</span></tt>.</dd>
-</dl>
-</blockquote>
-<p>Each test defined by the <tt class="docutils literal"><span class="pre">VectorTestCase</span></tt> class extracts the python
-function it is trying to test by accessing the <tt class="docutils literal"><span class="pre">Vector</span></tt> module's
-dictionary:</p>
-<pre class="literal-block">
-length = Vector.__dict__[self.typeStr + &quot;Length&quot;]
-</pre>
-<p>In the case of double precision tests, this will return the python
-function <tt class="docutils literal"><span class="pre">Vector.doubleLength</span></tt>.</p>
-<p>We then define a new test case class for each supported data type with
-a short definition such as:</p>
-<pre class="literal-block">
-class doubleTestCase(VectorTestCase):
- def __init__(self, methodName=&quot;runTest&quot;):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = &quot;double&quot;
- self.typeCode = &quot;d&quot;
-</pre>
-<p>Each of these 12 classes is collected into a <tt class="docutils literal"><span class="pre">unittest.TestSuite</span></tt>,
-which is then executed. Errors and failures are summed together and
-returned as the exit argument. Any non-zero result indicates that at
-least one test did not pass.</p>
-</div>
-</div>
-<div class="footer">
-<hr class="footer" />
-Generated on: 2007-04-06 21:21 UTC.
-Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
-
-</div>
-</body>
-</html>
diff --git a/numpy/doc/swig/doc/testing.pdf b/numpy/doc/swig/doc/testing.pdf
deleted file mode 100644
index 9ffcf7575..000000000
--- a/numpy/doc/swig/doc/testing.pdf
+++ /dev/null
Binary files differ
diff --git a/numpy/doc/swig/doc/testing.txt b/numpy/doc/swig/doc/testing.txt
deleted file mode 100644
index bfd5218e8..000000000
--- a/numpy/doc/swig/doc/testing.txt
+++ /dev/null
@@ -1,173 +0,0 @@
-============================
-Testing the numpy.i Typemaps
-============================
-
-:Author: Bill Spotz
-:Institution: Sandia National Laboratories
-:Date: 6 April, 2007
-
-.. contents::
-
-Introduction
-============
-
-Writing tests for the ``numpy.i`` `SWIG <http://www.swig.org>`_
-interface file is a combinatorial headache. At present, 12 different
-data types are supported, each with 23 different argument signatures,
-for a total of 276 typemaps supported "out of the box". Each of these
-typemaps, in turn, might require several unit tests in order to verify
-expected behavior for both proper and improper inputs. Currently,
-this results in 1,020 individual unit tests that are performed when
-``make test`` is run in the ``numpy/docs/swig`` subdirectory.
-
-To facilitate this many similar unit tests, some high-level
-programming techniques are employed, including C and `SWIG`_ macros,
-as well as `python <http://www.python.org>`_ inheritance. The
-purpose of this document is to describe the testing infrastructure
-employed to verify that the ``numpy.i`` typemaps are working as
-expected.
-
-Testing Organization
-====================
-
-There are three indepedent testing frameworks supported, for one-,
-two-, and three-dimensional arrays respectively. For one-dimensional
-arrays, there are two C++ files, a header and a source, named::
-
- Vector.h
- Vector.cxx
-
-that contain prototypes and code for a variety of functions that have
-one-dimensional arrays as function arguments. The file::
-
- Vector.i
-
-is a `SWIG`_ interface file that defines a python module ``Vector``
-that wraps the functions in ``Vector.h`` while utilizing the typemaps
-in ``numpy.i`` to correctly handle the C arrays.
-
-The ``Makefile`` calls ``swig`` to generate ``Vector.py`` and
-``Vector_wrap.cxx``, and also executes the ``setup.py`` script that
-compiles ``Vector_wrap.cxx`` and links together the extension module
-``_Vector.so`` or ``_Vector.dylib``, depending on the platform. This
-extension module and the proxy file ``Vector.py`` are both placed in a
-subdirectory under the ``build`` directory.
-
-The actual testing takes place with a `python`_ script named::
-
- testVector.py
-
-that uses the standard `python`_ library module ``unittest``, which
-performs several tests of each function defined in ``Vector.h`` for
-each data type supported.
-
-Two-dimensional arrays are tested in exactly the same manner. The
-above description applies, but with ``Matrix`` substituted for
-``Vector``. For three-dimensional tests, substitute ``Tensor`` for
-``Vector``. For the descriptions that follow, we will reference the
-``Vector`` tests, but the same information applies to ``Matrix`` and
-``Tensor`` tests.
-
-The command ``make test`` will ensure that all of the test software is
-built and then run all three test scripts.
-
-Testing Header Files
-====================
-
-``Vector.h`` is a C++ header file that defines a C macro called
-``TEST_FUNC_PROTOS`` that takes two arguments: ``TYPE``, which is a
-data type name such as ``unsigned int``; and ``SNAME``, which is a
-short name for the same data type with no spaces, e.g. ``uint``. This
-macro defines several function prototypes that have the prefix
-``SNAME`` and have at least one argument that is an array of type
-``TYPE``. Those functions that have return arguments return a
-``TYPE`` value.
-
-``TEST_FUNC_PROTOS`` is then implemented for all of the data types
-supported by ``numpy.i``:
-
- * ``signed char``
- * ``unsigned char``
- * ``short``
- * ``unsigned short``
- * ``int``
- * ``unsigned int``
- * ``long``
- * ``unsigned long``
- * ``long long``
- * ``unsigned long long``
- * ``float``
- * ``double``
-
-Testing Source Files
-====================
-
-``Vector.cxx`` is a C++ source file that implements compilable code
-for each of the function prototypes specified in ``Vector.h``. It
-defines a C macro ``TEST_FUNCS`` that has the same arguments and works
-in the same way as ``TEST_FUNC_PROTOS`` does in ``Vector.h``.
-``TEST_FUNCS`` is implemented for each of the 12 data types as above.
-
-Testing SWIG Interface Files
-============================
-
-``Vector.i`` is a `SWIG`_ interface file that defines python module
-``Vector``. It follows the conventions for using ``numpy.i`` as
-described in the `numpy.i documentation <numpy_swig.html>`_. It
-defines a `SWIG`_ macro ``%apply_numpy_typemaps`` that has a single
-argument ``TYPE``. It uses the `SWIG`_ directive ``%apply`` as
-described in the `numpy.i documentation`_ to apply the provided
-typemaps to the argument signatures found in ``Vector.h``. This macro
-is then implemented for all of the data types supported by
-``numpy.i``. It then does a ``%include "Vector.h"`` to wrap all of
-the function prototypes in ``Vector.h`` using the typemaps in
-``numpy.i``.
-
-Testing Python Scripts
-======================
-
-After ``make`` is used to build the testing extension modules,
-``testVector.py`` can be run to execute the tests. As with other
-scripts that use ``unittest`` to facilitate unit testing,
-``testVector.py`` defines a class that inherits from
-``unittest.TestCase``::
-
- class VectorTestCase(unittest.TestCase):
-
-However, this class is not run directly. Rather, it serves as a base
-class to several other python classes, each one specific to a
-particular data type. The ``VectorTestCase`` class stores two strings
-for typing information:
-
- **self.typeStr**
- A string that matches one of the ``SNAME`` prefixes used in
- ``Vector.h`` and ``Vector.cxx``. For example, ``"double"``.
-
- **self.typeCode**
- A short (typically single-character) string that represents a
- data type in numpy and corresponds to ``self.typeStr``. For
- example, if ``self.typeStr`` is ``"double"``, then
- ``self.typeCode`` should be ``"d"``.
-
-Each test defined by the ``VectorTestCase`` class extracts the python
-function it is trying to test by accessing the ``Vector`` module's
-dictionary::
-
- length = Vector.__dict__[self.typeStr + "Length"]
-
-In the case of double precision tests, this will return the python
-function ``Vector.doubleLength``.
-
-We then define a new test case class for each supported data type with
-a short definition such as::
-
- class doubleTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
-
-Each of these 12 classes is collected into a ``unittest.TestSuite``,
-which is then executed. Errors and failures are summed together and
-returned as the exit argument. Any non-zero result indicates that at
-least one test did not pass.
diff --git a/numpy/doc/swig/numpy.i b/numpy/doc/swig/numpy.i
deleted file mode 100644
index 72fc4f9c4..000000000
--- a/numpy/doc/swig/numpy.i
+++ /dev/null
@@ -1,1634 +0,0 @@
-/* -*- C -*- (not really, but good for syntax highlighting) */
-#ifdef SWIGPYTHON
-
-%{
-#ifndef SWIG_FILE_WITH_INIT
-# define NO_IMPORT_ARRAY
-#endif
-#include "stdio.h"
-#include <numpy/arrayobject.h>
-%}
-
-/**********************************************************************/
-
-%fragment("NumPy_Backward_Compatibility", "header")
-{
-/* Support older NumPy data type names
-*/
-%#if NDARRAY_VERSION < 0x01000000
-%#define NPY_BOOL PyArray_BOOL
-%#define NPY_BYTE PyArray_BYTE
-%#define NPY_UBYTE PyArray_UBYTE
-%#define NPY_SHORT PyArray_SHORT
-%#define NPY_USHORT PyArray_USHORT
-%#define NPY_INT PyArray_INT
-%#define NPY_UINT PyArray_UINT
-%#define NPY_LONG PyArray_LONG
-%#define NPY_ULONG PyArray_ULONG
-%#define NPY_LONGLONG PyArray_LONGLONG
-%#define NPY_ULONGLONG PyArray_ULONGLONG
-%#define NPY_FLOAT PyArray_FLOAT
-%#define NPY_DOUBLE PyArray_DOUBLE
-%#define NPY_LONGDOUBLE PyArray_LONGDOUBLE
-%#define NPY_CFLOAT PyArray_CFLOAT
-%#define NPY_CDOUBLE PyArray_CDOUBLE
-%#define NPY_CLONGDOUBLE PyArray_CLONGDOUBLE
-%#define NPY_OBJECT PyArray_OBJECT
-%#define NPY_STRING PyArray_STRING
-%#define NPY_UNICODE PyArray_UNICODE
-%#define NPY_VOID PyArray_VOID
-%#define NPY_NTYPES PyArray_NTYPES
-%#define NPY_NOTYPE PyArray_NOTYPE
-%#define NPY_CHAR PyArray_CHAR
-%#define NPY_USERDEF PyArray_USERDEF
-%#define npy_intp intp
-
-%#define NPY_MAX_BYTE MAX_BYTE
-%#define NPY_MIN_BYTE MIN_BYTE
-%#define NPY_MAX_UBYTE MAX_UBYTE
-%#define NPY_MAX_SHORT MAX_SHORT
-%#define NPY_MIN_SHORT MIN_SHORT
-%#define NPY_MAX_USHORT MAX_USHORT
-%#define NPY_MAX_INT MAX_INT
-%#define NPY_MIN_INT MIN_INT
-%#define NPY_MAX_UINT MAX_UINT
-%#define NPY_MAX_LONG MAX_LONG
-%#define NPY_MIN_LONG MIN_LONG
-%#define NPY_MAX_ULONG MAX_ULONG
-%#define NPY_MAX_LONGLONG MAX_LONGLONG
-%#define NPY_MIN_LONGLONG MIN_LONGLONG
-%#define NPY_MAX_ULONGLONG MAX_ULONGLONG
-%#define NPY_MAX_INTP MAX_INTP
-%#define NPY_MIN_INTP MIN_INTP
-
-%#define NPY_FARRAY FARRAY
-%#define NPY_F_CONTIGUOUS F_CONTIGUOUS
-%#endif
-}
-
-/**********************************************************************/
-
-/* The following code originally appeared in
- * enthought/kiva/agg/src/numeric.i written by Eric Jones. It was
- * translated from C++ to C by John Hunter. Bill Spotz has modified
- * it to fix some minor bugs, upgrade from Numeric to numpy (all
- * versions), add some comments and functionality, and convert from
- * direct code insertion to SWIG fragments.
- */
-
-%fragment("NumPy_Macros", "header")
-{
-/* Macros to extract array attributes.
- */
-%#define is_array(a) ((a) && PyArray_Check((PyArrayObject *)a))
-%#define array_type(a) (int)(PyArray_TYPE(a))
-%#define array_numdims(a) (((PyArrayObject *)a)->nd)
-%#define array_dimensions(a) (((PyArrayObject *)a)->dimensions)
-%#define array_size(a,i) (((PyArrayObject *)a)->dimensions[i])
-%#define array_data(a) (((PyArrayObject *)a)->data)
-%#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(a))
-%#define array_is_native(a) (PyArray_ISNOTSWAPPED(a))
-%#define array_is_fortran(a) (PyArray_ISFORTRAN(a))
-}
-
-/**********************************************************************/
-
-%fragment("NumPy_Utilities", "header")
-{
- /* Given a PyObject, return a string describing its type.
- */
- char* pytype_string(PyObject* py_obj) {
- if (py_obj == NULL ) return "C NULL value";
- if (py_obj == Py_None ) return "Python None" ;
- if (PyCallable_Check(py_obj)) return "callable" ;
- if (PyString_Check( py_obj)) return "string" ;
- if (PyInt_Check( py_obj)) return "int" ;
- if (PyFloat_Check( py_obj)) return "float" ;
- if (PyDict_Check( py_obj)) return "dict" ;
- if (PyList_Check( py_obj)) return "list" ;
- if (PyTuple_Check( py_obj)) return "tuple" ;
- if (PyFile_Check( py_obj)) return "file" ;
- if (PyModule_Check( py_obj)) return "module" ;
- if (PyInstance_Check(py_obj)) return "instance" ;
-
- return "unkown type";
- }
-
- /* Given a NumPy typecode, return a string describing the type.
- */
- char* typecode_string(int typecode) {
- static char* type_names[25] = {"bool", "byte", "unsigned byte",
- "short", "unsigned short", "int",
- "unsigned int", "long", "unsigned long",
- "long long", "unsigned long long",
- "float", "double", "long double",
- "complex float", "complex double",
- "complex long double", "object",
- "string", "unicode", "void", "ntypes",
- "notype", "char", "unknown"};
- return typecode < 24 ? type_names[typecode] : type_names[24];
- }
-
- /* Make sure input has correct numpy type. Allow character and byte
- * to match. Also allow int and long to match. This is deprecated.
- * You should use PyArray_EquivTypenums() instead.
- */
- int type_match(int actual_type, int desired_type) {
- return PyArray_EquivTypenums(actual_type, desired_type);
- }
-}
-
-/**********************************************************************/
-
-%fragment("NumPy_Object_to_Array", "header",
- fragment="NumPy_Backward_Compatibility",
- fragment="NumPy_Macros",
- fragment="NumPy_Utilities")
-{
- /* Given a PyObject pointer, cast it to a PyArrayObject pointer if
- * legal. If not, set the python error string appropriately and
- * return NULL.
- */
- PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode)
- {
- PyArrayObject* ary = NULL;
- if (is_array(input) && (typecode == NPY_NOTYPE ||
- PyArray_EquivTypenums(array_type(input), typecode)))
- {
- ary = (PyArrayObject*) input;
- }
- else if is_array(input)
- {
- char* desired_type = typecode_string(typecode);
- char* actual_type = typecode_string(array_type(input));
- PyErr_Format(PyExc_TypeError,
- "Array of type '%s' required. Array of type '%s' given",
- desired_type, actual_type);
- ary = NULL;
- }
- else
- {
- char * desired_type = typecode_string(typecode);
- char * actual_type = pytype_string(input);
- PyErr_Format(PyExc_TypeError,
- "Array of type '%s' required. A '%s' was given",
- desired_type, actual_type);
- ary = NULL;
- }
- return ary;
- }
-
- /* Convert the given PyObject to a NumPy array with the given
- * typecode. On success, return a valid PyArrayObject* with the
- * correct type. On failure, the python error string will be set and
- * the routine returns NULL.
- */
- PyArrayObject* obj_to_array_allow_conversion(PyObject* input, int typecode,
- int* is_new_object)
- {
- PyArrayObject* ary = NULL;
- PyObject* py_obj;
- if (is_array(input) && (typecode == NPY_NOTYPE ||
- PyArray_EquivTypenums(array_type(input),typecode)))
- {
- ary = (PyArrayObject*) input;
- *is_new_object = 0;
- }
- else
- {
- py_obj = PyArray_FROMANY(input, typecode, 0, 0, NPY_DEFAULT);
- /* If NULL, PyArray_FromObject will have set python error value.*/
- ary = (PyArrayObject*) py_obj;
- *is_new_object = 1;
- }
- return ary;
- }
-
- /* Given a PyArrayObject, check to see if it is contiguous. If so,
- * return the input pointer and flag it as not a new object. If it is
- * not contiguous, create a new PyArrayObject using the original data,
- * flag it as a new object and return the pointer.
- */
- PyArrayObject* make_contiguous(PyArrayObject* ary, int* is_new_object,
- int min_dims, int max_dims)
- {
- PyArrayObject* result;
- if (array_is_contiguous(ary))
- {
- result = ary;
- *is_new_object = 0;
- }
- else
- {
- result = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*)ary,
- array_type(ary),
- min_dims,
- max_dims);
- *is_new_object = 1;
- }
- return result;
- }
-
- /* Given a PyArrayObject, check to see if it is Fortran-contiguous.
- * If so, return the input pointer, but do not flag it as not a new
- * object. If it is not Fortran-contiguous, create a new
- * PyArrayObject using the original data, flag it as a new object
- * and return the pointer.
- */
- PyArrayObject* make_fortran(PyArrayObject* ary, int* is_new_object,
- int min_dims, int max_dims)
- {
- PyArrayObject* result;
- if (array_is_fortran(ary))
- {
- result = ary;
- *is_new_object = 0;
- }
- else
- {
- Py_INCREF(ary->descr);
- result = (PyArrayObject*) PyArray_FromArray(ary, ary->descr, NPY_FORTRAN);
- *is_new_object = 1;
- }
- return result;
- }
-
- /* Convert a given PyObject to a contiguous PyArrayObject of the
- * specified type. If the input object is not a contiguous
- * PyArrayObject, a new one will be created and the new object flag
- * will be set.
- */
- PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input,
- int typecode,
- int* is_new_object)
- {
- int is_new1 = 0;
- int is_new2 = 0;
- PyArrayObject* ary2;
- PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode,
- &is_new1);
- if (ary1)
- {
- ary2 = make_contiguous(ary1, &is_new2, 0, 0);
- if ( is_new1 && is_new2)
- {
- Py_DECREF(ary1);
- }
- ary1 = ary2;
- }
- *is_new_object = is_new1 || is_new2;
- return ary1;
- }
-
- /* Convert a given PyObject to a Fortran-ordered PyArrayObject of the
- * specified type. If the input object is not a Fortran-ordered
- * PyArrayObject, a new one will be created and the new object flag
- * will be set.
- */
- PyArrayObject* obj_to_array_fortran_allow_conversion(PyObject* input,
- int typecode,
- int* is_new_object)
- {
- int is_new1 = 0;
- int is_new2 = 0;
- PyArrayObject* ary2;
- PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode,
- &is_new1);
- if (ary1)
- {
- ary2 = make_fortran(ary1, &is_new2, 0, 0);
- if (is_new1 && is_new2)
- {
- Py_DECREF(ary1);
- }
- ary1 = ary2;
- }
- *is_new_object = is_new1 || is_new2;
- return ary1;
- }
-
-} /* end fragment */
-
-
-/**********************************************************************/
-
-%fragment("NumPy_Array_Requirements", "header",
- fragment="NumPy_Backward_Compatibility",
- fragment="NumPy_Macros")
-{
- /* Test whether a python object is contiguous. If array is
- * contiguous, return 1. Otherwise, set the python error string and
- * return 0.
- */
- int require_contiguous(PyArrayObject* ary)
- {
- int contiguous = 1;
- if (!array_is_contiguous(ary))
- {
- PyErr_SetString(PyExc_TypeError,
- "Array must be contiguous. A non-contiguous array was given");
- contiguous = 0;
- }
- return contiguous;
- }
-
- /* Require that a numpy array is not byte-swapped. If the array is
- * not byte-swapped, return 1. Otherwise, set the python error string
- * and return 0.
- */
- int require_native(PyArrayObject* ary)
- {
- int native = 1;
- if (!array_is_native(ary))
- {
- PyErr_SetString(PyExc_TypeError,
- "Array must have native byteorder. "
- "A byte-swapped array was given");
- native = 0;
- }
- return native;
- }
-
- /* Require the given PyArrayObject to have a specified number of
- * dimensions. If the array has the specified number of dimensions,
- * return 1. Otherwise, set the python error string and return 0.
- */
- int require_dimensions(PyArrayObject* ary, int exact_dimensions)
- {
- int success = 1;
- if (array_numdims(ary) != exact_dimensions)
- {
- PyErr_Format(PyExc_TypeError,
- "Array must have %d dimensions. Given array has %d dimensions",
- exact_dimensions, array_numdims(ary));
- success = 0;
- }
- return success;
- }
-
- /* Require the given PyArrayObject to have one of a list of specified
- * number of dimensions. If the array has one of the specified number
- * of dimensions, return 1. Otherwise, set the python error string
- * and return 0.
- */
- int require_dimensions_n(PyArrayObject* ary, int* exact_dimensions, int n)
- {
- int success = 0;
- int i;
- char dims_str[255] = "";
- char s[255];
- for (i = 0; i < n && !success; i++)
- {
- if (array_numdims(ary) == exact_dimensions[i])
- {
- success = 1;
- }
- }
- if (!success)
- {
- for (i = 0; i < n-1; i++)
- {
- sprintf(s, "%d, ", exact_dimensions[i]);
- strcat(dims_str,s);
- }
- sprintf(s, " or %d", exact_dimensions[n-1]);
- strcat(dims_str,s);
- PyErr_Format(PyExc_TypeError,
- "Array must have %s dimensions. Given array has %d dimensions",
- dims_str, array_numdims(ary));
- }
- return success;
- }
-
- /* Require the given PyArrayObject to have a specified shape. If the
- * array has the specified shape, return 1. Otherwise, set the python
- * error string and return 0.
- */
- int require_size(PyArrayObject* ary, npy_intp* size, int n)
- {
- int i;
- int success = 1;
- int len;
- char desired_dims[255] = "[";
- char s[255];
- char actual_dims[255] = "[";
- for(i=0; i < n;i++)
- {
- if (size[i] != -1 && size[i] != array_size(ary,i))
- {
- success = 0;
- }
- }
- if (!success)
- {
- for (i = 0; i < n; i++)
- {
- if (size[i] == -1)
- {
- sprintf(s, "*,");
- }
- else
- {
- sprintf(s, "%ld,", (long int)size[i]);
- }
- strcat(desired_dims,s);
- }
- len = strlen(desired_dims);
- desired_dims[len-1] = ']';
- for (i = 0; i < n; i++)
- {
- sprintf(s, "%ld,", (long int)array_size(ary,i));
- strcat(actual_dims,s);
- }
- len = strlen(actual_dims);
- actual_dims[len-1] = ']';
- PyErr_Format(PyExc_TypeError,
- "Array must have shape of %s. Given array has shape of %s",
- desired_dims, actual_dims);
- }
- return success;
- }
-
- /* Require the given PyArrayObject to to be FORTRAN ordered. If the
- * the PyArrayObject is already FORTRAN ordered, do nothing. Else,
- * set the FORTRAN ordering flag and recompute the strides.
- */
- int require_fortran(PyArrayObject* ary)
- {
- int success = 1;
- int nd = array_numdims(ary);
- int i;
- if (array_is_fortran(ary)) return success;
- /* Set the FORTRAN ordered flag */
- ary->flags = NPY_FARRAY;
- /* Recompute the strides */
- ary->strides[0] = ary->strides[nd-1];
- for (i=1; i < nd; ++i)
- ary->strides[i] = ary->strides[i-1] * array_size(ary,i-1);
- return success;
- }
-}
-
-/* Combine all NumPy fragments into one for convenience */
-%fragment("NumPy_Fragments", "header",
- fragment="NumPy_Backward_Compatibility",
- fragment="NumPy_Macros",
- fragment="NumPy_Utilities",
- fragment="NumPy_Object_to_Array",
- fragment="NumPy_Array_Requirements") { }
-
-/* End John Hunter translation (with modifications by Bill Spotz)
- */
-
-/* %numpy_typemaps() macro
- *
- * This macro defines a family of 41 typemaps that allow C arguments
- * of the form
- *
- * (DATA_TYPE IN_ARRAY1[ANY])
- * (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
- * (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
- *
- * (DATA_TYPE IN_ARRAY2[ANY][ANY])
- * (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- * (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
- * (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- * (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2)
- *
- * (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
- * (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- * (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
- * (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- * (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3)
- *
- * (DATA_TYPE INPLACE_ARRAY1[ANY])
- * (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1)
- * (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1)
- *
- * (DATA_TYPE INPLACE_ARRAY2[ANY][ANY])
- * (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- * (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2)
- * (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- * (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2)
- *
- * (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY])
- * (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- * (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
- * (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- * (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_FARRAY3)
- *
- * (DATA_TYPE ARGOUT_ARRAY1[ANY])
- * (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
- * (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
- *
- * (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
- *
- * (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
- *
- * (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1)
- * (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1)
- *
- * (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
- * (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2)
- * (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
- * (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2)
- *
- * (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
- * (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3)
- * (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
- * (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)
- *
- * where "DATA_TYPE" is any type supported by the NumPy module, and
- * "DIM_TYPE" is any int-like type suitable for specifying dimensions.
- * The difference between "ARRAY" typemaps and "FARRAY" typemaps is
- * that the "FARRAY" typemaps expect FORTRAN ordering of
- * multidimensional arrays. In python, the dimensions will not need
- * to be specified (except for the "DATA_TYPE* ARGOUT_ARRAY1"
- * typemaps). The IN_ARRAYs can be a numpy array or any sequence that
- * can be converted to a numpy array of the specified type. The
- * INPLACE_ARRAYs must be numpy arrays of the appropriate type. The
- * ARGOUT_ARRAYs will be returned as new numpy arrays of the
- * appropriate type.
- *
- * These typemaps can be applied to existing functions using the
- * %apply directive. For example:
- *
- * %apply (double* IN_ARRAY1, int DIM1) {(double* series, int length)};
- * double prod(double* series, int length);
- *
- * %apply (int DIM1, int DIM2, double* INPLACE_ARRAY2)
- * {(int rows, int cols, double* matrix )};
- * void floor(int rows, int cols, double* matrix, double f);
- *
- * %apply (double IN_ARRAY3[ANY][ANY][ANY])
- * {(double tensor[2][2][2] )};
- * %apply (double ARGOUT_ARRAY3[ANY][ANY][ANY])
- * {(double low[2][2][2] )};
- * %apply (double ARGOUT_ARRAY3[ANY][ANY][ANY])
- * {(double upp[2][2][2] )};
- * void luSplit(double tensor[2][2][2],
- * double low[2][2][2],
- * double upp[2][2][2] );
- *
- * or directly with
- *
- * double prod(double* IN_ARRAY1, int DIM1);
- *
- * void floor(int DIM1, int DIM2, double* INPLACE_ARRAY2, double f);
- *
- * void luSplit(double IN_ARRAY3[ANY][ANY][ANY],
- * double ARGOUT_ARRAY3[ANY][ANY][ANY],
- * double ARGOUT_ARRAY3[ANY][ANY][ANY]);
- */
-
-%define %numpy_typemaps(DATA_TYPE, DATA_TYPECODE, DIM_TYPE)
-
-/************************/
-/* Input Array Typemaps */
-/************************/
-
-/* Typemap suite for (DATA_TYPE IN_ARRAY1[ANY])
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE IN_ARRAY1[ANY])
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE IN_ARRAY1[ANY])
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[1] = { $1_dim0 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 1) ||
- !require_size(array, size, 1)) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-%typemap(freearg)
- (DATA_TYPE IN_ARRAY1[ANY])
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[1] = { -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 1) ||
- !require_size(array, size, 1)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
-}
-%typemap(freearg)
- (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[1] = {-1};
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 1) ||
- !require_size(array, size, 1)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DATA_TYPE*) array_data(array);
-}
-%typemap(freearg)
- (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DATA_TYPE IN_ARRAY2[ANY][ANY])
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE IN_ARRAY2[ANY][ANY])
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE IN_ARRAY2[ANY][ANY])
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[2] = { $1_dim0, $1_dim1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 2) ||
- !require_size(array, size, 2)) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-%typemap(freearg)
- (DATA_TYPE IN_ARRAY2[ANY][ANY])
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[2] = { -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 2) ||
- !require_size(array, size, 2)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
- $3 = (DIM_TYPE) array_size(array,1);
-}
-%typemap(freearg)
- (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[2] = { -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 2) ||
- !require_size(array, size, 2)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DIM_TYPE) array_size(array,1);
- $3 = (DATA_TYPE*) array_data(array);
-}
-%typemap(freearg)
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[2] = { -1, -1 };
- array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 2) ||
- !require_size(array, size, 2) || !require_fortran(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
- $3 = (DIM_TYPE) array_size(array,1);
-}
-%typemap(freearg)
- (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[2] = { -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 2) ||
- !require_size(array, size, 2) || !require_fortran(array)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DIM_TYPE) array_size(array,1);
- $3 = (DATA_TYPE*) array_data(array);
-}
-%typemap(freearg)
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[3] = { $1_dim0, $1_dim1, $1_dim2 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 3) ||
- !require_size(array, size, 3)) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-%typemap(freearg)
- (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
- * DIM_TYPE DIM3)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 3) ||
- !require_size(array, size, 3)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
- $3 = (DIM_TYPE) array_size(array,1);
- $4 = (DIM_TYPE) array_size(array,2);
-}
-%typemap(freearg)
- (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
- * DATA_TYPE* IN_ARRAY3)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 3) ||
- !require_size(array, size, 3)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DIM_TYPE) array_size(array,1);
- $3 = (DIM_TYPE) array_size(array,2);
- $4 = (DATA_TYPE*) array_data(array);
-}
-%typemap(freearg)
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
- * DIM_TYPE DIM3)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 3) ||
- !require_size(array, size, 3) | !require_fortran(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
- $3 = (DIM_TYPE) array_size(array,1);
- $4 = (DIM_TYPE) array_size(array,2);
-}
-%typemap(freearg)
- (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
- * DATA_TYPE* IN_FARRAY3)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3)
-{
- $1 = is_array($input) || PySequence_Check($input);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3)
- (PyArrayObject* array=NULL, int is_new_object=0)
-{
- npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
- &is_new_object);
- if (!array || !require_dimensions(array, 3) ||
- !require_size(array, size, 3) || !require_fortran(array)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DIM_TYPE) array_size(array,1);
- $3 = (DIM_TYPE) array_size(array,2);
- $4 = (DATA_TYPE*) array_data(array);
-}
-%typemap(freearg)
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3)
-{
- if (is_new_object$argnum && array$argnum)
- { Py_DECREF(array$argnum); }
-}
-
-/***************************/
-/* In-Place Array Typemaps */
-/***************************/
-
-/* Typemap suite for (DATA_TYPE INPLACE_ARRAY1[ANY])
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE INPLACE_ARRAY1[ANY])
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE INPLACE_ARRAY1[ANY])
- (PyArrayObject* array=NULL)
-{
- npy_intp size[1] = { $1_dim0 };
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,1) || !require_size(array, size, 1) ||
- !require_contiguous(array) || !require_native(array)) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-
-/* Typemap suite for (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1)
- (PyArrayObject* array=NULL, int i=1)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,1) || !require_contiguous(array)
- || !require_native(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = 1;
- for (i=0; i < array_numdims(array); ++i) $2 *= array_size(array,i);
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1)
- (PyArrayObject* array=NULL, int i=0)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,1) || !require_contiguous(array)
- || !require_native(array)) SWIG_fail;
- $1 = 1;
- for (i=0; i < array_numdims(array); ++i) $1 *= array_size(array,i);
- $2 = (DATA_TYPE*) array_data(array);
-}
-
-/* Typemap suite for (DATA_TYPE INPLACE_ARRAY2[ANY][ANY])
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE INPLACE_ARRAY2[ANY][ANY])
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE INPLACE_ARRAY2[ANY][ANY])
- (PyArrayObject* array=NULL)
-{
- npy_intp size[2] = { $1_dim0, $1_dim1 };
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,2) || !require_size(array, size, 2) ||
- !require_contiguous(array) || !require_native(array)) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-
-/* Typemap suite for (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- (PyArrayObject* array=NULL)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,2) || !require_contiguous(array)
- || !require_native(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
- $3 = (DIM_TYPE) array_size(array,1);
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2)
- (PyArrayObject* array=NULL)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,2) || !require_contiguous(array) ||
- !require_native(array)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DIM_TYPE) array_size(array,1);
- $3 = (DATA_TYPE*) array_data(array);
-}
-
-/* Typemap suite for (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
- (PyArrayObject* array=NULL)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,2) || !require_contiguous(array)
- || !require_native(array) || !require_fortran(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
- $3 = (DIM_TYPE) array_size(array,1);
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2)
- (PyArrayObject* array=NULL)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,2) || !require_contiguous(array) ||
- !require_native(array) || !require_fortran(array)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DIM_TYPE) array_size(array,1);
- $3 = (DATA_TYPE*) array_data(array);
-}
-
-/* Typemap suite for (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY])
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY])
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY])
- (PyArrayObject* array=NULL)
-{
- npy_intp size[3] = { $1_dim0, $1_dim1, $1_dim2 };
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,3) || !require_size(array, size, 3) ||
- !require_contiguous(array) || !require_native(array)) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-
-/* Typemap suite for (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
- * DIM_TYPE DIM3)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- (PyArrayObject* array=NULL)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,3) || !require_contiguous(array) ||
- !require_native(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
- $3 = (DIM_TYPE) array_size(array,1);
- $4 = (DIM_TYPE) array_size(array,2);
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
- * DATA_TYPE* INPLACE_ARRAY3)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
- (PyArrayObject* array=NULL)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,3) || !require_contiguous(array)
- || !require_native(array)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DIM_TYPE) array_size(array,1);
- $3 = (DIM_TYPE) array_size(array,2);
- $4 = (DATA_TYPE*) array_data(array);
-}
-
-/* Typemap suite for (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
- * DIM_TYPE DIM3)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- (PyArrayObject* array=NULL)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,3) || !require_contiguous(array) ||
- !require_native(array) || !require_fortran(array)) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
- $2 = (DIM_TYPE) array_size(array,0);
- $3 = (DIM_TYPE) array_size(array,1);
- $4 = (DIM_TYPE) array_size(array,2);
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
- * DATA_TYPE* INPLACE_FARRAY3)
- */
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_FARRAY3)
-{
- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
- DATA_TYPECODE);
-}
-%typemap(in,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_FARRAY3)
- (PyArrayObject* array=NULL)
-{
- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
- if (!array || !require_dimensions(array,3) || !require_contiguous(array)
- || !require_native(array) || !require_fortran(array)) SWIG_fail;
- $1 = (DIM_TYPE) array_size(array,0);
- $2 = (DIM_TYPE) array_size(array,1);
- $3 = (DIM_TYPE) array_size(array,2);
- $4 = (DATA_TYPE*) array_data(array);
-}
-
-/*************************/
-/* Argout Array Typemaps */
-/*************************/
-
-/* Typemap suite for (DATA_TYPE ARGOUT_ARRAY1[ANY])
- */
-%typemap(in,numinputs=0,
- fragment="NumPy_Backward_Compatibility,NumPy_Macros")
- (DATA_TYPE ARGOUT_ARRAY1[ANY])
- (PyObject * array = NULL)
-{
- npy_intp dims[1] = { $1_dim0 };
- array = PyArray_SimpleNew(1, dims, DATA_TYPECODE);
- if (!array) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-%typemap(argout)
- (DATA_TYPE ARGOUT_ARRAY1[ANY])
-{
- $result = SWIG_Python_AppendOutput($result,array$argnum);
-}
-
-/* Typemap suite for (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
- */
-%typemap(in,numinputs=1,
- fragment="NumPy_Fragments")
- (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
- (PyObject * array = NULL)
-{
- npy_intp dims[1];
- if (!PyInt_Check($input))
- {
- char* typestring = pytype_string($input);
- PyErr_Format(PyExc_TypeError,
- "Int dimension expected. '%s' given.",
- typestring);
- SWIG_fail;
- }
- $2 = (DIM_TYPE) PyInt_AsLong($input);
- dims[0] = (npy_intp) $2;
- array = PyArray_SimpleNew(1, dims, DATA_TYPECODE);
- if (!array) SWIG_fail;
- $1 = (DATA_TYPE*) array_data(array);
-}
-%typemap(argout)
- (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
-{
- $result = SWIG_Python_AppendOutput($result,array$argnum);
-}
-
-/* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
- */
-%typemap(in,numinputs=1,
- fragment="NumPy_Fragments")
- (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
- (PyObject * array = NULL)
-{
- npy_intp dims[1];
- if (!PyInt_Check($input))
- {
- char* typestring = pytype_string($input);
- PyErr_Format(PyExc_TypeError,
- "Int dimension expected. '%s' given.",
- typestring);
- SWIG_fail;
- }
- $1 = (DIM_TYPE) PyInt_AsLong($input);
- dims[0] = (npy_intp) $1;
- array = PyArray_SimpleNew(1, dims, DATA_TYPECODE);
- if (!array) SWIG_fail;
- $2 = (DATA_TYPE*) array_data(array);
-}
-%typemap(argout)
- (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
-{
- $result = SWIG_Python_AppendOutput($result,array$argnum);
-}
-
-/* Typemap suite for (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
- */
-%typemap(in,numinputs=0,
- fragment="NumPy_Backward_Compatibility,NumPy_Macros")
- (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
- (PyObject * array = NULL)
-{
- npy_intp dims[2] = { $1_dim0, $1_dim1 };
- array = PyArray_SimpleNew(2, dims, DATA_TYPECODE);
- if (!array) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-%typemap(argout)
- (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
-{
- $result = SWIG_Python_AppendOutput($result,array$argnum);
-}
-
-/* Typemap suite for (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
- */
-%typemap(in,numinputs=0,
- fragment="NumPy_Backward_Compatibility,NumPy_Macros")
- (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
- (PyObject * array = NULL)
-{
- npy_intp dims[3] = { $1_dim0, $1_dim1, $1_dim2 };
- array = PyArray_SimpleNew(3, dims, DATA_TYPECODE);
- if (!array) SWIG_fail;
- $1 = ($1_ltype) array_data(array);
-}
-%typemap(argout)
- (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
-{
- $result = SWIG_Python_AppendOutput($result,array$argnum);
-}
-
-/*****************************/
-/* Argoutview Array Typemaps */
-/*****************************/
-
-/* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1)
- */
-%typemap(in,numinputs=0)
- (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1 )
- (DATA_TYPE* data_temp , DIM_TYPE dim_temp)
-{
- $1 = &data_temp;
- $2 = &dim_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
- (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1)
-{
- npy_intp dims[1] = { *$2 };
- PyObject * array = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$1));
- if (!array) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,array);
-}
-
-/* Typemap suite for (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1)
- */
-%typemap(in,numinputs=0)
- (DIM_TYPE* DIM1 , DATA_TYPE** ARGOUTVIEW_ARRAY1)
- (DIM_TYPE dim_temp, DATA_TYPE* data_temp )
-{
- $1 = &dim_temp;
- $2 = &data_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
- (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1)
-{
- npy_intp dims[1] = { *$1 };
- PyObject * array = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$2));
- if (!array) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,array);
-}
-
-/* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
- */
-%typemap(in,numinputs=0)
- (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 )
- (DATA_TYPE* data_temp , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp)
-{
- $1 = &data_temp;
- $2 = &dim1_temp;
- $3 = &dim2_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
- (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
-{
- npy_intp dims[2] = { *$2, *$3 };
- PyObject * array = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1));
- if (!array) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,array);
-}
-
-/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2)
- */
-%typemap(in,numinputs=0)
- (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DATA_TYPE** ARGOUTVIEW_ARRAY2)
- (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DATA_TYPE* data_temp )
-{
- $1 = &dim1_temp;
- $2 = &dim2_temp;
- $3 = &data_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
- (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2)
-{
- npy_intp dims[2] = { *$1, *$2 };
- PyObject * array = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3));
- if (!array) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,array);
-}
-
-/* Typemap suite for (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
- */
-%typemap(in,numinputs=0)
- (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 )
- (DATA_TYPE* data_temp , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp)
-{
- $1 = &data_temp;
- $2 = &dim1_temp;
- $3 = &dim2_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
- (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
-{
- npy_intp dims[2] = { *$2, *$3 };
- PyObject * obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1));
- PyArrayObject * array = (PyArrayObject*) obj;
- if (!array || !require_fortran(array)) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,obj);
-}
-
-/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2)
- */
-%typemap(in,numinputs=0)
- (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DATA_TYPE** ARGOUTVIEW_FARRAY2)
- (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DATA_TYPE* data_temp )
-{
- $1 = &dim1_temp;
- $2 = &dim2_temp;
- $3 = &data_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
- (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2)
-{
- npy_intp dims[2] = { *$1, *$2 };
- PyObject * obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3));
- PyArrayObject * array = (PyArrayObject*) obj;
- if (!array || !require_fortran(array)) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,obj);
-}
-
-/* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
- DIM_TYPE* DIM3)
- */
-%typemap(in,numinputs=0)
- (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
- (DATA_TYPE* data_temp, DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
-{
- $1 = &data_temp;
- $2 = &dim1_temp;
- $3 = &dim2_temp;
- $4 = &dim3_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
- (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
-{
- npy_intp dims[3] = { *$2, *$3, *$4 };
- PyObject * array = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
- if (!array) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,array);
-}
-
-/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3,
- DATA_TYPE** ARGOUTVIEW_ARRAY3)
- */
-%typemap(in,numinputs=0)
- (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3)
- (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp)
-{
- $1 = &dim1_temp;
- $2 = &dim2_temp;
- $3 = &dim3_temp;
- $4 = &data_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
- (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3)
-{
- npy_intp dims[3] = { *$1, *$2, *$3 };
- PyObject * array = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$3));
- if (!array) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,array);
-}
-
-/* Typemap suite for (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
- DIM_TYPE* DIM3)
- */
-%typemap(in,numinputs=0)
- (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
- (DATA_TYPE* data_temp, DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
-{
- $1 = &data_temp;
- $2 = &dim1_temp;
- $3 = &dim2_temp;
- $4 = &dim3_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
- (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
-{
- npy_intp dims[3] = { *$2, *$3, *$4 };
- PyObject * obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
- PyArrayObject * array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,obj);
-}
-
-/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3,
- DATA_TYPE** ARGOUTVIEW_FARRAY3)
- */
-%typemap(in,numinputs=0)
- (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)
- (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp)
-{
- $1 = &dim1_temp;
- $2 = &dim2_temp;
- $3 = &dim3_temp;
- $4 = &data_temp;
-}
-%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
- (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)
-{
- npy_intp dims[3] = { *$1, *$2, *$3 };
- PyObject * obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$3));
- PyArrayObject * array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
- $result = SWIG_Python_AppendOutput($result,obj);
-}
-
-%enddef /* %numpy_typemaps() macro */
-/* *************************************************************** */
-
-/* Concrete instances of the %numpy_typemaps() macro: Each invocation
- * below applies all of the typemaps above to the specified data type.
- */
-%numpy_typemaps(signed char , NPY_BYTE , int)
-%numpy_typemaps(unsigned char , NPY_UBYTE , int)
-%numpy_typemaps(short , NPY_SHORT , int)
-%numpy_typemaps(unsigned short , NPY_USHORT , int)
-%numpy_typemaps(int , NPY_INT , int)
-%numpy_typemaps(unsigned int , NPY_UINT , int)
-%numpy_typemaps(long , NPY_LONG , int)
-%numpy_typemaps(unsigned long , NPY_ULONG , int)
-%numpy_typemaps(long long , NPY_LONGLONG , int)
-%numpy_typemaps(unsigned long long, NPY_ULONGLONG, int)
-%numpy_typemaps(float , NPY_FLOAT , int)
-%numpy_typemaps(double , NPY_DOUBLE , int)
-
-/* ***************************************************************
- * The follow macro expansion does not work, because C++ bool is 4
- * bytes and NPY_BOOL is 1 byte
- *
- * %numpy_typemaps(bool, NPY_BOOL, int)
- */
-
-/* ***************************************************************
- * On my Mac, I get the following warning for this macro expansion:
- * 'swig/python detected a memory leak of type 'long double *', no destructor found.'
- *
- * %numpy_typemaps(long double, NPY_LONGDOUBLE, int)
- */
-
-/* ***************************************************************
- * Swig complains about a syntax error for the following macro
- * expansions:
- *
- * %numpy_typemaps(complex float, NPY_CFLOAT , int)
- *
- * %numpy_typemaps(complex double, NPY_CDOUBLE, int)
- *
- * %numpy_typemaps(complex long double, NPY_CLONGDOUBLE, int)
- */
-
-#endif /* SWIGPYTHON */
diff --git a/numpy/doc/swig/pyfragments.swg b/numpy/doc/swig/pyfragments.swg
deleted file mode 100644
index 0deaa61e1..000000000
--- a/numpy/doc/swig/pyfragments.swg
+++ /dev/null
@@ -1,174 +0,0 @@
-/*-*- C -*-*/
-
-/**********************************************************************/
-
-/* For numpy versions prior to 1.0, the names of certain data types
- * are different than in later versions. This fragment provides macro
- * substitutions that allow us to support old and new versions of
- * numpy.
- */
-
-%fragment("NumPy_Backward_Compatibility", "header")
-{
-/* Support older NumPy data type names
- */
-%#if NDARRAY_VERSION < 0x01000000
-%#define NPY_BOOL PyArray_BOOL
-%#define NPY_BYTE PyArray_BYTE
-%#define NPY_UBYTE PyArray_UBYTE
-%#define NPY_SHORT PyArray_SHORT
-%#define NPY_USHORT PyArray_USHORT
-%#define NPY_INT PyArray_INT
-%#define NPY_UINT PyArray_UINT
-%#define NPY_LONG PyArray_LONG
-%#define NPY_ULONG PyArray_ULONG
-%#define NPY_LONGLONG PyArray_LONGLONG
-%#define NPY_ULONGLONG PyArray_ULONGLONG
-%#define NPY_FLOAT PyArray_FLOAT
-%#define NPY_DOUBLE PyArray_DOUBLE
-%#define NPY_LONGDOUBLE PyArray_LONGDOUBLE
-%#define NPY_CFLOAT PyArray_CFLOAT
-%#define NPY_CDOUBLE PyArray_CDOUBLE
-%#define NPY_CLONGDOUBLE PyArray_CLONGDOUBLE
-%#define NPY_OBJECT PyArray_OBJECT
-%#define NPY_STRING PyArray_STRING
-%#define NPY_UNICODE PyArray_UNICODE
-%#define NPY_VOID PyArray_VOID
-%#define NPY_NTYPES PyArray_NTYPES
-%#define NPY_NOTYPE PyArray_NOTYPE
-%#define NPY_CHAR PyArray_CHAR
-%#define NPY_USERDEF PyArray_USERDEF
-%#define npy_intp intp
-
-%#define NPY_MAX_BYTE MAX_BYTE
-%#define NPY_MIN_BYTE MIN_BYTE
-%#define NPY_MAX_UBYTE MAX_UBYTE
-%#define NPY_MAX_SHORT MAX_SHORT
-%#define NPY_MIN_SHORT MIN_SHORT
-%#define NPY_MAX_USHORT MAX_USHORT
-%#define NPY_MAX_INT MAX_INT
-%#define NPY_MIN_INT MIN_INT
-%#define NPY_MAX_UINT MAX_UINT
-%#define NPY_MAX_LONG MAX_LONG
-%#define NPY_MIN_LONG MIN_LONG
-%#define NPY_MAX_ULONG MAX_ULONG
-%#define NPY_MAX_LONGLONG MAX_LONGLONG
-%#define NPY_MIN_LONGLONG MIN_LONGLONG
-%#define NPY_MAX_ULONGLONG MAX_ULONGLONG
-%#define NPY_MAX_INTP MAX_INTP
-%#define NPY_MIN_INTP MIN_INTP
-
-%#define NPY_FARRAY FARRAY
-%#define NPY_F_CONTIGUOUS F_CONTIGUOUS
-%#endif
-}
-
-/**********************************************************************/
-
-/* Override the SWIG_AsVal_frag(long) fragment so that it also checks
- * for numpy scalar array types. The code through the %#endif is
- * essentially cut-and-paste from pyprimtype.swg
- */
-
-%fragment(SWIG_AsVal_frag(long), "header",
- fragment="SWIG_CanCastAsInteger",
- fragment="NumPy_Backward_Compatibility")
-{
- SWIGINTERN int
- SWIG_AsVal_dec(long)(PyObject * obj, long * val)
- {
- static PyArray_Descr * longDescr = PyArray_DescrNewFromType(NPY_LONG);
- if (PyInt_Check(obj)) {
- if (val) *val = PyInt_AsLong(obj);
- return SWIG_OK;
- } else if (PyLong_Check(obj)) {
- long v = PyLong_AsLong(obj);
- if (!PyErr_Occurred()) {
- if (val) *val = v;
- return SWIG_OK;
- } else {
- PyErr_Clear();
- }
- }
-%#ifdef SWIG_PYTHON_CAST_MODE
- {
- int dispatch = 0;
- long v = PyInt_AsLong(obj);
- if (!PyErr_Occurred()) {
- if (val) *val = v;
- return SWIG_AddCast(SWIG_OK);
- } else {
- PyErr_Clear();
- }
- if (!dispatch) {
- double d;
- int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d));
- if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
- if (val) *val = (long)(d);
- return res;
- }
- }
- }
-%#endif
- if (!PyArray_IsScalar(obj,Integer)) return SWIG_TypeError;
- PyArray_CastScalarToCtype(obj, (void*)val, longDescr);
- return SWIG_OK;
- }
-}
-
-
-/* Override the SWIG_AsVal_frag(unsigned long) fragment so that it
- * also checks for numpy scalar array types. The code through the
- * %#endif is essentially cut-and-paste from pyprimtype.swg
- */
-
-%fragment(SWIG_AsVal_frag(unsigned long),"header",
- fragment="SWIG_CanCastAsInteger",
- fragment="NumPy_Backward_Compatibility")
-{
- SWIGINTERN int
- SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val)
- {
- static PyArray_Descr * ulongDescr = PyArray_DescrNewFromType(NPY_ULONG);
- if (PyInt_Check(obj)) {
- long v = PyInt_AsLong(obj);
- if (v >= 0) {
- if (val) *val = v;
- return SWIG_OK;
- } else {
- return SWIG_OverflowError;
- }
- } else if (PyLong_Check(obj)) {
- unsigned long v = PyLong_AsUnsignedLong(obj);
- if (!PyErr_Occurred()) {
- if (val) *val = v;
- return SWIG_OK;
- } else {
- PyErr_Clear();
- }
- }
-%#ifdef SWIG_PYTHON_CAST_MODE
- {
- int dispatch = 0;
- unsigned long v = PyLong_AsUnsignedLong(obj);
- if (!PyErr_Occurred()) {
- if (val) *val = v;
- return SWIG_AddCast(SWIG_OK);
- } else {
- PyErr_Clear();
- }
- if (!dispatch) {
- double d;
- int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d));
- if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
- if (val) *val = (unsigned long)(d);
- return res;
- }
- }
- }
-%#endif
- if (!PyArray_IsScalar(obj,Integer)) return SWIG_TypeError;
- PyArray_CastScalarToCtype(obj, (void*)val, ulongDescr);
- return SWIG_OK;
- }
-}
diff --git a/numpy/doc/swig/test/Array.i b/numpy/doc/swig/test/Array.i
deleted file mode 100644
index d56dd2d1c..000000000
--- a/numpy/doc/swig/test/Array.i
+++ /dev/null
@@ -1,107 +0,0 @@
-// -*- c++ -*-
-
-%module Array
-
-%{
-#define SWIG_FILE_WITH_INIT
-#include "Array1.h"
-#include "Array2.h"
-%}
-
-// Get the NumPy typemaps
-%include "../numpy.i"
-
- // Get the STL typemaps
-%include "stl.i"
-
-// Handle standard exceptions
-%include "exception.i"
-%exception
-{
- try
- {
- $action
- }
- catch (const std::invalid_argument& e)
- {
- SWIG_exception(SWIG_ValueError, e.what());
- }
- catch (const std::out_of_range& e)
- {
- SWIG_exception(SWIG_IndexError, e.what());
- }
-}
-%init %{
- import_array();
-%}
-
-// Global ignores
-%ignore *::operator=;
-%ignore *::operator[];
-
-// Apply the 1D NumPy typemaps
-%apply (int DIM1 , long* INPLACE_ARRAY1)
- {(int length, long* data )};
-%apply (long** ARGOUTVIEW_ARRAY1, int* DIM1 )
- {(long** data , int* length)};
-
-// Apply the 2D NumPy typemaps
-%apply (int DIM1 , int DIM2 , long* INPLACE_ARRAY2)
- {(int nrows, int ncols, long* data )};
-%apply (int* DIM1 , int* DIM2 , long** ARGOUTVIEW_ARRAY2)
- {(int* nrows, int* ncols, long** data )};
-// Note: the %apply for INPLACE_ARRAY2 above gets successfully applied
-// to the constructor Array2(int nrows, int ncols, long* data), but
-// does not get applied to the method Array2::resize(int nrows, int
-// ncols, long* data). I have no idea why. For this reason the test
-// for Apply2.resize(numpy.ndarray) in testArray.py is commented out.
-
-// Array1 support
-%include "Array1.h"
-%extend Array1
-{
- void __setitem__(int i, long v)
- {
- self->operator[](i) = v;
- }
-
- long __getitem__(int i)
- {
- return self->operator[](i);
- }
-
- int __len__()
- {
- return self->length();
- }
-
- std::string __str__()
- {
- return self->asString();
- }
-}
-
-// Array2 support
-%include "Array2.h"
-%extend Array2
-{
- void __setitem__(int i, Array1 & v)
- {
- self->operator[](i) = v;
- }
-
- Array1 & __getitem__(int i)
- {
- return self->operator[](i);
- }
-
- int __len__()
- {
- return self->nrows() * self->ncols();
- }
-
- std::string __str__()
- {
- return self->asString();
- }
-}
diff --git a/numpy/doc/swig/test/Array1.cxx b/numpy/doc/swig/test/Array1.cxx
deleted file mode 100644
index 0c09e02f9..000000000
--- a/numpy/doc/swig/test/Array1.cxx
+++ /dev/null
@@ -1,131 +0,0 @@
-#include "Array1.h"
-#include <iostream>
-#include <sstream>
-
-// Default/length/array constructor
-Array1::Array1(int length, long* data) :
- _ownData(false), _length(0), _buffer(0)
-{
- resize(length, data);
-}
-
-// Copy constructor
-Array1::Array1(const Array1 & source) :
- _length(source._length)
-{
- allocateMemory();
- *this = source;
-}
-
-// Destructor
-Array1::~Array1()
-{
- deallocateMemory();
-}
-
-// Assignment operator
-Array1 & Array1::operator=(const Array1 & source)
-{
- int len = _length < source._length ? _length : source._length;
- for (int i=0; i < len; ++i)
- {
- (*this)[i] = source[i];
- }
- return *this;
-}
-
-// Equals operator
-bool Array1::operator==(const Array1 & other) const
-{
- if (_length != other._length) return false;
- for (int i=0; i < _length; ++i)
- {
- if ((*this)[i] != other[i]) return false;
- }
- return true;
-}
-
-// Length accessor
-int Array1::length() const
-{
- return _length;
-}
-
-// Resize array
-void Array1::resize(int length, long* data)
-{
- if (length < 0) throw std::invalid_argument("Array1 length less than 0");
- if (length == _length) return;
- deallocateMemory();
- _length = length;
- if (!data)
- {
- allocateMemory();
- }
- else
- {
- _ownData = false;
- _buffer = data;
- }
-}
-
-// Set item accessor
-long & Array1::operator[](int i)
-{
- if (i < 0 || i >= _length) throw std::out_of_range("Array1 index out of range");
- return _buffer[i];
-}
-
-// Get item accessor
-const long & Array1::operator[](int i) const
-{
- if (i < 0 || i >= _length) throw std::out_of_range("Array1 index out of range");
- return _buffer[i];
-}
-
-// String output
-std::string Array1::asString() const
-{
- std::stringstream result;
- result << "[";
- for (int i=0; i < _length; ++i)
- {
- result << " " << _buffer[i];
- if (i < _length-1) result << ",";
- }
- result << " ]";
- return result.str();
-}
-
-// Get view
-void Array1::view(long** data, int* length) const
-{
- *data = _buffer;
- *length = _length;
-}
-
-// Private methods
- void Array1::allocateMemory()
- {
- if (_length == 0)
- {
- _ownData = false;
- _buffer = 0;
- }
- else
- {
- _ownData = true;
- _buffer = new long[_length];
- }
- }
-
- void Array1::deallocateMemory()
- {
- if (_ownData && _length && _buffer)
- {
- delete [] _buffer;
- }
- _ownData = false;
- _length = 0;
- _buffer = 0;
- }
diff --git a/numpy/doc/swig/test/Array1.h b/numpy/doc/swig/test/Array1.h
deleted file mode 100644
index 754c248fc..000000000
--- a/numpy/doc/swig/test/Array1.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef ARRAY1_H
-#define ARRAY1_H
-
-#include <stdexcept>
-#include <string>
-
-class Array1
-{
-public:
-
- // Default/length/array constructor
- Array1(int length = 0, long* data = 0);
-
- // Copy constructor
- Array1(const Array1 & source);
-
- // Destructor
- ~Array1();
-
- // Assignment operator
- Array1 & operator=(const Array1 & source);
-
- // Equals operator
- bool operator==(const Array1 & other) const;
-
- // Length accessor
- int length() const;
-
- // Resize array
- void resize(int length, long* data = 0);
-
- // Set item accessor
- long & operator[](int i);
-
- // Get item accessor
- const long & operator[](int i) const;
-
- // String output
- std::string asString() const;
-
- // Get view
- void view(long** data, int* length) const;
-
-private:
- // Members
- bool _ownData;
- int _length;
- long * _buffer;
-
- // Methods
- void allocateMemory();
- void deallocateMemory();
-};
-
-#endif
diff --git a/numpy/doc/swig/test/Array2.cxx b/numpy/doc/swig/test/Array2.cxx
deleted file mode 100644
index e3558f786..000000000
--- a/numpy/doc/swig/test/Array2.cxx
+++ /dev/null
@@ -1,168 +0,0 @@
-#include "Array2.h"
-#include <sstream>
-
-// Default constructor
-Array2::Array2() :
- _ownData(false), _nrows(0), _ncols(), _buffer(0), _rows(0)
-{ }
-
-// Size/array constructor
-Array2::Array2(int nrows, int ncols, long* data) :
- _ownData(false), _nrows(0), _ncols(), _buffer(0), _rows(0)
-{
- resize(nrows, ncols, data);
-}
-
-// Copy constructor
-Array2::Array2(const Array2 & source) :
- _nrows(source._nrows), _ncols(source._ncols)
-{
- _ownData = true;
- allocateMemory();
- *this = source;
-}
-
-// Destructor
-Array2::~Array2()
-{
- deallocateMemory();
-}
-
-// Assignment operator
-Array2 & Array2::operator=(const Array2 & source)
-{
- int nrows = _nrows < source._nrows ? _nrows : source._nrows;
- int ncols = _ncols < source._ncols ? _ncols : source._ncols;
- for (int i=0; i < nrows; ++i)
- {
- for (int j=0; j < ncols; ++j)
- {
- (*this)[i][j] = source[i][j];
- }
- }
- return *this;
-}
-
-// Equals operator
-bool Array2::operator==(const Array2 & other) const
-{
- if (_nrows != other._nrows) return false;
- if (_ncols != other._ncols) return false;
- for (int i=0; i < _nrows; ++i)
- {
- for (int j=0; j < _ncols; ++j)
- {
- if ((*this)[i][j] != other[i][j]) return false;
- }
- }
- return true;
-}
-
-// Length accessors
-int Array2::nrows() const
-{
- return _nrows;
-}
-
-int Array2::ncols() const
-{
- return _ncols;
-}
-
-// Resize array
-void Array2::resize(int nrows, int ncols, long* data)
-{
- if (nrows < 0) throw std::invalid_argument("Array2 nrows less than 0");
- if (ncols < 0) throw std::invalid_argument("Array2 ncols less than 0");
- if (nrows == _nrows && ncols == _ncols) return;
- deallocateMemory();
- _nrows = nrows;
- _ncols = ncols;
- if (!data)
- {
- allocateMemory();
- }
- else
- {
- _ownData = false;
- _buffer = data;
- allocateRows();
- }
-}
-
-// Set item accessor
-Array1 & Array2::operator[](int i)
-{
- if (i < 0 || i > _nrows) throw std::out_of_range("Array2 row index out of range");
- return _rows[i];
-}
-
-// Get item accessor
-const Array1 & Array2::operator[](int i) const
-{
- if (i < 0 || i > _nrows) throw std::out_of_range("Array2 row index out of range");
- return _rows[i];
-}
-
-// String output
-std::string Array2::asString() const
-{
- std::stringstream result;
- result << "[ ";
- for (int i=0; i < _nrows; ++i)
- {
- if (i > 0) result << " ";
- result << (*this)[i].asString();
- if (i < _nrows-1) result << "," << std::endl;
- }
- result << " ]" << std::endl;
- return result.str();
-}
-
-// Get view
-void Array2::view(int* nrows, int* ncols, long** data) const
-{
- *nrows = _nrows;
- *ncols = _ncols;
- *data = _buffer;
-}
-
-// Private methods
-void Array2::allocateMemory()
-{
- if (_nrows * _ncols == 0)
- {
- _ownData = false;
- _buffer = 0;
- _rows = 0;
- }
- else
- {
- _ownData = true;
- _buffer = new long[_nrows*_ncols];
- allocateRows();
- }
-}
-
-void Array2::allocateRows()
-{
- _rows = new Array1[_nrows];
- for (int i=0; i < _nrows; ++i)
- {
- _rows[i].resize(_ncols, &_buffer[i*_ncols]);
- }
-}
-
-void Array2::deallocateMemory()
-{
- if (_ownData && _nrows*_ncols && _buffer)
- {
- delete [] _rows;
- delete [] _buffer;
- }
- _ownData = false;
- _nrows = 0;
- _ncols = 0;
- _buffer = 0;
- _rows = 0;
-}
diff --git a/numpy/doc/swig/test/Array2.h b/numpy/doc/swig/test/Array2.h
deleted file mode 100644
index a6e5bfc30..000000000
--- a/numpy/doc/swig/test/Array2.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef ARRAY2_H
-#define ARRAY2_H
-
-#include "Array1.h"
-#include <stdexcept>
-#include <string>
-
-class Array2
-{
-public:
-
- // Default constructor
- Array2();
-
- // Size/array constructor
- Array2(int nrows, int ncols, long* data=0);
-
- // Copy constructor
- Array2(const Array2 & source);
-
- // Destructor
- ~Array2();
-
- // Assignment operator
- Array2 & operator=(const Array2 & source);
-
- // Equals operator
- bool operator==(const Array2 & other) const;
-
- // Length accessors
- int nrows() const;
- int ncols() const;
-
- // Resize array
- void resize(int ncols, int nrows, long* data=0);
-
- // Set item accessor
- Array1 & operator[](int i);
-
- // Get item accessor
- const Array1 & operator[](int i) const;
-
- // String output
- std::string asString() const;
-
- // Get view
- void view(int* nrows, int* ncols, long** data) const;
-
-private:
- // Members
- bool _ownData;
- int _nrows;
- int _ncols;
- long * _buffer;
- Array1 * _rows;
-
- // Methods
- void allocateMemory();
- void allocateRows();
- void deallocateMemory();
-};
-
-#endif
diff --git a/numpy/doc/swig/test/Farray.cxx b/numpy/doc/swig/test/Farray.cxx
deleted file mode 100644
index 3983c333b..000000000
--- a/numpy/doc/swig/test/Farray.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-#include "Farray.h"
-#include <sstream>
-
-// Size constructor
-Farray::Farray(int nrows, int ncols) :
- _nrows(nrows), _ncols(ncols), _buffer(0)
-{
- allocateMemory();
-}
-
-// Copy constructor
-Farray::Farray(const Farray & source) :
- _nrows(source._nrows), _ncols(source._ncols)
-{
- allocateMemory();
- *this = source;
-}
-
-// Destructor
-Farray::~Farray()
-{
- delete [] _buffer;
-}
-
-// Assignment operator
-Farray & Farray::operator=(const Farray & source)
-{
- int nrows = _nrows < source._nrows ? _nrows : source._nrows;
- int ncols = _ncols < source._ncols ? _ncols : source._ncols;
- for (int i=0; i < nrows; ++i)
- {
- for (int j=0; j < ncols; ++j)
- {
- (*this)(i,j) = source(i,j);
- }
- }
- return *this;
-}
-
-// Equals operator
-bool Farray::operator==(const Farray & other) const
-{
- if (_nrows != other._nrows) return false;
- if (_ncols != other._ncols) return false;
- for (int i=0; i < _nrows; ++i)
- {
- for (int j=0; j < _ncols; ++j)
- {
- if ((*this)(i,j) != other(i,j)) return false;
- }
- }
- return true;
-}
-
-// Length accessors
-int Farray::nrows() const
-{
- return _nrows;
-}
-
-int Farray::ncols() const
-{
- return _ncols;
-}
-
-// Set item accessor
-long & Farray::operator()(int i, int j)
-{
- if (i < 0 || i > _nrows) throw std::out_of_range("Farray row index out of range");
- if (j < 0 || j > _ncols) throw std::out_of_range("Farray col index out of range");
- return _buffer[offset(i,j)];
-}
-
-// Get item accessor
-const long & Farray::operator()(int i, int j) const
-{
- if (i < 0 || i > _nrows) throw std::out_of_range("Farray row index out of range");
- if (j < 0 || j > _ncols) throw std::out_of_range("Farray col index out of range");
- return _buffer[offset(i,j)];
-}
-
-// String output
-std::string Farray::asString() const
-{
- std::stringstream result;
- result << "[ ";
- for (int i=0; i < _nrows; ++i)
- {
- if (i > 0) result << " ";
- result << "[";
- for (int j=0; j < _ncols; ++j)
- {
- result << " " << (*this)(i,j);
- if (j < _ncols-1) result << ",";
- }
- result << " ]";
- if (i < _nrows-1) result << "," << std::endl;
- }
- result << " ]" << std::endl;
- return result.str();
-}
-
-// Get view
-void Farray::view(int* nrows, int* ncols, long** data) const
-{
- *nrows = _nrows;
- *ncols = _ncols;
- *data = _buffer;
-}
-
-// Private methods
-void Farray::allocateMemory()
-{
- if (_nrows <= 0) throw std::invalid_argument("Farray nrows <= 0");
- if (_ncols <= 0) throw std::invalid_argument("Farray ncols <= 0");
- _buffer = new long[_nrows*_ncols];
-}
-
-inline int Farray::offset(int i, int j) const
-{
- return i + j * _nrows;
-}
diff --git a/numpy/doc/swig/test/Farray.h b/numpy/doc/swig/test/Farray.h
deleted file mode 100644
index 4199a287c..000000000
--- a/numpy/doc/swig/test/Farray.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef FARRAY_H
-#define FARRAY_H
-
-#include <stdexcept>
-#include <string>
-
-class Farray
-{
-public:
-
- // Size constructor
- Farray(int nrows, int ncols);
-
- // Copy constructor
- Farray(const Farray & source);
-
- // Destructor
- ~Farray();
-
- // Assignment operator
- Farray & operator=(const Farray & source);
-
- // Equals operator
- bool operator==(const Farray & other) const;
-
- // Length accessors
- int nrows() const;
- int ncols() const;
-
- // Set item accessor
- long & operator()(int i, int j);
-
- // Get item accessor
- const long & operator()(int i, int j) const;
-
- // String output
- std::string asString() const;
-
- // Get view
- void view(int* nrows, int* ncols, long** data) const;
-
-private:
- // Members
- int _nrows;
- int _ncols;
- long * _buffer;
-
- // Default constructor: not implemented
- Farray();
-
- // Methods
- void allocateMemory();
- int offset(int i, int j) const;
-};
-
-#endif
diff --git a/numpy/doc/swig/test/Farray.i b/numpy/doc/swig/test/Farray.i
deleted file mode 100644
index 25f6cd025..000000000
--- a/numpy/doc/swig/test/Farray.i
+++ /dev/null
@@ -1,73 +0,0 @@
-// -*- c++ -*-
-
-%module Farray
-
-%{
-#define SWIG_FILE_WITH_INIT
-#include "Farray.h"
-%}
-
-// Get the NumPy typemaps
-%include "../numpy.i"
-
- // Get the STL typemaps
-%include "stl.i"
-
-// Handle standard exceptions
-%include "exception.i"
-%exception
-{
- try
- {
- $action
- }
- catch (const std::invalid_argument& e)
- {
- SWIG_exception(SWIG_ValueError, e.what());
- }
- catch (const std::out_of_range& e)
- {
- SWIG_exception(SWIG_IndexError, e.what());
- }
-}
-%init %{
- import_array();
-%}
-
-// Global ignores
-%ignore *::operator=;
-%ignore *::operator();
-
-// Apply the 2D NumPy typemaps
-%apply (int* DIM1 , int* DIM2 , long** ARGOUTVIEW_FARRAY2)
- {(int* nrows, int* ncols, long** data )};
-
-// Farray support
-%include "Farray.h"
-%extend Farray
-{
- PyObject * __setitem__(PyObject* index, long v)
- {
- int i, j;
- if (!PyArg_ParseTuple(index, "ii:Farray___setitem__",&i,&j)) return NULL;
- self->operator()(i,j) = v;
- return Py_BuildValue("");
- }
-
- PyObject * __getitem__(PyObject * index)
- {
- int i, j;
- if (!PyArg_ParseTuple(index, "ii:Farray___getitem__",&i,&j)) return NULL;
- return SWIG_From_long(self->operator()(i,j));
- }
-
- int __len__()
- {
- return self->nrows() * self->ncols();
- }
-
- std::string __str__()
- {
- return self->asString();
- }
-}
diff --git a/numpy/doc/swig/test/Fortran.cxx b/numpy/doc/swig/test/Fortran.cxx
deleted file mode 100644
index 475d21ddc..000000000
--- a/numpy/doc/swig/test/Fortran.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <stdlib.h>
-#include <math.h>
-#include <iostream>
-#include "Fortran.h"
-
-#define TEST_FUNCS(TYPE, SNAME) \
-\
-TYPE SNAME ## SecondElement(TYPE * matrix, int rows, int cols) { \
- TYPE result = matrix[1]; \
- return result; \
-} \
-
-TEST_FUNCS(signed char , schar )
-TEST_FUNCS(unsigned char , uchar )
-TEST_FUNCS(short , short )
-TEST_FUNCS(unsigned short , ushort )
-TEST_FUNCS(int , int )
-TEST_FUNCS(unsigned int , uint )
-TEST_FUNCS(long , long )
-TEST_FUNCS(unsigned long , ulong )
-TEST_FUNCS(long long , longLong )
-TEST_FUNCS(unsigned long long, ulongLong)
-TEST_FUNCS(float , float )
-TEST_FUNCS(double , double )
diff --git a/numpy/doc/swig/test/Fortran.h b/numpy/doc/swig/test/Fortran.h
deleted file mode 100644
index c243bb50f..000000000
--- a/numpy/doc/swig/test/Fortran.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef FORTRAN_H
-#define FORTRAN_H
-
-#define TEST_FUNC_PROTOS(TYPE, SNAME) \
-\
-TYPE SNAME ## SecondElement( TYPE * matrix, int rows, int cols); \
-
-TEST_FUNC_PROTOS(signed char , schar )
-TEST_FUNC_PROTOS(unsigned char , uchar )
-TEST_FUNC_PROTOS(short , short )
-TEST_FUNC_PROTOS(unsigned short , ushort )
-TEST_FUNC_PROTOS(int , int )
-TEST_FUNC_PROTOS(unsigned int , uint )
-TEST_FUNC_PROTOS(long , long )
-TEST_FUNC_PROTOS(unsigned long , ulong )
-TEST_FUNC_PROTOS(long long , longLong )
-TEST_FUNC_PROTOS(unsigned long long, ulongLong)
-TEST_FUNC_PROTOS(float , float )
-TEST_FUNC_PROTOS(double , double )
-
-#endif
diff --git a/numpy/doc/swig/test/Fortran.i b/numpy/doc/swig/test/Fortran.i
deleted file mode 100644
index 131790dd6..000000000
--- a/numpy/doc/swig/test/Fortran.i
+++ /dev/null
@@ -1,36 +0,0 @@
-// -*- c++ -*-
-%module Fortran
-
-%{
-#define SWIG_FILE_WITH_INIT
-#include "Fortran.h"
-%}
-
-// Get the NumPy typemaps
-%include "../numpy.i"
-
-%init %{
- import_array();
-%}
-
-%define %apply_numpy_typemaps(TYPE)
-
-%apply (TYPE* IN_FARRAY2, int DIM1, int DIM2) {(TYPE* matrix, int rows, int cols)};
-
-%enddef /* %apply_numpy_typemaps() macro */
-
-%apply_numpy_typemaps(signed char )
-%apply_numpy_typemaps(unsigned char )
-%apply_numpy_typemaps(short )
-%apply_numpy_typemaps(unsigned short )
-%apply_numpy_typemaps(int )
-%apply_numpy_typemaps(unsigned int )
-%apply_numpy_typemaps(long )
-%apply_numpy_typemaps(unsigned long )
-%apply_numpy_typemaps(long long )
-%apply_numpy_typemaps(unsigned long long)
-%apply_numpy_typemaps(float )
-%apply_numpy_typemaps(double )
-
-// Include the header file to be wrapped
-%include "Fortran.h"
diff --git a/numpy/doc/swig/test/Makefile b/numpy/doc/swig/test/Makefile
deleted file mode 100644
index 5360b1ced..000000000
--- a/numpy/doc/swig/test/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-# SWIG
-INTERFACES = Array.i Farray.i Vector.i Matrix.i Tensor.i Fortran.i
-WRAPPERS = $(INTERFACES:.i=_wrap.cxx)
-PROXIES = $(INTERFACES:.i=.py )
-
-# Default target: build the tests
-.PHONY : all
-all: $(WRAPPERS) Array1.cxx Array1.h Farray.cxx Farray.h Vector.cxx Vector.h \
- Matrix.cxx Matrix.h Tensor.cxx Tensor.h Fortran.h Fortran.cxx
- ./setup.py build_ext -i
-
-# Test target: run the tests
-.PHONY : test
-test: all
- python testVector.py
- python testMatrix.py
- python testTensor.py
- python testArray.py
- python testFarray.py
- python testFortran.py
-
-# Rule: %.i -> %_wrap.cxx
-%_wrap.cxx: %.i %.h ../numpy.i
- swig -c++ -python $<
-%_wrap.cxx: %.i %1.h %2.h ../numpy.i
- swig -c++ -python $<
-
-# Clean target
-.PHONY : clean
-clean:
- $(RM) -r build
- $(RM) *.so
- $(RM) $(WRAPPERS)
- $(RM) $(PROXIES)
diff --git a/numpy/doc/swig/test/Matrix.cxx b/numpy/doc/swig/test/Matrix.cxx
deleted file mode 100644
index b953d7017..000000000
--- a/numpy/doc/swig/test/Matrix.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-#include <stdlib.h>
-#include <math.h>
-#include <iostream>
-#include "Matrix.h"
-
-// The following macro defines a family of functions that work with 2D
-// arrays with the forms
-//
-// TYPE SNAMEDet( TYPE matrix[2][2]);
-// TYPE SNAMEMax( TYPE * matrix, int rows, int cols);
-// TYPE SNAMEMin( int rows, int cols, TYPE * matrix);
-// void SNAMEScale( TYPE matrix[3][3]);
-// void SNAMEFloor( TYPE * array, int rows, int cols, TYPE floor);
-// void SNAMECeil( int rows, int cols, TYPE * array, TYPE ceil);
-// void SNAMELUSplit(TYPE in[3][3], TYPE lower[3][3], TYPE upper[3][3]);
-//
-// for any specified type TYPE (for example: short, unsigned int, long
-// long, etc.) with given short name SNAME (for example: short, uint,
-// longLong, etc.). The macro is then expanded for the given
-// TYPE/SNAME pairs. The resulting functions are for testing numpy
-// interfaces, respectively, for:
-//
-// * 2D input arrays, hard-coded length
-// * 2D input arrays
-// * 2D input arrays, data last
-// * 2D in-place arrays, hard-coded lengths
-// * 2D in-place arrays
-// * 2D in-place arrays, data last
-// * 2D argout arrays, hard-coded length
-//
-#define TEST_FUNCS(TYPE, SNAME) \
-\
-TYPE SNAME ## Det(TYPE matrix[2][2]) { \
- return matrix[0][0]*matrix[1][1] - matrix[0][1]*matrix[1][0]; \
-} \
-\
-TYPE SNAME ## Max(TYPE * matrix, int rows, int cols) { \
- int i, j, index; \
- TYPE result = matrix[0]; \
- for (j=0; j<cols; ++j) { \
- for (i=0; i<rows; ++i) { \
- index = j*rows + i; \
- if (matrix[index] > result) result = matrix[index]; \
- } \
- } \
- return result; \
-} \
-\
-TYPE SNAME ## Min(int rows, int cols, TYPE * matrix) { \
- int i, j, index; \
- TYPE result = matrix[0]; \
- for (j=0; j<cols; ++j) { \
- for (i=0; i<rows; ++i) { \
- index = j*rows + i; \
- if (matrix[index] < result) result = matrix[index]; \
- } \
- } \
- return result; \
-} \
-\
-void SNAME ## Scale(TYPE array[3][3], TYPE val) { \
- for (int i=0; i<3; ++i) \
- for (int j=0; j<3; ++j) \
- array[i][j] *= val; \
-} \
-\
-void SNAME ## Floor(TYPE * array, int rows, int cols, TYPE floor) { \
- int i, j, index; \
- for (j=0; j<cols; ++j) { \
- for (i=0; i<rows; ++i) { \
- index = j*rows + i; \
- if (array[index] < floor) array[index] = floor; \
- } \
- } \
-} \
-\
-void SNAME ## Ceil(int rows, int cols, TYPE * array, TYPE ceil) { \
- int i, j, index; \
- for (j=0; j<cols; ++j) { \
- for (i=0; i<rows; ++i) { \
- index = j*rows + i; \
- if (array[index] > ceil) array[index] = ceil; \
- } \
- } \
-} \
-\
-void SNAME ## LUSplit(TYPE matrix[3][3], TYPE lower[3][3], TYPE upper[3][3]) { \
- for (int i=0; i<3; ++i) { \
- for (int j=0; j<3; ++j) { \
- if (i >= j) { \
- lower[i][j] = matrix[i][j]; \
- upper[i][j] = 0; \
- } else { \
- lower[i][j] = 0; \
- upper[i][j] = matrix[i][j]; \
- } \
- } \
- } \
-}
-
-TEST_FUNCS(signed char , schar )
-TEST_FUNCS(unsigned char , uchar )
-TEST_FUNCS(short , short )
-TEST_FUNCS(unsigned short , ushort )
-TEST_FUNCS(int , int )
-TEST_FUNCS(unsigned int , uint )
-TEST_FUNCS(long , long )
-TEST_FUNCS(unsigned long , ulong )
-TEST_FUNCS(long long , longLong )
-TEST_FUNCS(unsigned long long, ulongLong)
-TEST_FUNCS(float , float )
-TEST_FUNCS(double , double )
diff --git a/numpy/doc/swig/test/Matrix.h b/numpy/doc/swig/test/Matrix.h
deleted file mode 100644
index f37836cc4..000000000
--- a/numpy/doc/swig/test/Matrix.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef MATRIX_H
-#define MATRIX_H
-
-// The following macro defines the prototypes for a family of
-// functions that work with 2D arrays with the forms
-//
-// TYPE SNAMEDet( TYPE matrix[2][2]);
-// TYPE SNAMEMax( TYPE * matrix, int rows, int cols);
-// TYPE SNAMEMin( int rows, int cols, TYPE * matrix);
-// void SNAMEScale( TYPE array[3][3]);
-// void SNAMEFloor( TYPE * array, int rows, int cols, TYPE floor);
-// void SNAMECeil( int rows, int cols, TYPE * array, TYPE ceil );
-// void SNAMELUSplit(TYPE in[3][3], TYPE lower[3][3], TYPE upper[3][3]);
-//
-// for any specified type TYPE (for example: short, unsigned int, long
-// long, etc.) with given short name SNAME (for example: short, uint,
-// longLong, etc.). The macro is then expanded for the given
-// TYPE/SNAME pairs. The resulting functions are for testing numpy
-// interfaces, respectively, for:
-//
-// * 2D input arrays, hard-coded lengths
-// * 2D input arrays
-// * 2D input arrays, data last
-// * 2D in-place arrays, hard-coded lengths
-// * 2D in-place arrays
-// * 2D in-place arrays, data last
-// * 2D argout arrays, hard-coded length
-//
-#define TEST_FUNC_PROTOS(TYPE, SNAME) \
-\
-TYPE SNAME ## Det( TYPE matrix[2][2]); \
-TYPE SNAME ## Max( TYPE * matrix, int rows, int cols); \
-TYPE SNAME ## Min( int rows, int cols, TYPE * matrix); \
-void SNAME ## Scale( TYPE array[3][3], TYPE val); \
-void SNAME ## Floor( TYPE * array, int rows, int cols, TYPE floor); \
-void SNAME ## Ceil( int rows, int cols, TYPE * array, TYPE ceil ); \
-void SNAME ## LUSplit(TYPE matrix[3][3], TYPE lower[3][3], TYPE upper[3][3]);
-
-TEST_FUNC_PROTOS(signed char , schar )
-TEST_FUNC_PROTOS(unsigned char , uchar )
-TEST_FUNC_PROTOS(short , short )
-TEST_FUNC_PROTOS(unsigned short , ushort )
-TEST_FUNC_PROTOS(int , int )
-TEST_FUNC_PROTOS(unsigned int , uint )
-TEST_FUNC_PROTOS(long , long )
-TEST_FUNC_PROTOS(unsigned long , ulong )
-TEST_FUNC_PROTOS(long long , longLong )
-TEST_FUNC_PROTOS(unsigned long long, ulongLong)
-TEST_FUNC_PROTOS(float , float )
-TEST_FUNC_PROTOS(double , double )
-
-#endif
diff --git a/numpy/doc/swig/test/Matrix.i b/numpy/doc/swig/test/Matrix.i
deleted file mode 100644
index e721397a0..000000000
--- a/numpy/doc/swig/test/Matrix.i
+++ /dev/null
@@ -1,45 +0,0 @@
-// -*- c++ -*-
-%module Matrix
-
-%{
-#define SWIG_FILE_WITH_INIT
-#include "Matrix.h"
-%}
-
-// Get the NumPy typemaps
-%include "../numpy.i"
-
-%init %{
- import_array();
-%}
-
-%define %apply_numpy_typemaps(TYPE)
-
-%apply (TYPE IN_ARRAY2[ANY][ANY]) {(TYPE matrix[ANY][ANY])};
-%apply (TYPE* IN_ARRAY2, int DIM1, int DIM2) {(TYPE* matrix, int rows, int cols)};
-%apply (int DIM1, int DIM2, TYPE* IN_ARRAY2) {(int rows, int cols, TYPE* matrix)};
-
-%apply (TYPE INPLACE_ARRAY2[ANY][ANY]) {(TYPE array[3][3])};
-%apply (TYPE* INPLACE_ARRAY2, int DIM1, int DIM2) {(TYPE* array, int rows, int cols)};
-%apply (int DIM1, int DIM2, TYPE* INPLACE_ARRAY2) {(int rows, int cols, TYPE* array)};
-
-%apply (TYPE ARGOUT_ARRAY2[ANY][ANY]) {(TYPE lower[3][3])};
-%apply (TYPE ARGOUT_ARRAY2[ANY][ANY]) {(TYPE upper[3][3])};
-
-%enddef /* %apply_numpy_typemaps() macro */
-
-%apply_numpy_typemaps(signed char )
-%apply_numpy_typemaps(unsigned char )
-%apply_numpy_typemaps(short )
-%apply_numpy_typemaps(unsigned short )
-%apply_numpy_typemaps(int )
-%apply_numpy_typemaps(unsigned int )
-%apply_numpy_typemaps(long )
-%apply_numpy_typemaps(unsigned long )
-%apply_numpy_typemaps(long long )
-%apply_numpy_typemaps(unsigned long long)
-%apply_numpy_typemaps(float )
-%apply_numpy_typemaps(double )
-
-// Include the header file to be wrapped
-%include "Matrix.h"
diff --git a/numpy/doc/swig/test/Tensor.cxx b/numpy/doc/swig/test/Tensor.cxx
deleted file mode 100644
index dce595291..000000000
--- a/numpy/doc/swig/test/Tensor.cxx
+++ /dev/null
@@ -1,131 +0,0 @@
-#include <stdlib.h>
-#include <math.h>
-#include <iostream>
-#include "Tensor.h"
-
-// The following macro defines a family of functions that work with 3D
-// arrays with the forms
-//
-// TYPE SNAMENorm( TYPE tensor[2][2][2]);
-// TYPE SNAMEMax( TYPE * tensor, int rows, int cols, int num);
-// TYPE SNAMEMin( int rows, int cols, int num, TYPE * tensor);
-// void SNAMEScale( TYPE tensor[3][3][3]);
-// void SNAMEFloor( TYPE * array, int rows, int cols, int num, TYPE floor);
-// void SNAMECeil( int rows, int cols, int num, TYPE * array, TYPE ceil);
-// void SNAMELUSplit(TYPE in[2][2][2], TYPE lower[2][2][2], TYPE upper[2][2][2]);
-//
-// for any specified type TYPE (for example: short, unsigned int, long
-// long, etc.) with given short name SNAME (for example: short, uint,
-// longLong, etc.). The macro is then expanded for the given
-// TYPE/SNAME pairs. The resulting functions are for testing numpy
-// interfaces, respectively, for:
-//
-// * 3D input arrays, hard-coded length
-// * 3D input arrays
-// * 3D input arrays, data last
-// * 3D in-place arrays, hard-coded lengths
-// * 3D in-place arrays
-// * 3D in-place arrays, data last
-// * 3D argout arrays, hard-coded length
-//
-#define TEST_FUNCS(TYPE, SNAME) \
-\
-TYPE SNAME ## Norm(TYPE tensor[2][2][2]) { \
- double result = 0; \
- for (int k=0; k<2; ++k) \
- for (int j=0; j<2; ++j) \
- for (int i=0; i<2; ++i) \
- result += tensor[i][j][k] * tensor[i][j][k]; \
- return (TYPE)sqrt(result/8); \
-} \
-\
-TYPE SNAME ## Max(TYPE * tensor, int rows, int cols, int num) { \
- int i, j, k, index; \
- TYPE result = tensor[0]; \
- for (k=0; k<num; ++k) { \
- for (j=0; j<cols; ++j) { \
- for (i=0; i<rows; ++i) { \
- index = k*rows*cols + j*rows + i; \
- if (tensor[index] > result) result = tensor[index]; \
- } \
- } \
- } \
- return result; \
-} \
-\
-TYPE SNAME ## Min(int rows, int cols, int num, TYPE * tensor) { \
- int i, j, k, index; \
- TYPE result = tensor[0]; \
- for (k=0; k<num; ++k) { \
- for (j=0; j<cols; ++j) { \
- for (i=0; i<rows; ++i) { \
- index = k*rows*cols + j*rows + i; \
- if (tensor[index] < result) result = tensor[index]; \
- } \
- } \
- } \
- return result; \
-} \
-\
-void SNAME ## Scale(TYPE array[3][3][3], TYPE val) { \
- for (int i=0; i<3; ++i) \
- for (int j=0; j<3; ++j) \
- for (int k=0; k<3; ++k) \
- array[i][j][k] *= val; \
-} \
-\
-void SNAME ## Floor(TYPE * array, int rows, int cols, int num, TYPE floor) { \
- int i, j, k, index; \
- for (k=0; k<num; ++k) { \
- for (j=0; j<cols; ++j) { \
- for (i=0; i<rows; ++i) { \
- index = k*cols*rows + j*rows + i; \
- if (array[index] < floor) array[index] = floor; \
- } \
- } \
- } \
-} \
-\
-void SNAME ## Ceil(int rows, int cols, int num, TYPE * array, TYPE ceil) { \
- int i, j, k, index; \
- for (k=0; k<num; ++k) { \
- for (j=0; j<cols; ++j) { \
- for (i=0; i<rows; ++i) { \
- index = j*rows + i; \
- if (array[index] > ceil) array[index] = ceil; \
- } \
- } \
- } \
-} \
-\
-void SNAME ## LUSplit(TYPE tensor[2][2][2], TYPE lower[2][2][2], \
- TYPE upper[2][2][2]) { \
- int sum; \
- for (int k=0; k<2; ++k) { \
- for (int j=0; j<2; ++j) { \
- for (int i=0; i<2; ++i) { \
- sum = i + j + k; \
- if (sum < 2) { \
- lower[i][j][k] = tensor[i][j][k]; \
- upper[i][j][k] = 0; \
- } else { \
- upper[i][j][k] = tensor[i][j][k]; \
- lower[i][j][k] = 0; \
- } \
- } \
- } \
- } \
-}
-
-TEST_FUNCS(signed char , schar )
-TEST_FUNCS(unsigned char , uchar )
-TEST_FUNCS(short , short )
-TEST_FUNCS(unsigned short , ushort )
-TEST_FUNCS(int , int )
-TEST_FUNCS(unsigned int , uint )
-TEST_FUNCS(long , long )
-TEST_FUNCS(unsigned long , ulong )
-TEST_FUNCS(long long , longLong )
-TEST_FUNCS(unsigned long long, ulongLong)
-TEST_FUNCS(float , float )
-TEST_FUNCS(double , double )
diff --git a/numpy/doc/swig/test/Tensor.h b/numpy/doc/swig/test/Tensor.h
deleted file mode 100644
index d60eb2d2e..000000000
--- a/numpy/doc/swig/test/Tensor.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef TENSOR_H
-#define TENSOR_H
-
-// The following macro defines the prototypes for a family of
-// functions that work with 3D arrays with the forms
-//
-// TYPE SNAMENorm( TYPE tensor[2][2][2]);
-// TYPE SNAMEMax( TYPE * tensor, int rows, int cols, int num);
-// TYPE SNAMEMin( int rows, int cols, int num, TYPE * tensor);
-// void SNAMEScale( TYPE array[3][3][3]);
-// void SNAMEFloor( TYPE * array, int rows, int cols, int num, TYPE floor);
-// void SNAMECeil( int rows, int cols, int num, TYPE * array, TYPE ceil );
-// void SNAMELUSplit(TYPE in[3][3][3], TYPE lower[3][3][3], TYPE upper[3][3][3]);
-//
-// for any specified type TYPE (for example: short, unsigned int, long
-// long, etc.) with given short name SNAME (for example: short, uint,
-// longLong, etc.). The macro is then expanded for the given
-// TYPE/SNAME pairs. The resulting functions are for testing numpy
-// interfaces, respectively, for:
-//
-// * 3D input arrays, hard-coded lengths
-// * 3D input arrays
-// * 3D input arrays, data last
-// * 3D in-place arrays, hard-coded lengths
-// * 3D in-place arrays
-// * 3D in-place arrays, data last
-// * 3D argout arrays, hard-coded length
-//
-#define TEST_FUNC_PROTOS(TYPE, SNAME) \
-\
-TYPE SNAME ## Norm( TYPE tensor[2][2][2]); \
-TYPE SNAME ## Max( TYPE * tensor, int rows, int cols, int num); \
-TYPE SNAME ## Min( int rows, int cols, int num, TYPE * tensor); \
-void SNAME ## Scale( TYPE array[3][3][3], TYPE val); \
-void SNAME ## Floor( TYPE * array, int rows, int cols, int num, TYPE floor); \
-void SNAME ## Ceil( int rows, int cols, int num, TYPE * array, TYPE ceil ); \
-void SNAME ## LUSplit(TYPE tensor[2][2][2], TYPE lower[2][2][2], TYPE upper[2][2][2]);
-
-TEST_FUNC_PROTOS(signed char , schar )
-TEST_FUNC_PROTOS(unsigned char , uchar )
-TEST_FUNC_PROTOS(short , short )
-TEST_FUNC_PROTOS(unsigned short , ushort )
-TEST_FUNC_PROTOS(int , int )
-TEST_FUNC_PROTOS(unsigned int , uint )
-TEST_FUNC_PROTOS(long , long )
-TEST_FUNC_PROTOS(unsigned long , ulong )
-TEST_FUNC_PROTOS(long long , longLong )
-TEST_FUNC_PROTOS(unsigned long long, ulongLong)
-TEST_FUNC_PROTOS(float , float )
-TEST_FUNC_PROTOS(double , double )
-
-#endif
diff --git a/numpy/doc/swig/test/Tensor.i b/numpy/doc/swig/test/Tensor.i
deleted file mode 100644
index a1198dc9e..000000000
--- a/numpy/doc/swig/test/Tensor.i
+++ /dev/null
@@ -1,49 +0,0 @@
-// -*- c++ -*-
-%module Tensor
-
-%{
-#define SWIG_FILE_WITH_INIT
-#include "Tensor.h"
-%}
-
-// Get the NumPy typemaps
-%include "../numpy.i"
-
-%init %{
- import_array();
-%}
-
-%define %apply_numpy_typemaps(TYPE)
-
-%apply (TYPE IN_ARRAY3[ANY][ANY][ANY]) {(TYPE tensor[ANY][ANY][ANY])};
-%apply (TYPE* IN_ARRAY3, int DIM1, int DIM2, int DIM3)
- {(TYPE* tensor, int rows, int cols, int num)};
-%apply (int DIM1, int DIM2, int DIM3, TYPE* IN_ARRAY3)
- {(int rows, int cols, int num, TYPE* tensor)};
-
-%apply (TYPE INPLACE_ARRAY3[ANY][ANY][ANY]) {(TYPE array[3][3][3])};
-%apply (TYPE* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3)
- {(TYPE* array, int rows, int cols, int num)};
-%apply (int DIM1, int DIM2, int DIM3, TYPE* INPLACE_ARRAY3)
- {(int rows, int cols, int num, TYPE* array)};
-
-%apply (TYPE ARGOUT_ARRAY3[ANY][ANY][ANY]) {(TYPE lower[2][2][2])};
-%apply (TYPE ARGOUT_ARRAY3[ANY][ANY][ANY]) {(TYPE upper[2][2][2])};
-
-%enddef /* %apply_numpy_typemaps() macro */
-
-%apply_numpy_typemaps(signed char )
-%apply_numpy_typemaps(unsigned char )
-%apply_numpy_typemaps(short )
-%apply_numpy_typemaps(unsigned short )
-%apply_numpy_typemaps(int )
-%apply_numpy_typemaps(unsigned int )
-%apply_numpy_typemaps(long )
-%apply_numpy_typemaps(unsigned long )
-%apply_numpy_typemaps(long long )
-%apply_numpy_typemaps(unsigned long long)
-%apply_numpy_typemaps(float )
-%apply_numpy_typemaps(double )
-
-// Include the header file to be wrapped
-%include "Tensor.h"
diff --git a/numpy/doc/swig/test/Vector.cxx b/numpy/doc/swig/test/Vector.cxx
deleted file mode 100644
index 2c90404da..000000000
--- a/numpy/doc/swig/test/Vector.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-#include <stdlib.h>
-#include <math.h>
-#include <iostream>
-#include "Vector.h"
-
-// The following macro defines a family of functions that work with 1D
-// arrays with the forms
-//
-// TYPE SNAMELength( TYPE vector[3]);
-// TYPE SNAMEProd( TYPE * series, int size);
-// TYPE SNAMESum( int size, TYPE * series);
-// void SNAMEReverse(TYPE array[3]);
-// void SNAMEOnes( TYPE * array, int size);
-// void SNAMEZeros( int size, TYPE * array);
-// void SNAMEEOSplit(TYPE vector[3], TYPE even[3], odd[3]);
-// void SNAMETwos( TYPE * twoVec, int size);
-// void SNAMEThrees( int size, TYPE * threeVec);
-//
-// for any specified type TYPE (for example: short, unsigned int, long
-// long, etc.) with given short name SNAME (for example: short, uint,
-// longLong, etc.). The macro is then expanded for the given
-// TYPE/SNAME pairs. The resulting functions are for testing numpy
-// interfaces, respectively, for:
-//
-// * 1D input arrays, hard-coded length
-// * 1D input arrays
-// * 1D input arrays, data last
-// * 1D in-place arrays, hard-coded length
-// * 1D in-place arrays
-// * 1D in-place arrays, data last
-// * 1D argout arrays, hard-coded length
-// * 1D argout arrays
-// * 1D argout arrays, data last
-//
-#define TEST_FUNCS(TYPE, SNAME) \
-\
-TYPE SNAME ## Length(TYPE vector[3]) { \
- double result = 0; \
- for (int i=0; i<3; ++i) result += vector[i]*vector[i]; \
- return (TYPE)sqrt(result); \
-} \
-\
-TYPE SNAME ## Prod(TYPE * series, int size) { \
- TYPE result = 1; \
- for (int i=0; i<size; ++i) result *= series[i]; \
- return result; \
-} \
-\
-TYPE SNAME ## Sum(int size, TYPE * series) { \
- TYPE result = 0; \
- for (int i=0; i<size; ++i) result += series[i]; \
- return result; \
-} \
-\
-void SNAME ## Reverse(TYPE array[3]) { \
- TYPE temp = array[0]; \
- array[0] = array[2]; \
- array[2] = temp; \
-} \
-\
-void SNAME ## Ones(TYPE * array, int size) { \
- for (int i=0; i<size; ++i) array[i] = 1; \
-} \
-\
-void SNAME ## Zeros(int size, TYPE * array) { \
- for (int i=0; i<size; ++i) array[i] = 0; \
-} \
-\
-void SNAME ## EOSplit(TYPE vector[3], TYPE even[3], TYPE odd[3]) { \
- for (int i=0; i<3; ++i) { \
- if (i % 2 == 0) { \
- even[i] = vector[i]; \
- odd[ i] = 0; \
- } else { \
- even[i] = 0; \
- odd[ i] = vector[i]; \
- } \
- } \
-} \
-\
-void SNAME ## Twos(TYPE* twoVec, int size) { \
- for (int i=0; i<size; ++i) twoVec[i] = 2; \
-} \
-\
-void SNAME ## Threes(int size, TYPE* threeVec) { \
- for (int i=0; i<size; ++i) threeVec[i] = 3; \
-}
-
-TEST_FUNCS(signed char , schar )
-TEST_FUNCS(unsigned char , uchar )
-TEST_FUNCS(short , short )
-TEST_FUNCS(unsigned short , ushort )
-TEST_FUNCS(int , int )
-TEST_FUNCS(unsigned int , uint )
-TEST_FUNCS(long , long )
-TEST_FUNCS(unsigned long , ulong )
-TEST_FUNCS(long long , longLong )
-TEST_FUNCS(unsigned long long, ulongLong)
-TEST_FUNCS(float , float )
-TEST_FUNCS(double , double )
diff --git a/numpy/doc/swig/test/Vector.h b/numpy/doc/swig/test/Vector.h
deleted file mode 100644
index 01da361c6..000000000
--- a/numpy/doc/swig/test/Vector.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef VECTOR_H
-#define VECTOR_H
-
-// The following macro defines the prototypes for a family of
-// functions that work with 1D arrays with the forms
-//
-// TYPE SNAMELength( TYPE vector[3]);
-// TYPE SNAMEProd( TYPE * series, int size);
-// TYPE SNAMESum( int size, TYPE * series);
-// void SNAMEReverse(TYPE array[3]);
-// void SNAMEOnes( TYPE * array, int size);
-// void SNAMEZeros( int size, TYPE * array);
-// void SNAMEEOSplit(TYPE vector[3], TYPE even[3], TYPE odd[3]);
-// void SNAMETwos( TYPE * twoVec, int size);
-// void SNAMEThrees( int size, TYPE * threeVec);
-//
-// for any specified type TYPE (for example: short, unsigned int, long
-// long, etc.) with given short name SNAME (for example: short, uint,
-// longLong, etc.). The macro is then expanded for the given
-// TYPE/SNAME pairs. The resulting functions are for testing numpy
-// interfaces, respectively, for:
-//
-// * 1D input arrays, hard-coded length
-// * 1D input arrays
-// * 1D input arrays, data last
-// * 1D in-place arrays, hard-coded length
-// * 1D in-place arrays
-// * 1D in-place arrays, data last
-// * 1D argout arrays, hard-coded length
-// * 1D argout arrays
-// * 1D argout arrays, data last
-//
-#define TEST_FUNC_PROTOS(TYPE, SNAME) \
-\
-TYPE SNAME ## Length( TYPE vector[3]); \
-TYPE SNAME ## Prod( TYPE * series, int size); \
-TYPE SNAME ## Sum( int size, TYPE * series); \
-void SNAME ## Reverse(TYPE array[3]); \
-void SNAME ## Ones( TYPE * array, int size); \
-void SNAME ## Zeros( int size, TYPE * array); \
-void SNAME ## EOSplit(TYPE vector[3], TYPE even[3], TYPE odd[3]); \
-void SNAME ## Twos( TYPE * twoVec, int size); \
-void SNAME ## Threes( int size, TYPE * threeVec); \
-
-TEST_FUNC_PROTOS(signed char , schar )
-TEST_FUNC_PROTOS(unsigned char , uchar )
-TEST_FUNC_PROTOS(short , short )
-TEST_FUNC_PROTOS(unsigned short , ushort )
-TEST_FUNC_PROTOS(int , int )
-TEST_FUNC_PROTOS(unsigned int , uint )
-TEST_FUNC_PROTOS(long , long )
-TEST_FUNC_PROTOS(unsigned long , ulong )
-TEST_FUNC_PROTOS(long long , longLong )
-TEST_FUNC_PROTOS(unsigned long long, ulongLong)
-TEST_FUNC_PROTOS(float , float )
-TEST_FUNC_PROTOS(double , double )
-
-#endif
diff --git a/numpy/doc/swig/test/Vector.i b/numpy/doc/swig/test/Vector.i
deleted file mode 100644
index e86f21c37..000000000
--- a/numpy/doc/swig/test/Vector.i
+++ /dev/null
@@ -1,47 +0,0 @@
-// -*- c++ -*-
-%module Vector
-
-%{
-#define SWIG_FILE_WITH_INIT
-#include "Vector.h"
-%}
-
-// Get the NumPy typemaps
-%include "../numpy.i"
-
-%init %{
- import_array();
-%}
-
-%define %apply_numpy_typemaps(TYPE)
-
-%apply (TYPE IN_ARRAY1[ANY]) {(TYPE vector[3])};
-%apply (TYPE* IN_ARRAY1, int DIM1) {(TYPE* series, int size)};
-%apply (int DIM1, TYPE* IN_ARRAY1) {(int size, TYPE* series)};
-
-%apply (TYPE INPLACE_ARRAY1[ANY]) {(TYPE array[3])};
-%apply (TYPE* INPLACE_ARRAY1, int DIM1) {(TYPE* array, int size)};
-%apply (int DIM1, TYPE* INPLACE_ARRAY1) {(int size, TYPE* array)};
-
-%apply (TYPE ARGOUT_ARRAY1[ANY]) {(TYPE even[3])};
-%apply (TYPE ARGOUT_ARRAY1[ANY]) {(TYPE odd[ 3])};
-%apply (TYPE* ARGOUT_ARRAY1, int DIM1) {(TYPE* twoVec, int size)};
-%apply (int DIM1, TYPE* ARGOUT_ARRAY1) {(int size, TYPE* threeVec)};
-
-%enddef /* %apply_numpy_typemaps() macro */
-
-%apply_numpy_typemaps(signed char )
-%apply_numpy_typemaps(unsigned char )
-%apply_numpy_typemaps(short )
-%apply_numpy_typemaps(unsigned short )
-%apply_numpy_typemaps(int )
-%apply_numpy_typemaps(unsigned int )
-%apply_numpy_typemaps(long )
-%apply_numpy_typemaps(unsigned long )
-%apply_numpy_typemaps(long long )
-%apply_numpy_typemaps(unsigned long long)
-%apply_numpy_typemaps(float )
-%apply_numpy_typemaps(double )
-
-// Include the header file to be wrapped
-%include "Vector.h"
diff --git a/numpy/doc/swig/test/setup.py b/numpy/doc/swig/test/setup.py
deleted file mode 100755
index fadf8b5cd..000000000
--- a/numpy/doc/swig/test/setup.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#! /usr/bin/env python
-
-# System imports
-from distutils.core import *
-from distutils import sysconfig
-
-# Third-party modules - we depend on numpy for everything
-import numpy
-
-# Obtain the numpy include directory. This logic works across numpy versions.
-try:
- numpy_include = numpy.get_include()
-except AttributeError:
- numpy_include = numpy.get_numpy_include()
-
-# Array extension module
-_Array = Extension("_Array",
- ["Array_wrap.cxx",
- "Array1.cxx",
- "Array2.cxx"],
- include_dirs = [numpy_include],
- )
-
-# Farray extension module
-_Farray = Extension("_Farray",
- ["Farray_wrap.cxx",
- "Farray.cxx"],
- include_dirs = [numpy_include],
- )
-
-# _Vector extension module
-_Vector = Extension("_Vector",
- ["Vector_wrap.cxx",
- "Vector.cxx"],
- include_dirs = [numpy_include],
- )
-
-# _Matrix extension module
-_Matrix = Extension("_Matrix",
- ["Matrix_wrap.cxx",
- "Matrix.cxx"],
- include_dirs = [numpy_include],
- )
-
-# _Tensor extension module
-_Tensor = Extension("_Tensor",
- ["Tensor_wrap.cxx",
- "Tensor.cxx"],
- include_dirs = [numpy_include],
- )
-
-_Fortran = Extension("_Fortran",
- ["Fortran_wrap.cxx",
- "Fortran.cxx"],
- include_dirs = [numpy_include],
- )
-
-# NumyTypemapTests setup
-setup(name = "NumpyTypemapTests",
- description = "Functions that work on arrays",
- author = "Bill Spotz",
- py_modules = ["Array", "Farray", "Vector", "Matrix", "Tensor",
- "Fortran"],
- ext_modules = [_Array , _Farray , _Vector , _Matrix , _Tensor,
- _Fortran]
- )
diff --git a/numpy/doc/swig/test/testArray.py b/numpy/doc/swig/test/testArray.py
deleted file mode 100755
index ba83d14d9..000000000
--- a/numpy/doc/swig/test/testArray.py
+++ /dev/null
@@ -1,283 +0,0 @@
-#! /usr/bin/env python
-
-# System imports
-from distutils.util import get_platform
-import os
-import sys
-import unittest
-
-# Import NumPy
-import numpy as np
-major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
-if major == 0:
- BadListError = TypeError
-else:
- BadListError = ValueError
-
-import Array
-
-######################################################################
-
-class Array1TestCase(unittest.TestCase):
-
- def setUp(self):
- self.length = 5
- self.array1 = Array.Array1(self.length)
-
- def testConstructor0(self):
- "Test Array1 default constructor"
- a = Array.Array1()
- self.failUnless(isinstance(a, Array.Array1))
- self.failUnless(len(a) == 0)
-
- def testConstructor1(self):
- "Test Array1 length constructor"
- self.failUnless(isinstance(self.array1, Array.Array1))
-
- def testConstructor2(self):
- "Test Array1 array constructor"
- na = np.arange(self.length)
- aa = Array.Array1(na)
- self.failUnless(isinstance(aa, Array.Array1))
-
- def testConstructor3(self):
- "Test Array1 copy constructor"
- for i in range(self.array1.length()): self.array1[i] = i
- arrayCopy = Array.Array1(self.array1)
- self.failUnless(arrayCopy == self.array1)
-
- def testConstructorBad(self):
- "Test Array1 length constructor, negative"
- self.assertRaises(ValueError, Array.Array1, -4)
-
- def testLength(self):
- "Test Array1 length method"
- self.failUnless(self.array1.length() == self.length)
-
- def testLen(self):
- "Test Array1 __len__ method"
- self.failUnless(len(self.array1) == self.length)
-
- def testResize0(self):
- "Test Array1 resize method, length"
- newLen = 2 * self.length
- self.array1.resize(newLen)
- self.failUnless(len(self.array1) == newLen)
-
- def testResize1(self):
- "Test Array1 resize method, array"
- a = np.zeros((2*self.length,), dtype='l')
- self.array1.resize(a)
- self.failUnless(len(self.array1) == len(a))
-
- def testResizeBad(self):
- "Test Array1 resize method, negative length"
- self.assertRaises(ValueError, self.array1.resize, -5)
-
- def testSetGet(self):
- "Test Array1 __setitem__, __getitem__ methods"
- n = self.length
- for i in range(n):
- self.array1[i] = i*i
- for i in range(n):
- self.failUnless(self.array1[i] == i*i)
-
- def testSetBad1(self):
- "Test Array1 __setitem__ method, negative index"
- self.assertRaises(IndexError, self.array1.__setitem__, -1, 0)
-
- def testSetBad2(self):
- "Test Array1 __setitem__ method, out-of-range index"
- self.assertRaises(IndexError, self.array1.__setitem__, self.length+1, 0)
-
- def testGetBad1(self):
- "Test Array1 __getitem__ method, negative index"
- self.assertRaises(IndexError, self.array1.__getitem__, -1)
-
- def testGetBad2(self):
- "Test Array1 __getitem__ method, out-of-range index"
- self.assertRaises(IndexError, self.array1.__getitem__, self.length+1)
-
- def testAsString(self):
- "Test Array1 asString method"
- for i in range(self.array1.length()): self.array1[i] = i+1
- self.failUnless(self.array1.asString() == "[ 1, 2, 3, 4, 5 ]")
-
- def testStr(self):
- "Test Array1 __str__ method"
- for i in range(self.array1.length()): self.array1[i] = i-2
- self.failUnless(str(self.array1) == "[ -2, -1, 0, 1, 2 ]")
-
- def testView(self):
- "Test Array1 view method"
- for i in range(self.array1.length()): self.array1[i] = i+1
- a = self.array1.view()
- self.failUnless(isinstance(a, np.ndarray))
- self.failUnless(len(a) == self.length)
- self.failUnless((a == [1,2,3,4,5]).all())
-
-######################################################################
-
-class Array2TestCase(unittest.TestCase):
-
- def setUp(self):
- self.nrows = 5
- self.ncols = 4
- self.array2 = Array.Array2(self.nrows, self.ncols)
-
- def testConstructor0(self):
- "Test Array2 default constructor"
- a = Array.Array2()
- self.failUnless(isinstance(a, Array.Array2))
- self.failUnless(len(a) == 0)
-
- def testConstructor1(self):
- "Test Array2 nrows, ncols constructor"
- self.failUnless(isinstance(self.array2, Array.Array2))
-
- def testConstructor2(self):
- "Test Array2 array constructor"
- na = np.zeros((3,4), dtype="l")
- aa = Array.Array2(na)
- self.failUnless(isinstance(aa, Array.Array2))
-
- def testConstructor3(self):
- "Test Array2 copy constructor"
- for i in range(self.nrows):
- for j in range(self.ncols):
- self.array2[i][j] = i * j
- arrayCopy = Array.Array2(self.array2)
- self.failUnless(arrayCopy == self.array2)
-
- def testConstructorBad1(self):
- "Test Array2 nrows, ncols constructor, negative nrows"
- self.assertRaises(ValueError, Array.Array2, -4, 4)
-
- def testConstructorBad2(self):
- "Test Array2 nrows, ncols constructor, negative ncols"
- self.assertRaises(ValueError, Array.Array2, 4, -4)
-
- def testNrows(self):
- "Test Array2 nrows method"
- self.failUnless(self.array2.nrows() == self.nrows)
-
- def testNcols(self):
- "Test Array2 ncols method"
- self.failUnless(self.array2.ncols() == self.ncols)
-
- def testLen(self):
- "Test Array2 __len__ method"
- self.failUnless(len(self.array2) == self.nrows*self.ncols)
-
- def testResize0(self):
- "Test Array2 resize method, size"
- newRows = 2 * self.nrows
- newCols = 2 * self.ncols
- self.array2.resize(newRows, newCols)
- self.failUnless(len(self.array2) == newRows * newCols)
-
- #def testResize1(self):
- # "Test Array2 resize method, array"
- # a = np.zeros((2*self.nrows, 2*self.ncols), dtype='l')
- # self.array2.resize(a)
- # self.failUnless(len(self.array2) == len(a))
-
- def testResizeBad1(self):
- "Test Array2 resize method, negative nrows"
- self.assertRaises(ValueError, self.array2.resize, -5, 5)
-
- def testResizeBad2(self):
- "Test Array2 resize method, negative ncols"
- self.assertRaises(ValueError, self.array2.resize, 5, -5)
-
- def testSetGet1(self):
- "Test Array2 __setitem__, __getitem__ methods"
- m = self.nrows
- n = self.ncols
- array1 = [ ]
- a = np.arange(n, dtype="l")
- for i in range(m):
- array1.append(Array.Array1(i*a))
- for i in range(m):
- self.array2[i] = array1[i]
- for i in range(m):
- self.failUnless(self.array2[i] == array1[i])
-
- def testSetGet2(self):
- "Test Array2 chained __setitem__, __getitem__ methods"
- m = self.nrows
- n = self.ncols
- for i in range(m):
- for j in range(n):
- self.array2[i][j] = i*j
- for i in range(m):
- for j in range(n):
- self.failUnless(self.array2[i][j] == i*j)
-
- def testSetBad1(self):
- "Test Array2 __setitem__ method, negative index"
- a = Array.Array1(self.ncols)
- self.assertRaises(IndexError, self.array2.__setitem__, -1, a)
-
- def testSetBad2(self):
- "Test Array2 __setitem__ method, out-of-range index"
- a = Array.Array1(self.ncols)
- self.assertRaises(IndexError, self.array2.__setitem__, self.nrows+1, a)
-
- def testGetBad1(self):
- "Test Array2 __getitem__ method, negative index"
- self.assertRaises(IndexError, self.array2.__getitem__, -1)
-
- def testGetBad2(self):
- "Test Array2 __getitem__ method, out-of-range index"
- self.assertRaises(IndexError, self.array2.__getitem__, self.nrows+1)
-
- def testAsString(self):
- "Test Array2 asString method"
- result = """\
-[ [ 0, 1, 2, 3 ],
- [ 1, 2, 3, 4 ],
- [ 2, 3, 4, 5 ],
- [ 3, 4, 5, 6 ],
- [ 4, 5, 6, 7 ] ]
-"""
- for i in range(self.nrows):
- for j in range(self.ncols):
- self.array2[i][j] = i+j
- self.failUnless(self.array2.asString() == result)
-
- def testStr(self):
- "Test Array2 __str__ method"
- result = """\
-[ [ 0, -1, -2, -3 ],
- [ 1, 0, -1, -2 ],
- [ 2, 1, 0, -1 ],
- [ 3, 2, 1, 0 ],
- [ 4, 3, 2, 1 ] ]
-"""
- for i in range(self.nrows):
- for j in range(self.ncols):
- self.array2[i][j] = i-j
- self.failUnless(str(self.array2) == result)
-
- def testView(self):
- "Test Array2 view method"
- a = self.array2.view()
- self.failUnless(isinstance(a, np.ndarray))
- self.failUnless(len(a) == self.nrows)
-
-######################################################################
-
-if __name__ == "__main__":
-
- # Build the test suite
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Array1TestCase))
- suite.addTest(unittest.makeSuite(Array2TestCase))
-
- # Execute the test suite
- print "Testing Classes of Module Array"
- print "NumPy version", np.__version__
- print
- result = unittest.TextTestRunner(verbosity=2).run(suite)
- sys.exit(len(result.errors) + len(result.failures))
diff --git a/numpy/doc/swig/test/testFarray.py b/numpy/doc/swig/test/testFarray.py
deleted file mode 100755
index 614e149bd..000000000
--- a/numpy/doc/swig/test/testFarray.py
+++ /dev/null
@@ -1,158 +0,0 @@
-#! /usr/bin/env python
-
-# System imports
-from distutils.util import get_platform
-import os
-import sys
-import unittest
-
-# Import NumPy
-import numpy as np
-major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
-if major == 0: BadListError = TypeError
-else: BadListError = ValueError
-
-# Add the distutils-generated build directory to the python search path and then
-# import the extension module
-libDir = "lib.%s-%s" % (get_platform(), sys.version[:3])
-sys.path.insert(0,os.path.join("build", libDir))
-import Farray
-
-######################################################################
-
-class FarrayTestCase(unittest.TestCase):
-
- def setUp(self):
- self.nrows = 5
- self.ncols = 4
- self.array = Farray.Farray(self.nrows, self.ncols)
-
- def testConstructor1(self):
- "Test Farray size constructor"
- self.failUnless(isinstance(self.array, Farray.Farray))
-
- def testConstructor2(self):
- "Test Farray copy constructor"
- for i in range(self.nrows):
- for j in range(self.ncols):
- self.array[i,j] = i + j
- arrayCopy = Farray.Farray(self.array)
- self.failUnless(arrayCopy == self.array)
-
- def testConstructorBad1(self):
- "Test Farray size constructor, negative nrows"
- self.assertRaises(ValueError, Farray.Farray, -4, 4)
-
- def testConstructorBad2(self):
- "Test Farray size constructor, negative ncols"
- self.assertRaises(ValueError, Farray.Farray, 4, -4)
-
- def testNrows(self):
- "Test Farray nrows method"
- self.failUnless(self.array.nrows() == self.nrows)
-
- def testNcols(self):
- "Test Farray ncols method"
- self.failUnless(self.array.ncols() == self.ncols)
-
- def testLen(self):
- "Test Farray __len__ method"
- self.failUnless(len(self.array) == self.nrows*self.ncols)
-
- def testSetGet(self):
- "Test Farray __setitem__, __getitem__ methods"
- m = self.nrows
- n = self.ncols
- for i in range(m):
- for j in range(n):
- self.array[i,j] = i*j
- for i in range(m):
- for j in range(n):
- self.failUnless(self.array[i,j] == i*j)
-
- def testSetBad1(self):
- "Test Farray __setitem__ method, negative row"
- self.assertRaises(IndexError, self.array.__setitem__, (-1, 3), 0)
-
- def testSetBad2(self):
- "Test Farray __setitem__ method, negative col"
- self.assertRaises(IndexError, self.array.__setitem__, (1, -3), 0)
-
- def testSetBad3(self):
- "Test Farray __setitem__ method, out-of-range row"
- self.assertRaises(IndexError, self.array.__setitem__, (self.nrows+1, 0), 0)
-
- def testSetBad4(self):
- "Test Farray __setitem__ method, out-of-range col"
- self.assertRaises(IndexError, self.array.__setitem__, (0, self.ncols+1), 0)
-
- def testGetBad1(self):
- "Test Farray __getitem__ method, negative row"
- self.assertRaises(IndexError, self.array.__getitem__, (-1, 3))
-
- def testGetBad2(self):
- "Test Farray __getitem__ method, negative col"
- self.assertRaises(IndexError, self.array.__getitem__, (1, -3))
-
- def testGetBad3(self):
- "Test Farray __getitem__ method, out-of-range row"
- self.assertRaises(IndexError, self.array.__getitem__, (self.nrows+1, 0))
-
- def testGetBad4(self):
- "Test Farray __getitem__ method, out-of-range col"
- self.assertRaises(IndexError, self.array.__getitem__, (0, self.ncols+1))
-
- def testAsString(self):
- "Test Farray asString method"
- result = """\
-[ [ 0, 1, 2, 3 ],
- [ 1, 2, 3, 4 ],
- [ 2, 3, 4, 5 ],
- [ 3, 4, 5, 6 ],
- [ 4, 5, 6, 7 ] ]
-"""
- for i in range(self.nrows):
- for j in range(self.ncols):
- self.array[i,j] = i+j
- self.failUnless(self.array.asString() == result)
-
- def testStr(self):
- "Test Farray __str__ method"
- result = """\
-[ [ 0, -1, -2, -3 ],
- [ 1, 0, -1, -2 ],
- [ 2, 1, 0, -1 ],
- [ 3, 2, 1, 0 ],
- [ 4, 3, 2, 1 ] ]
-"""
- for i in range(self.nrows):
- for j in range(self.ncols):
- self.array[i,j] = i-j
- self.failUnless(str(self.array) == result)
-
- def testView(self):
- "Test Farray view method"
- for i in range(self.nrows):
- for j in range(self.ncols):
- self.array[i,j] = i+j
- a = self.array.view()
- self.failUnless(isinstance(a, np.ndarray))
- self.failUnless(a.flags.f_contiguous)
- for i in range(self.nrows):
- for j in range(self.ncols):
- self.failUnless(a[i,j] == i+j)
-
-######################################################################
-
-if __name__ == "__main__":
-
- # Build the test suite
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(FarrayTestCase))
-
- # Execute the test suite
- print "Testing Classes of Module Farray"
- print "NumPy version", np.__version__
- print
- result = unittest.TextTestRunner(verbosity=2).run(suite)
- sys.exit(len(result.errors) + len(result.failures))
diff --git a/numpy/doc/swig/test/testFortran.py b/numpy/doc/swig/test/testFortran.py
deleted file mode 100644
index d2c382869..000000000
--- a/numpy/doc/swig/test/testFortran.py
+++ /dev/null
@@ -1,169 +0,0 @@
-#! /usr/bin/env python
-
-# System imports
-from distutils.util import get_platform
-import os
-import sys
-import unittest
-
-# Import NumPy
-import numpy as np
-major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
-if major == 0: BadListError = TypeError
-else: BadListError = ValueError
-
-import Fortran
-
-######################################################################
-
-class FortranTestCase(unittest.TestCase):
-
- def __init__(self, methodName="runTests"):
- unittest.TestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
-
- # Test (type* IN_FARRAY2, int DIM1, int DIM2) typemap
- def testSecondElementContiguous(self):
- "Test luSplit function with a Fortran-array"
- print >>sys.stderr, self.typeStr, "... ",
- second = Fortran.__dict__[self.typeStr + "SecondElement"]
- matrix = np.arange(9).reshape(3, 3).astype(self.typeCode)
- self.assertEquals(second(matrix), 3)
-
- def testSecondElementFortran(self):
- "Test luSplit function with a Fortran-array"
- print >>sys.stderr, self.typeStr, "... ",
- second = Fortran.__dict__[self.typeStr + "SecondElement"]
- matrix = np.asfortranarray(np.arange(9).reshape(3, 3),
- self.typeCode)
- self.assertEquals(second(matrix), 3)
-
- def testSecondElementObject(self):
- "Test luSplit function with a Fortran-array"
- print >>sys.stderr, self.typeStr, "... ",
- second = Fortran.__dict__[self.typeStr + "SecondElement"]
- matrix = np.asfortranarray([[0,1,2],[3,4,5],[6,7,8]], self.typeCode)
- self.assertEquals(second(matrix), 3)
-
-######################################################################
-
-class scharTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "schar"
- self.typeCode = "b"
-
-######################################################################
-
-class ucharTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "uchar"
- self.typeCode = "B"
-
-######################################################################
-
-class shortTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "short"
- self.typeCode = "h"
-
-######################################################################
-
-class ushortTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "ushort"
- self.typeCode = "H"
-
-######################################################################
-
-class intTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "int"
- self.typeCode = "i"
-
-######################################################################
-
-class uintTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "uint"
- self.typeCode = "I"
-
-######################################################################
-
-class longTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "long"
- self.typeCode = "l"
-
-######################################################################
-
-class ulongTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "ulong"
- self.typeCode = "L"
-
-######################################################################
-
-class longLongTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "longLong"
- self.typeCode = "q"
-
-######################################################################
-
-class ulongLongTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "ulongLong"
- self.typeCode = "Q"
-
-######################################################################
-
-class floatTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "float"
- self.typeCode = "f"
-
-######################################################################
-
-class doubleTestCase(FortranTestCase):
- def __init__(self, methodName="runTest"):
- FortranTestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
-
-######################################################################
-
-if __name__ == "__main__":
-
- # Build the test suite
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite( scharTestCase))
- suite.addTest(unittest.makeSuite( ucharTestCase))
- suite.addTest(unittest.makeSuite( shortTestCase))
- suite.addTest(unittest.makeSuite( ushortTestCase))
- suite.addTest(unittest.makeSuite( intTestCase))
- suite.addTest(unittest.makeSuite( uintTestCase))
- suite.addTest(unittest.makeSuite( longTestCase))
- suite.addTest(unittest.makeSuite( ulongTestCase))
- suite.addTest(unittest.makeSuite( longLongTestCase))
- suite.addTest(unittest.makeSuite(ulongLongTestCase))
- suite.addTest(unittest.makeSuite( floatTestCase))
- suite.addTest(unittest.makeSuite( doubleTestCase))
-
- # Execute the test suite
- print "Testing 2D Functions of Module Matrix"
- print "NumPy version", np.__version__
- print
- result = unittest.TextTestRunner(verbosity=2).run(suite)
- sys.exit(len(result.errors) + len(result.failures))
diff --git a/numpy/doc/swig/test/testMatrix.py b/numpy/doc/swig/test/testMatrix.py
deleted file mode 100755
index 12061702d..000000000
--- a/numpy/doc/swig/test/testMatrix.py
+++ /dev/null
@@ -1,361 +0,0 @@
-#! /usr/bin/env python
-
-# System imports
-from distutils.util import get_platform
-import os
-import sys
-import unittest
-
-# Import NumPy
-import numpy as np
-major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
-if major == 0: BadListError = TypeError
-else: BadListError = ValueError
-
-import Matrix
-
-######################################################################
-
-class MatrixTestCase(unittest.TestCase):
-
- def __init__(self, methodName="runTests"):
- unittest.TestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
-
- # Test (type IN_ARRAY2[ANY][ANY]) typemap
- def testDet(self):
- "Test det function"
- print >>sys.stderr, self.typeStr, "... ",
- det = Matrix.__dict__[self.typeStr + "Det"]
- matrix = [[8,7],[6,9]]
- self.assertEquals(det(matrix), 30)
-
- # Test (type IN_ARRAY2[ANY][ANY]) typemap
- def testDetBadList(self):
- "Test det function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- det = Matrix.__dict__[self.typeStr + "Det"]
- matrix = [[8,7], ["e", "pi"]]
- self.assertRaises(BadListError, det, matrix)
-
- # Test (type IN_ARRAY2[ANY][ANY]) typemap
- def testDetWrongDim(self):
- "Test det function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- det = Matrix.__dict__[self.typeStr + "Det"]
- matrix = [8,7]
- self.assertRaises(TypeError, det, matrix)
-
- # Test (type IN_ARRAY2[ANY][ANY]) typemap
- def testDetWrongSize(self):
- "Test det function with wrong size"
- print >>sys.stderr, self.typeStr, "... ",
- det = Matrix.__dict__[self.typeStr + "Det"]
- matrix = [[8,7,6], [5,4,3], [2,1,0]]
- self.assertRaises(TypeError, det, matrix)
-
- # Test (type IN_ARRAY2[ANY][ANY]) typemap
- def testDetNonContainer(self):
- "Test det function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- det = Matrix.__dict__[self.typeStr + "Det"]
- self.assertRaises(TypeError, det, None)
-
- # Test (type* IN_ARRAY2, int DIM1, int DIM2) typemap
- def testMax(self):
- "Test max function"
- print >>sys.stderr, self.typeStr, "... ",
- max = Matrix.__dict__[self.typeStr + "Max"]
- matrix = [[6,5,4],[3,2,1]]
- self.assertEquals(max(matrix), 6)
-
- # Test (type* IN_ARRAY2, int DIM1, int DIM2) typemap
- def testMaxBadList(self):
- "Test max function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- max = Matrix.__dict__[self.typeStr + "Max"]
- matrix = [[6,"five",4], ["three", 2, "one"]]
- self.assertRaises(BadListError, max, matrix)
-
- # Test (type* IN_ARRAY2, int DIM1, int DIM2) typemap
- def testMaxNonContainer(self):
- "Test max function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- max = Matrix.__dict__[self.typeStr + "Max"]
- self.assertRaises(TypeError, max, None)
-
- # Test (type* IN_ARRAY2, int DIM1, int DIM2) typemap
- def testMaxWrongDim(self):
- "Test max function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- max = Matrix.__dict__[self.typeStr + "Max"]
- self.assertRaises(TypeError, max, [0, 1, 2, 3])
-
- # Test (int DIM1, int DIM2, type* IN_ARRAY2) typemap
- def testMin(self):
- "Test min function"
- print >>sys.stderr, self.typeStr, "... ",
- min = Matrix.__dict__[self.typeStr + "Min"]
- matrix = [[9,8],[7,6],[5,4]]
- self.assertEquals(min(matrix), 4)
-
- # Test (int DIM1, int DIM2, type* IN_ARRAY2) typemap
- def testMinBadList(self):
- "Test min function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- min = Matrix.__dict__[self.typeStr + "Min"]
- matrix = [["nine","eight"], ["seven","six"]]
- self.assertRaises(BadListError, min, matrix)
-
- # Test (int DIM1, int DIM2, type* IN_ARRAY2) typemap
- def testMinWrongDim(self):
- "Test min function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- min = Matrix.__dict__[self.typeStr + "Min"]
- self.assertRaises(TypeError, min, [1,3,5,7,9])
-
- # Test (int DIM1, int DIM2, type* IN_ARRAY2) typemap
- def testMinNonContainer(self):
- "Test min function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- min = Matrix.__dict__[self.typeStr + "Min"]
- self.assertRaises(TypeError, min, False)
-
- # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap
- def testScale(self):
- "Test scale function"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Matrix.__dict__[self.typeStr + "Scale"]
- matrix = np.array([[1,2,3],[2,1,2],[3,2,1]],self.typeCode)
- scale(matrix,4)
- self.assertEquals((matrix == [[4,8,12],[8,4,8],[12,8,4]]).all(), True)
-
- # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap
- def testScaleWrongDim(self):
- "Test scale function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Matrix.__dict__[self.typeStr + "Scale"]
- matrix = np.array([1,2,2,1],self.typeCode)
- self.assertRaises(TypeError, scale, matrix)
-
- # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap
- def testScaleWrongSize(self):
- "Test scale function with wrong size"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Matrix.__dict__[self.typeStr + "Scale"]
- matrix = np.array([[1,2],[2,1]],self.typeCode)
- self.assertRaises(TypeError, scale, matrix)
-
- # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap
- def testScaleWrongType(self):
- "Test scale function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Matrix.__dict__[self.typeStr + "Scale"]
- matrix = np.array([[1,2,3],[2,1,2],[3,2,1]],'c')
- self.assertRaises(TypeError, scale, matrix)
-
- # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap
- def testScaleNonArray(self):
- "Test scale function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Matrix.__dict__[self.typeStr + "Scale"]
- matrix = [[1,2,3],[2,1,2],[3,2,1]]
- self.assertRaises(TypeError, scale, matrix)
-
- # Test (type* INPLACE_ARRAY2, int DIM1, int DIM2) typemap
- def testFloor(self):
- "Test floor function"
- print >>sys.stderr, self.typeStr, "... ",
- floor = Matrix.__dict__[self.typeStr + "Floor"]
- matrix = np.array([[6,7],[8,9]],self.typeCode)
- floor(matrix,7)
- np.testing.assert_array_equal(matrix, np.array([[7,7],[8,9]]))
-
- # Test (type* INPLACE_ARRAY2, int DIM1, int DIM2) typemap
- def testFloorWrongDim(self):
- "Test floor function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- floor = Matrix.__dict__[self.typeStr + "Floor"]
- matrix = np.array([6,7,8,9],self.typeCode)
- self.assertRaises(TypeError, floor, matrix)
-
- # Test (type* INPLACE_ARRAY2, int DIM1, int DIM2) typemap
- def testFloorWrongType(self):
- "Test floor function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- floor = Matrix.__dict__[self.typeStr + "Floor"]
- matrix = np.array([[6,7], [8,9]],'c')
- self.assertRaises(TypeError, floor, matrix)
-
- # Test (type* INPLACE_ARRAY2, int DIM1, int DIM2) typemap
- def testFloorNonArray(self):
- "Test floor function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- floor = Matrix.__dict__[self.typeStr + "Floor"]
- matrix = [[6,7], [8,9]]
- self.assertRaises(TypeError, floor, matrix)
-
- # Test (int DIM1, int DIM2, type* INPLACE_ARRAY2) typemap
- def testCeil(self):
- "Test ceil function"
- print >>sys.stderr, self.typeStr, "... ",
- ceil = Matrix.__dict__[self.typeStr + "Ceil"]
- matrix = np.array([[1,2],[3,4]],self.typeCode)
- ceil(matrix,3)
- np.testing.assert_array_equal(matrix, np.array([[1,2],[3,3]]))
-
- # Test (int DIM1, int DIM2, type* INPLACE_ARRAY2) typemap
- def testCeilWrongDim(self):
- "Test ceil function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- ceil = Matrix.__dict__[self.typeStr + "Ceil"]
- matrix = np.array([1,2,3,4],self.typeCode)
- self.assertRaises(TypeError, ceil, matrix)
-
- # Test (int DIM1, int DIM2, type* INPLACE_ARRAY2) typemap
- def testCeilWrongType(self):
- "Test ceil function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- ceil = Matrix.__dict__[self.typeStr + "Ceil"]
- matrix = np.array([[1,2], [3,4]],'c')
- self.assertRaises(TypeError, ceil, matrix)
-
- # Test (int DIM1, int DIM2, type* INPLACE_ARRAY2) typemap
- def testCeilNonArray(self):
- "Test ceil function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- ceil = Matrix.__dict__[self.typeStr + "Ceil"]
- matrix = [[1,2], [3,4]]
- self.assertRaises(TypeError, ceil, matrix)
-
- # Test (type ARGOUT_ARRAY2[ANY][ANY]) typemap
- def testLUSplit(self):
- "Test luSplit function"
- print >>sys.stderr, self.typeStr, "... ",
- luSplit = Matrix.__dict__[self.typeStr + "LUSplit"]
- lower, upper = luSplit([[1,2,3],[4,5,6],[7,8,9]])
- self.assertEquals((lower == [[1,0,0],[4,5,0],[7,8,9]]).all(), True)
- self.assertEquals((upper == [[0,2,3],[0,0,6],[0,0,0]]).all(), True)
-
-######################################################################
-
-class scharTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "schar"
- self.typeCode = "b"
-
-######################################################################
-
-class ucharTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "uchar"
- self.typeCode = "B"
-
-######################################################################
-
-class shortTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "short"
- self.typeCode = "h"
-
-######################################################################
-
-class ushortTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "ushort"
- self.typeCode = "H"
-
-######################################################################
-
-class intTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "int"
- self.typeCode = "i"
-
-######################################################################
-
-class uintTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "uint"
- self.typeCode = "I"
-
-######################################################################
-
-class longTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "long"
- self.typeCode = "l"
-
-######################################################################
-
-class ulongTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "ulong"
- self.typeCode = "L"
-
-######################################################################
-
-class longLongTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "longLong"
- self.typeCode = "q"
-
-######################################################################
-
-class ulongLongTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "ulongLong"
- self.typeCode = "Q"
-
-######################################################################
-
-class floatTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "float"
- self.typeCode = "f"
-
-######################################################################
-
-class doubleTestCase(MatrixTestCase):
- def __init__(self, methodName="runTest"):
- MatrixTestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
-
-######################################################################
-
-if __name__ == "__main__":
-
- # Build the test suite
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite( scharTestCase))
- suite.addTest(unittest.makeSuite( ucharTestCase))
- suite.addTest(unittest.makeSuite( shortTestCase))
- suite.addTest(unittest.makeSuite( ushortTestCase))
- suite.addTest(unittest.makeSuite( intTestCase))
- suite.addTest(unittest.makeSuite( uintTestCase))
- suite.addTest(unittest.makeSuite( longTestCase))
- suite.addTest(unittest.makeSuite( ulongTestCase))
- suite.addTest(unittest.makeSuite( longLongTestCase))
- suite.addTest(unittest.makeSuite(ulongLongTestCase))
- suite.addTest(unittest.makeSuite( floatTestCase))
- suite.addTest(unittest.makeSuite( doubleTestCase))
-
- # Execute the test suite
- print "Testing 2D Functions of Module Matrix"
- print "NumPy version", np.__version__
- print
- result = unittest.TextTestRunner(verbosity=2).run(suite)
- sys.exit(len(result.errors) + len(result.failures))
diff --git a/numpy/doc/swig/test/testTensor.py b/numpy/doc/swig/test/testTensor.py
deleted file mode 100755
index 3d0ce097e..000000000
--- a/numpy/doc/swig/test/testTensor.py
+++ /dev/null
@@ -1,401 +0,0 @@
-#! /usr/bin/env python
-
-# System imports
-from distutils.util import get_platform
-from math import sqrt
-import os
-import sys
-import unittest
-
-# Import NumPy
-import numpy as np
-major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
-if major == 0: BadListError = TypeError
-else: BadListError = ValueError
-
-import Tensor
-
-######################################################################
-
-class TensorTestCase(unittest.TestCase):
-
- def __init__(self, methodName="runTests"):
- unittest.TestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
- self.result = sqrt(28.0/8)
-
- # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap
- def testNorm(self):
- "Test norm function"
- print >>sys.stderr, self.typeStr, "... ",
- norm = Tensor.__dict__[self.typeStr + "Norm"]
- tensor = [[[0,1], [2,3]],
- [[3,2], [1,0]]]
- if isinstance(self.result, int):
- self.assertEquals(norm(tensor), self.result)
- else:
- self.assertAlmostEqual(norm(tensor), self.result, 6)
-
- # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap
- def testNormBadList(self):
- "Test norm function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- norm = Tensor.__dict__[self.typeStr + "Norm"]
- tensor = [[[0,"one"],[2,3]],
- [[3,"two"],[1,0]]]
- self.assertRaises(BadListError, norm, tensor)
-
- # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap
- def testNormWrongDim(self):
- "Test norm function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- norm = Tensor.__dict__[self.typeStr + "Norm"]
- tensor = [[0,1,2,3],
- [3,2,1,0]]
- self.assertRaises(TypeError, norm, tensor)
-
- # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap
- def testNormWrongSize(self):
- "Test norm function with wrong size"
- print >>sys.stderr, self.typeStr, "... ",
- norm = Tensor.__dict__[self.typeStr + "Norm"]
- tensor = [[[0,1,0], [2,3,2]],
- [[3,2,3], [1,0,1]]]
- self.assertRaises(TypeError, norm, tensor)
-
- # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap
- def testNormNonContainer(self):
- "Test norm function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- norm = Tensor.__dict__[self.typeStr + "Norm"]
- self.assertRaises(TypeError, norm, None)
-
- # Test (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
- def testMax(self):
- "Test max function"
- print >>sys.stderr, self.typeStr, "... ",
- max = Tensor.__dict__[self.typeStr + "Max"]
- tensor = [[[1,2], [3,4]],
- [[5,6], [7,8]]]
- self.assertEquals(max(tensor), 8)
-
- # Test (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
- def testMaxBadList(self):
- "Test max function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- max = Tensor.__dict__[self.typeStr + "Max"]
- tensor = [[[1,"two"], [3,4]],
- [[5,"six"], [7,8]]]
- self.assertRaises(BadListError, max, tensor)
-
- # Test (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
- def testMaxNonContainer(self):
- "Test max function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- max = Tensor.__dict__[self.typeStr + "Max"]
- self.assertRaises(TypeError, max, None)
-
- # Test (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
- def testMaxWrongDim(self):
- "Test max function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- max = Tensor.__dict__[self.typeStr + "Max"]
- self.assertRaises(TypeError, max, [0, -1, 2, -3])
-
- # Test (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3) typemap
- def testMin(self):
- "Test min function"
- print >>sys.stderr, self.typeStr, "... ",
- min = Tensor.__dict__[self.typeStr + "Min"]
- tensor = [[[9,8], [7,6]],
- [[5,4], [3,2]]]
- self.assertEquals(min(tensor), 2)
-
- # Test (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3) typemap
- def testMinBadList(self):
- "Test min function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- min = Tensor.__dict__[self.typeStr + "Min"]
- tensor = [[["nine",8], [7,6]],
- [["five",4], [3,2]]]
- self.assertRaises(BadListError, min, tensor)
-
- # Test (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3) typemap
- def testMinNonContainer(self):
- "Test min function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- min = Tensor.__dict__[self.typeStr + "Min"]
- self.assertRaises(TypeError, min, True)
-
- # Test (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3) typemap
- def testMinWrongDim(self):
- "Test min function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- min = Tensor.__dict__[self.typeStr + "Min"]
- self.assertRaises(TypeError, min, [[1,3],[5,7]])
-
- # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap
- def testScale(self):
- "Test scale function"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Tensor.__dict__[self.typeStr + "Scale"]
- tensor = np.array([[[1,0,1], [0,1,0], [1,0,1]],
- [[0,1,0], [1,0,1], [0,1,0]],
- [[1,0,1], [0,1,0], [1,0,1]]],self.typeCode)
- scale(tensor,4)
- self.assertEquals((tensor == [[[4,0,4], [0,4,0], [4,0,4]],
- [[0,4,0], [4,0,4], [0,4,0]],
- [[4,0,4], [0,4,0], [4,0,4]]]).all(), True)
-
- # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap
- def testScaleWrongType(self):
- "Test scale function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Tensor.__dict__[self.typeStr + "Scale"]
- tensor = np.array([[[1,0,1], [0,1,0], [1,0,1]],
- [[0,1,0], [1,0,1], [0,1,0]],
- [[1,0,1], [0,1,0], [1,0,1]]],'c')
- self.assertRaises(TypeError, scale, tensor)
-
- # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap
- def testScaleWrongDim(self):
- "Test scale function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Tensor.__dict__[self.typeStr + "Scale"]
- tensor = np.array([[1,0,1], [0,1,0], [1,0,1],
- [0,1,0], [1,0,1], [0,1,0]],self.typeCode)
- self.assertRaises(TypeError, scale, tensor)
-
- # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap
- def testScaleWrongSize(self):
- "Test scale function with wrong size"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Tensor.__dict__[self.typeStr + "Scale"]
- tensor = np.array([[[1,0], [0,1], [1,0]],
- [[0,1], [1,0], [0,1]],
- [[1,0], [0,1], [1,0]]],self.typeCode)
- self.assertRaises(TypeError, scale, tensor)
-
- # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap
- def testScaleNonArray(self):
- "Test scale function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- scale = Tensor.__dict__[self.typeStr + "Scale"]
- self.assertRaises(TypeError, scale, True)
-
- # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
- def testFloor(self):
- "Test floor function"
- print >>sys.stderr, self.typeStr, "... ",
- floor = Tensor.__dict__[self.typeStr + "Floor"]
- tensor = np.array([[[1,2], [3,4]],
- [[5,6], [7,8]]],self.typeCode)
- floor(tensor,4)
- np.testing.assert_array_equal(tensor, np.array([[[4,4], [4,4]],
- [[5,6], [7,8]]]))
-
- # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
- def testFloorWrongType(self):
- "Test floor function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- floor = Tensor.__dict__[self.typeStr + "Floor"]
- tensor = np.array([[[1,2], [3,4]],
- [[5,6], [7,8]]],'c')
- self.assertRaises(TypeError, floor, tensor)
-
- # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
- def testFloorWrongDim(self):
- "Test floor function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- floor = Tensor.__dict__[self.typeStr + "Floor"]
- tensor = np.array([[1,2], [3,4], [5,6], [7,8]],self.typeCode)
- self.assertRaises(TypeError, floor, tensor)
-
- # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
- def testFloorNonArray(self):
- "Test floor function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- floor = Tensor.__dict__[self.typeStr + "Floor"]
- self.assertRaises(TypeError, floor, object)
-
- # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap
- def testCeil(self):
- "Test ceil function"
- print >>sys.stderr, self.typeStr, "... ",
- ceil = Tensor.__dict__[self.typeStr + "Ceil"]
- tensor = np.array([[[9,8], [7,6]],
- [[5,4], [3,2]]],self.typeCode)
- ceil(tensor,5)
- np.testing.assert_array_equal(tensor, np.array([[[5,5], [5,5]],
- [[5,4], [3,2]]]))
-
- # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap
- def testCeilWrongType(self):
- "Test ceil function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- ceil = Tensor.__dict__[self.typeStr + "Ceil"]
- tensor = np.array([[[9,8], [7,6]],
- [[5,4], [3,2]]],'c')
- self.assertRaises(TypeError, ceil, tensor)
-
- # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap
- def testCeilWrongDim(self):
- "Test ceil function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- ceil = Tensor.__dict__[self.typeStr + "Ceil"]
- tensor = np.array([[9,8], [7,6], [5,4], [3,2]], self.typeCode)
- self.assertRaises(TypeError, ceil, tensor)
-
- # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap
- def testCeilNonArray(self):
- "Test ceil function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- ceil = Tensor.__dict__[self.typeStr + "Ceil"]
- tensor = [[[9,8], [7,6]],
- [[5,4], [3,2]]]
- self.assertRaises(TypeError, ceil, tensor)
-
- # Test (type ARGOUT_ARRAY3[ANY][ANY][ANY]) typemap
- def testLUSplit(self):
- "Test luSplit function"
- print >>sys.stderr, self.typeStr, "... ",
- luSplit = Tensor.__dict__[self.typeStr + "LUSplit"]
- lower, upper = luSplit([[[1,1], [1,1]],
- [[1,1], [1,1]]])
- self.assertEquals((lower == [[[1,1], [1,0]],
- [[1,0], [0,0]]]).all(), True)
- self.assertEquals((upper == [[[0,0], [0,1]],
- [[0,1], [1,1]]]).all(), True)
-
-######################################################################
-
-class scharTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "schar"
- self.typeCode = "b"
- self.result = int(self.result)
-
-######################################################################
-
-class ucharTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "uchar"
- self.typeCode = "B"
- self.result = int(self.result)
-
-######################################################################
-
-class shortTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "short"
- self.typeCode = "h"
- self.result = int(self.result)
-
-######################################################################
-
-class ushortTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "ushort"
- self.typeCode = "H"
- self.result = int(self.result)
-
-######################################################################
-
-class intTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "int"
- self.typeCode = "i"
- self.result = int(self.result)
-
-######################################################################
-
-class uintTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "uint"
- self.typeCode = "I"
- self.result = int(self.result)
-
-######################################################################
-
-class longTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "long"
- self.typeCode = "l"
- self.result = int(self.result)
-
-######################################################################
-
-class ulongTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "ulong"
- self.typeCode = "L"
- self.result = int(self.result)
-
-######################################################################
-
-class longLongTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "longLong"
- self.typeCode = "q"
- self.result = int(self.result)
-
-######################################################################
-
-class ulongLongTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "ulongLong"
- self.typeCode = "Q"
- self.result = int(self.result)
-
-######################################################################
-
-class floatTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "float"
- self.typeCode = "f"
-
-######################################################################
-
-class doubleTestCase(TensorTestCase):
- def __init__(self, methodName="runTest"):
- TensorTestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
-
-######################################################################
-
-if __name__ == "__main__":
-
- # Build the test suite
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite( scharTestCase))
- suite.addTest(unittest.makeSuite( ucharTestCase))
- suite.addTest(unittest.makeSuite( shortTestCase))
- suite.addTest(unittest.makeSuite( ushortTestCase))
- suite.addTest(unittest.makeSuite( intTestCase))
- suite.addTest(unittest.makeSuite( uintTestCase))
- suite.addTest(unittest.makeSuite( longTestCase))
- suite.addTest(unittest.makeSuite( ulongTestCase))
- suite.addTest(unittest.makeSuite( longLongTestCase))
- suite.addTest(unittest.makeSuite(ulongLongTestCase))
- suite.addTest(unittest.makeSuite( floatTestCase))
- suite.addTest(unittest.makeSuite( doubleTestCase))
-
- # Execute the test suite
- print "Testing 3D Functions of Module Tensor"
- print "NumPy version", np.__version__
- print
- result = unittest.TextTestRunner(verbosity=2).run(suite)
- sys.exit(len(result.errors) + len(result.failures))
diff --git a/numpy/doc/swig/test/testVector.py b/numpy/doc/swig/test/testVector.py
deleted file mode 100755
index 2ee918389..000000000
--- a/numpy/doc/swig/test/testVector.py
+++ /dev/null
@@ -1,380 +0,0 @@
-#! /usr/bin/env python
-
-# System imports
-from distutils.util import get_platform
-import os
-import sys
-import unittest
-
-# Import NumPy
-import numpy as np
-major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
-if major == 0: BadListError = TypeError
-else: BadListError = ValueError
-
-import Vector
-
-######################################################################
-
-class VectorTestCase(unittest.TestCase):
-
- def __init__(self, methodName="runTest"):
- unittest.TestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
-
- # Test the (type IN_ARRAY1[ANY]) typemap
- def testLength(self):
- "Test length function"
- print >>sys.stderr, self.typeStr, "... ",
- length = Vector.__dict__[self.typeStr + "Length"]
- self.assertEquals(length([5, 12, 0]), 13)
-
- # Test the (type IN_ARRAY1[ANY]) typemap
- def testLengthBadList(self):
- "Test length function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- length = Vector.__dict__[self.typeStr + "Length"]
- self.assertRaises(BadListError, length, [5, "twelve", 0])
-
- # Test the (type IN_ARRAY1[ANY]) typemap
- def testLengthWrongSize(self):
- "Test length function with wrong size"
- print >>sys.stderr, self.typeStr, "... ",
- length = Vector.__dict__[self.typeStr + "Length"]
- self.assertRaises(TypeError, length, [5, 12])
-
- # Test the (type IN_ARRAY1[ANY]) typemap
- def testLengthWrongDim(self):
- "Test length function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- length = Vector.__dict__[self.typeStr + "Length"]
- self.assertRaises(TypeError, length, [[1,2], [3,4]])
-
- # Test the (type IN_ARRAY1[ANY]) typemap
- def testLengthNonContainer(self):
- "Test length function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- length = Vector.__dict__[self.typeStr + "Length"]
- self.assertRaises(TypeError, length, None)
-
- # Test the (type* IN_ARRAY1, int DIM1) typemap
- def testProd(self):
- "Test prod function"
- print >>sys.stderr, self.typeStr, "... ",
- prod = Vector.__dict__[self.typeStr + "Prod"]
- self.assertEquals(prod([1,2,3,4]), 24)
-
- # Test the (type* IN_ARRAY1, int DIM1) typemap
- def testProdBadList(self):
- "Test prod function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- prod = Vector.__dict__[self.typeStr + "Prod"]
- self.assertRaises(BadListError, prod, [[1,"two"], ["e","pi"]])
-
- # Test the (type* IN_ARRAY1, int DIM1) typemap
- def testProdWrongDim(self):
- "Test prod function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- prod = Vector.__dict__[self.typeStr + "Prod"]
- self.assertRaises(TypeError, prod, [[1,2], [8,9]])
-
- # Test the (type* IN_ARRAY1, int DIM1) typemap
- def testProdNonContainer(self):
- "Test prod function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- prod = Vector.__dict__[self.typeStr + "Prod"]
- self.assertRaises(TypeError, prod, None)
-
- # Test the (int DIM1, type* IN_ARRAY1) typemap
- def testSum(self):
- "Test sum function"
- print >>sys.stderr, self.typeStr, "... ",
- sum = Vector.__dict__[self.typeStr + "Sum"]
- self.assertEquals(sum([5,6,7,8]), 26)
-
- # Test the (int DIM1, type* IN_ARRAY1) typemap
- def testSumBadList(self):
- "Test sum function with bad list"
- print >>sys.stderr, self.typeStr, "... ",
- sum = Vector.__dict__[self.typeStr + "Sum"]
- self.assertRaises(BadListError, sum, [3,4, 5, "pi"])
-
- # Test the (int DIM1, type* IN_ARRAY1) typemap
- def testSumWrongDim(self):
- "Test sum function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- sum = Vector.__dict__[self.typeStr + "Sum"]
- self.assertRaises(TypeError, sum, [[3,4], [5,6]])
-
- # Test the (int DIM1, type* IN_ARRAY1) typemap
- def testSumNonContainer(self):
- "Test sum function with non-container"
- print >>sys.stderr, self.typeStr, "... ",
- sum = Vector.__dict__[self.typeStr + "Sum"]
- self.assertRaises(TypeError, sum, True)
-
- # Test the (type INPLACE_ARRAY1[ANY]) typemap
- def testReverse(self):
- "Test reverse function"
- print >>sys.stderr, self.typeStr, "... ",
- reverse = Vector.__dict__[self.typeStr + "Reverse"]
- vector = np.array([1,2,4],self.typeCode)
- reverse(vector)
- self.assertEquals((vector == [4,2,1]).all(), True)
-
- # Test the (type INPLACE_ARRAY1[ANY]) typemap
- def testReverseWrongDim(self):
- "Test reverse function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- reverse = Vector.__dict__[self.typeStr + "Reverse"]
- vector = np.array([[1,2], [3,4]],self.typeCode)
- self.assertRaises(TypeError, reverse, vector)
-
- # Test the (type INPLACE_ARRAY1[ANY]) typemap
- def testReverseWrongSize(self):
- "Test reverse function with wrong size"
- print >>sys.stderr, self.typeStr, "... ",
- reverse = Vector.__dict__[self.typeStr + "Reverse"]
- vector = np.array([9,8,7,6,5,4],self.typeCode)
- self.assertRaises(TypeError, reverse, vector)
-
- # Test the (type INPLACE_ARRAY1[ANY]) typemap
- def testReverseWrongType(self):
- "Test reverse function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- reverse = Vector.__dict__[self.typeStr + "Reverse"]
- vector = np.array([1,2,4],'c')
- self.assertRaises(TypeError, reverse, vector)
-
- # Test the (type INPLACE_ARRAY1[ANY]) typemap
- def testReverseNonArray(self):
- "Test reverse function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- reverse = Vector.__dict__[self.typeStr + "Reverse"]
- self.assertRaises(TypeError, reverse, [2,4,6])
-
- # Test the (type* INPLACE_ARRAY1, int DIM1) typemap
- def testOnes(self):
- "Test ones function"
- print >>sys.stderr, self.typeStr, "... ",
- ones = Vector.__dict__[self.typeStr + "Ones"]
- vector = np.zeros(5,self.typeCode)
- ones(vector)
- np.testing.assert_array_equal(vector, np.array([1,1,1,1,1]))
-
- # Test the (type* INPLACE_ARRAY1, int DIM1) typemap
- def testOnesWrongDim(self):
- "Test ones function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- ones = Vector.__dict__[self.typeStr + "Ones"]
- vector = np.zeros((5,5),self.typeCode)
- self.assertRaises(TypeError, ones, vector)
-
- # Test the (type* INPLACE_ARRAY1, int DIM1) typemap
- def testOnesWrongType(self):
- "Test ones function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- ones = Vector.__dict__[self.typeStr + "Ones"]
- vector = np.zeros((5,5),'c')
- self.assertRaises(TypeError, ones, vector)
-
- # Test the (type* INPLACE_ARRAY1, int DIM1) typemap
- def testOnesNonArray(self):
- "Test ones function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- ones = Vector.__dict__[self.typeStr + "Ones"]
- self.assertRaises(TypeError, ones, [2,4,6,8])
-
- # Test the (int DIM1, type* INPLACE_ARRAY1) typemap
- def testZeros(self):
- "Test zeros function"
- print >>sys.stderr, self.typeStr, "... ",
- zeros = Vector.__dict__[self.typeStr + "Zeros"]
- vector = np.ones(5,self.typeCode)
- zeros(vector)
- np.testing.assert_array_equal(vector, np.array([0,0,0,0,0]))
-
- # Test the (int DIM1, type* INPLACE_ARRAY1) typemap
- def testZerosWrongDim(self):
- "Test zeros function with wrong dimensions"
- print >>sys.stderr, self.typeStr, "... ",
- zeros = Vector.__dict__[self.typeStr + "Zeros"]
- vector = np.ones((5,5),self.typeCode)
- self.assertRaises(TypeError, zeros, vector)
-
- # Test the (int DIM1, type* INPLACE_ARRAY1) typemap
- def testZerosWrongType(self):
- "Test zeros function with wrong type"
- print >>sys.stderr, self.typeStr, "... ",
- zeros = Vector.__dict__[self.typeStr + "Zeros"]
- vector = np.ones(6,'c')
- self.assertRaises(TypeError, zeros, vector)
-
- # Test the (int DIM1, type* INPLACE_ARRAY1) typemap
- def testZerosNonArray(self):
- "Test zeros function with non-array"
- print >>sys.stderr, self.typeStr, "... ",
- zeros = Vector.__dict__[self.typeStr + "Zeros"]
- self.assertRaises(TypeError, zeros, [1,3,5,7,9])
-
- # Test the (type ARGOUT_ARRAY1[ANY]) typemap
- def testEOSplit(self):
- "Test eoSplit function"
- print >>sys.stderr, self.typeStr, "... ",
- eoSplit = Vector.__dict__[self.typeStr + "EOSplit"]
- even, odd = eoSplit([1,2,3])
- self.assertEquals((even == [1,0,3]).all(), True)
- self.assertEquals((odd == [0,2,0]).all(), True)
-
- # Test the (type* ARGOUT_ARRAY1, int DIM1) typemap
- def testTwos(self):
- "Test twos function"
- print >>sys.stderr, self.typeStr, "... ",
- twos = Vector.__dict__[self.typeStr + "Twos"]
- vector = twos(5)
- self.assertEquals((vector == [2,2,2,2,2]).all(), True)
-
- # Test the (type* ARGOUT_ARRAY1, int DIM1) typemap
- def testTwosNonInt(self):
- "Test twos function with non-integer dimension"
- print >>sys.stderr, self.typeStr, "... ",
- twos = Vector.__dict__[self.typeStr + "Twos"]
- self.assertRaises(TypeError, twos, 5.0)
-
- # Test the (int DIM1, type* ARGOUT_ARRAY1) typemap
- def testThrees(self):
- "Test threes function"
- print >>sys.stderr, self.typeStr, "... ",
- threes = Vector.__dict__[self.typeStr + "Threes"]
- vector = threes(6)
- self.assertEquals((vector == [3,3,3,3,3,3]).all(), True)
-
- # Test the (type* ARGOUT_ARRAY1, int DIM1) typemap
- def testThreesNonInt(self):
- "Test threes function with non-integer dimension"
- print >>sys.stderr, self.typeStr, "... ",
- threes = Vector.__dict__[self.typeStr + "Threes"]
- self.assertRaises(TypeError, threes, "threes")
-
-######################################################################
-
-class scharTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "schar"
- self.typeCode = "b"
-
-######################################################################
-
-class ucharTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "uchar"
- self.typeCode = "B"
-
-######################################################################
-
-class shortTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "short"
- self.typeCode = "h"
-
-######################################################################
-
-class ushortTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "ushort"
- self.typeCode = "H"
-
-######################################################################
-
-class intTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "int"
- self.typeCode = "i"
-
-######################################################################
-
-class uintTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "uint"
- self.typeCode = "I"
-
-######################################################################
-
-class longTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "long"
- self.typeCode = "l"
-
-######################################################################
-
-class ulongTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "ulong"
- self.typeCode = "L"
-
-######################################################################
-
-class longLongTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "longLong"
- self.typeCode = "q"
-
-######################################################################
-
-class ulongLongTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "ulongLong"
- self.typeCode = "Q"
-
-######################################################################
-
-class floatTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "float"
- self.typeCode = "f"
-
-######################################################################
-
-class doubleTestCase(VectorTestCase):
- def __init__(self, methodName="runTest"):
- VectorTestCase.__init__(self, methodName)
- self.typeStr = "double"
- self.typeCode = "d"
-
-######################################################################
-
-if __name__ == "__main__":
-
- # Build the test suite
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite( scharTestCase))
- suite.addTest(unittest.makeSuite( ucharTestCase))
- suite.addTest(unittest.makeSuite( shortTestCase))
- suite.addTest(unittest.makeSuite( ushortTestCase))
- suite.addTest(unittest.makeSuite( intTestCase))
- suite.addTest(unittest.makeSuite( uintTestCase))
- suite.addTest(unittest.makeSuite( longTestCase))
- suite.addTest(unittest.makeSuite( ulongTestCase))
- suite.addTest(unittest.makeSuite( longLongTestCase))
- suite.addTest(unittest.makeSuite(ulongLongTestCase))
- suite.addTest(unittest.makeSuite( floatTestCase))
- suite.addTest(unittest.makeSuite( doubleTestCase))
-
- # Execute the test suite
- print "Testing 1D Functions of Module Vector"
- print "NumPy version", np.__version__
- print
- result = unittest.TextTestRunner(verbosity=2).run(suite)
- sys.exit(len(result.errors) + len(result.failures))
diff --git a/numpy/doc/reference/ufuncs.py b/numpy/doc/ufuncs.py
index 4819e5268..4819e5268 100644
--- a/numpy/doc/reference/ufuncs.py
+++ b/numpy/doc/ufuncs.py
diff --git a/numpy/doc/ufuncs.txt b/numpy/doc/ufuncs.txt
deleted file mode 100644
index fa107cc21..000000000
--- a/numpy/doc/ufuncs.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-BUFFERED General Ufunc explanation
-==================================
-
-.. note::
-
- This was implemented already, but the notes are kept here for historical
- and explanatory purposes.
-
-We need to optimize the section of ufunc code that handles mixed-type
-and misbehaved arrays. In particular, we need to fix it so that items
-are not copied into the buffer if they don't have to be.
-
-Right now, all data is copied into the buffers (even scalars are copied
-multiple times into the buffers even if they are not going to be cast).
-
-Some benchmarks show that this results in a significant slow-down
-(factor of 4) over similar numarray code.
-
-The approach is therefore, to loop over the largest-dimension (just like
-the NO_BUFFER) portion of the code. All arrays will either have N or
-1 in this last dimension (or their would be a mis-match error). The
-buffer size is B.
-
-If N <= B (and only if needed), we copy the entire last-dimension into
-the buffer as fast as possible using the single-stride information.
-
-Also we only copy into output arrays if needed as well (other-wise the
-output arrays are used directly in the ufunc code).
-
-Call the function using the appropriate strides information from all the input
-arrays. Only set the strides to the element-size for arrays that will be copied.
-
-If N > B, then we have to do the above operation in a loop (with an extra loop
-at the end with a different buffer size).
-
-Both of these cases are handled with the following code::
-
- Compute N = quotient * B + remainder.
- quotient = N / B # integer math
- (store quotient + 1) as the number of innerloops
- remainder = N % B # integer remainder
-
-On the inner-dimension we will have (quotient + 1) loops where
-the size of the inner function is B for all but the last when the niter size is
-remainder.
-
-So, the code looks very similar to NOBUFFER_LOOP except the inner loop is
-replaced with::
-
- for(k=0; i<quotient+1; k++) {
- if (k==quotient+1) make itersize remainder size
- copy only needed items to buffer.
- swap input buffers if needed
- cast input buffers if needed
- call function()
- cast outputs in buffers if needed
- swap outputs in buffers if needed
- copy only needed items back to output arrays.
- update all data-pointers by strides*niter
- }
-
-
-Reference counting for OBJECT arrays:
-
-If there are object arrays involved then loop->obj gets set to 1. Then there are two cases:
-
-1) The loop function is an object loop:
-
- Inputs:
- - castbuf starts as NULL and then gets filled with new references.
- - function gets called and doesn't alter the reference count in castbuf
- - on the next iteration (next value of k), the casting function will
- DECREF what is present in castbuf already and place a new object.
-
- - At the end of the inner loop (for loop over k), the final new-references
- in castbuf must be DECREF'd. If its a scalar then a single DECREF suffices
- Otherwise, "bufsize" DECREF's are needed (unless there was only one
- loop, then "remainder" DECREF's are needed).
-
- Outputs:
- - castbuf contains a new reference as the result of the function call. This
- gets converted to the type of interest and. This new reference in castbuf
- will be DECREF'd by later calls to the function. Thus, only after the
- inner most loop do we need to DECREF the remaining references in castbuf.
-
-2) The loop function is of a different type:
-
- Inputs:
-
- - The PyObject input is copied over to buffer which receives a "borrowed"
- reference. This reference is then used but not altered by the cast
- call. Nothing needs to be done.
-
- Outputs:
-
- - The buffer[i] memory receives the PyObject input after the cast. This is
- a new reference which will be "stolen" as it is copied over into memory.
- The only problem is that what is presently in memory must be DECREF'd first.
-
-
-
-
-
diff --git a/numpy/f2py/auxfuncs.py b/numpy/f2py/auxfuncs.py
index fb82c28df..facbd0534 100644
--- a/numpy/f2py/auxfuncs.py
+++ b/numpy/f2py/auxfuncs.py
@@ -20,9 +20,7 @@ f2py_version = __version__.version
import pprint
import sys
-import time
import types
-import os
import cfuncs
diff --git a/numpy/f2py/cb_rules.py b/numpy/f2py/cb_rules.py
index 8f6ac101a..aeb0e7a11 100644
--- a/numpy/f2py/cb_rules.py
+++ b/numpy/f2py/cb_rules.py
@@ -21,16 +21,13 @@ f2py_version = __version__.version
import pprint
import sys
-import time
import types
-import copy
errmess=sys.stderr.write
outmess=sys.stdout.write
show=pprint.pprint
from auxfuncs import *
import capi_maps
-#from capi_maps import *
import cfuncs
################## Rules for callback function ##############
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index a1e8ebff3..02462241c 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -19,7 +19,9 @@ __version__ = "$Revision: 1.75 $"[10:-1]
import __version__
f2py_version = __version__.version
-import types,sys,copy,os
+import types
+import sys
+import copy
errmess=sys.stderr.write
##################### Definitions ##################
diff --git a/numpy/f2py/common_rules.py b/numpy/f2py/common_rules.py
index c4a7b5dab..3295676ef 100644
--- a/numpy/f2py/common_rules.py
+++ b/numpy/f2py/common_rules.py
@@ -20,16 +20,12 @@ f2py_version = __version__.version
import pprint
import sys
-import time
-import types
-import copy
errmess=sys.stderr.write
outmess=sys.stdout.write
show=pprint.pprint
from auxfuncs import *
import capi_maps
-import cfuncs
import func2subr
from crackfortran import rmbadname
##############
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py
index 1b3effc84..8e5f2882f 100755
--- a/numpy/f2py/crackfortran.py
+++ b/numpy/f2py/crackfortran.py
@@ -15,7 +15,6 @@ Pearu Peterson
__version__ = "$Revision: 1.177 $"[10:-1]
import __version__
-import string
f2py_version = __version__.version
"""
@@ -327,7 +326,7 @@ def readfortrancode(ffile,dowithline=show,istop=1):
if rl[:4].lower()=='f2py': # f2py directive
l = l + 4*' '
r=commentline.match(rl[4:])
- if r: l=l+r('line')
+ if r: l=l+r.group('line')
else: l = l + rl[4:]
if l.strip()=='': # Skip empty line
cont=0
diff --git a/numpy/f2py/doc/collectinput.py b/numpy/f2py/doc/collectinput.py
index 54a908fcc..2e6c6c96b 100755
--- a/numpy/f2py/doc/collectinput.py
+++ b/numpy/f2py/doc/collectinput.py
@@ -23,7 +23,6 @@ __version__ = "0.0"
stdoutflag=0
import sys
-import os
import fileinput
import re
import commands
diff --git a/numpy/f2py/f2py2e.py b/numpy/f2py/f2py2e.py
index eb0ae1889..2fd4f6caa 100755
--- a/numpy/f2py/f2py2e.py
+++ b/numpy/f2py/f2py2e.py
@@ -21,7 +21,6 @@ f2py_version = __version__.version
import sys
import os
import pprint
-import shutil
import types
import re
errmess=sys.stderr.write
@@ -31,11 +30,8 @@ show=pprint.pprint
import crackfortran
import rules
import cb_rules
-import common_rules
import auxfuncs
import cfuncs
-import capi_maps
-import func2subr
import f90mod_rules
outmess = auxfuncs.outmess
@@ -395,7 +391,7 @@ def run_compile():
"""
Do it all in one call!
"""
- import tempfile,os,shutil
+ import tempfile
i = sys.argv.index('-c')
del sys.argv[i]
@@ -547,6 +543,7 @@ def run_compile():
setup(ext_modules = [ext])
if remove_build_dir and os.path.exists(build_dir):
+ import shutil
outmess('Removing build directory %s\n'%(build_dir))
shutil.rmtree(build_dir)
diff --git a/numpy/f2py/f2py_testing.py b/numpy/f2py/f2py_testing.py
index aabf0c569..0c78f3594 100644
--- a/numpy/f2py/f2py_testing.py
+++ b/numpy/f2py/f2py_testing.py
@@ -1,4 +1,5 @@
-import os,sys,re,time
+import sys
+import re
from numpy.testing.utils import jiffies, memusage
diff --git a/numpy/f2py/f90mod_rules.py b/numpy/f2py/f90mod_rules.py
index f8ca508e0..f494d43c0 100644
--- a/numpy/f2py/f90mod_rules.py
+++ b/numpy/f2py/f90mod_rules.py
@@ -17,11 +17,8 @@ __version__ = "$Revision: 1.27 $"[10:-1]
f2py_version='See `f2py -v`'
-import copy
import pprint
import sys
-import time
-import types
errmess=sys.stderr.write
outmess=sys.stdout.write
show=pprint.pprint
@@ -29,7 +26,6 @@ show=pprint.pprint
from auxfuncs import *
import numpy as np
import capi_maps
-import cfuncs
import rules
import func2subr
from crackfortran import undo_rmbadname, undo_rmbadname1
diff --git a/numpy/f2py/func2subr.py b/numpy/f2py/func2subr.py
index b0421bb55..7ce30bc70 100644
--- a/numpy/f2py/func2subr.py
+++ b/numpy/f2py/func2subr.py
@@ -20,9 +20,6 @@ f2py_version='See `f2py -v`'
import pprint
import copy
import sys
-import time
-import types
-import copy
errmess=sys.stderr.write
outmess=sys.stdout.write
show=pprint.pprint
diff --git a/numpy/f2py/use_rules.py b/numpy/f2py/use_rules.py
index 25e52df0b..021d08601 100644
--- a/numpy/f2py/use_rules.py
+++ b/numpy/f2py/use_rules.py
@@ -21,16 +21,11 @@ f2py_version='See `f2py -v`'
import pprint
import sys
-import time
-import types
-import copy
errmess=sys.stderr.write
outmess=sys.stdout.write
show=pprint.pprint
from auxfuncs import *
-import capi_maps
-import cfuncs
##############
usemodule_rules={
diff --git a/numpy/fft/fftpack_litemodule.c b/numpy/fft/fftpack_litemodule.c
index f2446dcf9..3375976d6 100644
--- a/numpy/fft/fftpack_litemodule.c
+++ b/numpy/fft/fftpack_litemodule.c
@@ -9,7 +9,7 @@ static PyObject *ErrorObject;
static char fftpack_cfftf__doc__[] = "";
PyObject *
-fftpack_cfftf(PyObject *self, PyObject *args)
+fftpack_cfftf(PyObject *NPY_UNUSED(self), PyObject *args)
{
PyObject *op1, *op2;
PyArrayObject *data;
@@ -60,7 +60,7 @@ fail:
static char fftpack_cfftb__doc__[] = "";
PyObject *
-fftpack_cfftb(PyObject *self, PyObject *args)
+fftpack_cfftb(PyObject *NPY_UNUSED(self), PyObject *args)
{
PyObject *op1, *op2;
PyArrayObject *data;
@@ -111,7 +111,7 @@ fail:
static char fftpack_cffti__doc__[] ="";
static PyObject *
-fftpack_cffti(PyObject *self, PyObject *args)
+fftpack_cffti(PyObject *NPY_UNUSED(self), PyObject *args)
{
PyArrayObject *op;
npy_intp dim;
@@ -138,7 +138,7 @@ fftpack_cffti(PyObject *self, PyObject *args)
static char fftpack_rfftf__doc__[] ="";
PyObject *
-fftpack_rfftf(PyObject *self, PyObject *args)
+fftpack_rfftf(PyObject *NPY_UNUSED(self), PyObject *args)
{
PyObject *op1, *op2;
PyArrayObject *data, *ret;
@@ -204,7 +204,7 @@ static char fftpack_rfftb__doc__[] ="";
PyObject *
-fftpack_rfftb(PyObject *self, PyObject *args)
+fftpack_rfftb(PyObject *NPY_UNUSED(self), PyObject *args)
{
PyObject *op1, *op2;
PyArrayObject *data, *ret;
@@ -265,7 +265,7 @@ fail:
static char fftpack_rffti__doc__[] ="";
static PyObject *
-fftpack_rffti(PyObject *self, PyObject *args)
+fftpack_rffti(PyObject *NPY_UNUSED(self), PyObject *args)
{
PyArrayObject *op;
npy_intp dim;
diff --git a/numpy/fft/tests/test_fftpack.py b/numpy/fft/tests/test_fftpack.py
index da15b8114..1095de4bc 100644
--- a/numpy/fft/tests/test_fftpack.py
+++ b/numpy/fft/tests/test_fftpack.py
@@ -1,4 +1,3 @@
-import sys
from numpy.testing import *
import numpy as np
diff --git a/numpy/fft/tests/test_helper.py b/numpy/fft/tests/test_helper.py
index 13006e2c0..f757b6032 100644
--- a/numpy/fft/tests/test_helper.py
+++ b/numpy/fft/tests/test_helper.py
@@ -3,7 +3,6 @@
""" Test functions for fftpack.helper module
"""
-import sys
from numpy.testing import *
from numpy.fft import fftshift,ifftshift,fftfreq
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py
index 1201f3d7e..7e760b416 100644
--- a/numpy/lib/_datasource.py
+++ b/numpy/lib/_datasource.py
@@ -36,21 +36,39 @@ __docformat__ = "restructuredtext en"
import os
from shutil import rmtree
-from urlparse import urlparse
-# TODO: .zip support, .tar support?
-_file_openers = {None: open}
-try:
- import bz2
- _file_openers[".bz2"] = bz2.BZ2File
-except ImportError:
- pass
-try:
- import gzip
- _file_openers[".gz"] = gzip.open
-except ImportError:
- pass
+# Using a class instead of a module-level dictionary
+# to reduce the inital 'import numpy' overhead by
+# deferring the import of bz2 and gzip until needed
+# TODO: .zip support, .tar support?
+class _FileOpeners(object):
+ def __init__(self):
+ self._loaded = False
+ self._file_openers = {None: open}
+ def _load(self):
+ if self._loaded:
+ return
+ try:
+ import bz2
+ self._file_openers[".bz2"] = bz2.BZ2File
+ except ImportError:
+ pass
+ try:
+ import gzip
+ self._file_openers[".gz"] = gzip.open
+ except ImportError:
+ pass
+ self._loaded = True
+
+ def keys(self):
+ self._load()
+ return self._file_openers.keys()
+ def __getitem__(self, key):
+ self._load()
+ return self._file_openers[key]
+
+_file_openers = _FileOpeners()
def open(path, mode='r', destpath=os.curdir):
"""Open ``path`` with ``mode`` and return the file object.
@@ -180,6 +198,9 @@ class DataSource (object):
def _isurl(self, path):
"""Test if path is a net location. Tests the scheme and netloc."""
+ # We do this here to reduce the 'import numpy' initial import time.
+ from urlparse import urlparse
+
# BUG : URLs require a scheme string ('http://') to be used.
# www.google.com will fail.
# Should we prepend the scheme for those that don't have it and
@@ -276,6 +297,9 @@ class DataSource (object):
`open` : Method that downloads and opens files.
"""
+ # We do this here to reduce the 'import numpy' initial import time.
+ from urlparse import urlparse
+
# TODO: This should be more robust. Handles case where path includes
# the destpath, but not other sub-paths. Failing case:
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index 19efbc452..270927321 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -35,7 +35,6 @@ last revision: 07.01.2007
__all__ = ['ediff1d', 'unique1d', 'intersect1d', 'intersect1d_nu', 'setxor1d',
'setmember1d', 'union1d', 'setdiff1d']
-import time
import numpy as np
def ediff1d(ary, to_end=None, to_begin=None):
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 4192e1225..32a23ae18 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -57,7 +57,6 @@ means there is 1 element) by dtype.itemsize.
"""
import cPickle
-import struct
import numpy
from numpy.lib.utils import safe_eval
@@ -180,6 +179,7 @@ def write_array_header_1_0(fp, d):
This has the appropriate entries for writing its string representation
to the header of the file.
"""
+ import struct
header = ["{"]
for key, value in sorted(d.items()):
# Need to use repr here, since we eval these when reading
@@ -230,6 +230,7 @@ def read_array_header_1_0(fp):
"""
# Read an unsigned, little-endian short int which has the length of the
# header.
+ import struct
hlength_str = fp.read(2)
if len(hlength_str) != 2:
msg = "EOF at %s before reading array header length"
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index af87b24a6..02018c87e 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -7,7 +7,7 @@ __all__ = ['unravel_index',
import sys
import numpy.core.numeric as _nx
-from numpy.core.numeric import asarray, ScalarType, array, dtype
+from numpy.core.numeric import asarray, ScalarType, array
from numpy.core.numerictypes import find_common_type
import math
diff --git a/numpy/lib/io.py b/numpy/lib/io.py
index 41ffc51b8..caa790809 100644
--- a/numpy/lib/io.py
+++ b/numpy/lib/io.py
@@ -313,6 +313,9 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None,
"""
user_converters = converters
+ if usecols is not None:
+ usecols = list(usecols)
+
if _string_like(fname):
if fname.endswith('.gz'):
import gzip
@@ -358,6 +361,8 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None,
first_vals = None
while not first_vals:
first_line = fh.readline()
+ if first_line == '': # EOF reached
+ raise IOError('End-of-file reached before encountering data.')
first_vals = split_line(first_line)
N = len(usecols or first_vals)
@@ -373,7 +378,11 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None,
# By preference, use the converters specified by the user
for i, conv in (user_converters or {}).iteritems():
if usecols:
- i = usecols.find(i)
+ try:
+ i = usecols.index(i)
+ except ValueError:
+ # Unused converter specified
+ continue
converters[i] = conv
# Parse each line, including the first
diff --git a/numpy/lib/scimath.py b/numpy/lib/scimath.py
index d601cbd14..0d765fa20 100644
--- a/numpy/lib/scimath.py
+++ b/numpy/lib/scimath.py
@@ -192,6 +192,22 @@ def sqrt(x):
>>> np.lib.scimath.sqrt([-1,4])
array([ 0.+1.j, 2.+0.j])
+
+ Notes
+ -----
+
+ As the numpy.sqrt, this returns the principal square root of x, which is
+ what most people mean when they use square root; the principal square root
+ of x is not any number z such as z^2 = x.
+
+ For positive numbers, the principal square root is defined as the positive
+ number z such as z^2 = x.
+
+ The principal square root of -1 is i, the principal square root of any
+ negative number -x is defined a i * sqrt(x). For any non zero complex
+ number, it is defined by using the following branch cut: x = r e^(i t) with
+ r > 0 and -pi < t <= pi. The principal square root is then
+ sqrt(r) e^(i t/2).
"""
x = _fix_real_lt_zero(x)
return nx.sqrt(x)
diff --git a/numpy/lib/setup.py b/numpy/lib/setup.py
index f43843ddc..e85fdb517 100644
--- a/numpy/lib/setup.py
+++ b/numpy/lib/setup.py
@@ -12,6 +12,7 @@ def configuration(parent_package='',top_path=None):
sources=[join('src','_compiled_base.c')]
)
+ config.add_data_dir('benchmarks')
config.add_data_dir('tests')
return config
diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c
index c72a04d8d..ddab9f851 100644
--- a/numpy/lib/src/_compiled_base.c
+++ b/numpy/lib/src/_compiled_base.c
@@ -80,7 +80,7 @@ mnx (intp *i , intp len)
static PyObject *
-arr_bincount(PyObject *self, PyObject *args, PyObject *kwds)
+arr_bincount(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
{
/* arr_bincount is registered as bincount.
* bincount accepts one or two arguments. The first is an array of
@@ -147,7 +147,7 @@ arr_bincount(PyObject *self, PyObject *args, PyObject *kwds)
static PyObject *
-arr_digitize(PyObject *self, PyObject *args, PyObject *kwds)
+arr_digitize(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
{
/* digitize (x, bins) returns an array of python integers the same
length of x. The values i returned are such that bins [i - 1] <= x <
@@ -219,7 +219,7 @@ arr_digitize(PyObject *self, PyObject *args, PyObject *kwds)
static char arr_insert__doc__[] = "Insert vals sequentially into equivalent 1-d positions indicated by mask.";
static PyObject *
-arr_insert(PyObject *self, PyObject *args, PyObject *kwdict)
+arr_insert(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
{
/* Returns input array with values inserted sequentially into places
indicated by the mask
@@ -379,7 +379,7 @@ binary_search(double dval, double dlist [], npy_intp len)
}
static PyObject *
-arr_interp(PyObject *self, PyObject *args, PyObject *kwdict)
+arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
{
PyObject *fp, *xp, *x;
@@ -474,7 +474,7 @@ static PyTypeObject *PyMethodDescr_TypePtr=NULL;
/* Can only be called if doc is currently NULL
*/
static PyObject *
-arr_add_docstring(PyObject *dummy, PyObject *args)
+arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
PyObject *obj;
PyObject *str;
@@ -624,11 +624,11 @@ _packbits(
static void
_unpackbits(
void *In,
- int el_size, /* unused */
+ int NPY_UNUSED(el_size), /* unused */
npy_intp in_N,
npy_intp in_stride,
void *Out,
- npy_intp out_N,
+ npy_intp NPY_UNUSED(out_N),
npy_intp out_stride
)
{
@@ -772,7 +772,7 @@ pack_or_unpack_bits(PyObject *input, int axis, int unpack)
static PyObject *
-io_pack(PyObject *self, PyObject *args, PyObject *kwds)
+io_pack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
{
PyObject *obj;
int axis=NPY_MAXDIMS;
@@ -785,7 +785,7 @@ io_pack(PyObject *self, PyObject *args, PyObject *kwds)
}
static PyObject *
-io_unpack(PyObject *self, PyObject *args, PyObject *kwds)
+io_unpack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
{
PyObject *obj;
int axis=NPY_MAXDIMS;
diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py
index 95a72f76a..90a137498 100644
--- a/numpy/lib/tests/test__datasource.py
+++ b/numpy/lib/tests/test__datasource.py
@@ -1,7 +1,4 @@
-
import os
-import sys
-import struct
from tempfile import mkdtemp, mkstemp, NamedTemporaryFile
from shutil import rmtree
from urlparse import urlparse
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
index 611e99690..35558400f 100644
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -421,7 +421,7 @@ def test_roundtrip():
def test_memmap_roundtrip():
# XXX: test crashes nose on windows. Fix this
- if not sys.platform == 'win32':
+ if not (sys.platform == 'win32' or sys.platform == 'cygwin'):
for arr in basic_arrays + record_arrays:
if arr.dtype.hasobject:
# Skip these since they can't be mmap'ed.
@@ -434,13 +434,13 @@ def test_memmap_roundtrip():
format.write_array(fp, arr)
finally:
fp.close()
-
+
fortran_order = (arr.flags.f_contiguous and not arr.flags.c_contiguous)
ma = format.open_memmap(mfn, mode='w+', dtype=arr.dtype,
shape=arr.shape, fortran_order=fortran_order)
ma[...] = arr
del ma
-
+
# Check that both of these files' contents are the same.
fp = open(nfn, 'rb')
normal_bytes = fp.read()
@@ -449,7 +449,7 @@ def test_memmap_roundtrip():
memmap_bytes = fp.read()
fp.close()
yield assert_equal, normal_bytes, memmap_bytes
-
+
# Check that reading the file using memmap works.
ma = format.open_memmap(nfn, mode='r')
#yield assert_array_equal, ma, arr
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 183696c58..8f80920cd 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1,4 +1,3 @@
-import sys
import warnings
from numpy.testing import *
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 1d2c2321a..d257b5423 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -140,7 +140,6 @@ class TestLoadTxt(TestCase):
y = np.loadtxt(d, dtype=mydescriptor)
assert_array_equal(y, b)
-
def test_array(self):
c = StringIO.StringIO()
c.write('1 2\n3 4')
@@ -170,7 +169,6 @@ class TestLoadTxt(TestCase):
a = np.array([1,2,3,4], int)
assert_array_equal(x, a)
-
def test_missing(self):
c = StringIO.StringIO()
c.write('1,2,3,,5\n')
@@ -180,6 +178,16 @@ class TestLoadTxt(TestCase):
a = np.array([1,2,3,-999,5], int)
assert_array_equal(x, a)
+ def test_converters_with_usecols(self):
+ c = StringIO.StringIO()
+ c.write('1,2,3,,5\n6,7,8,9,10\n')
+ c.seek(0)
+ x = np.loadtxt(c, dtype=int, delimiter=',', \
+ converters={3:lambda s: int(s or -999)}, \
+ usecols=(1, 3, ))
+ a = np.array([[2, -999],[7, 9]], int)
+ assert_array_equal(x, a)
+
def test_comments(self):
c = StringIO.StringIO()
c.write('# comment\n1,2,3,5\n')
@@ -221,6 +229,11 @@ class TestLoadTxt(TestCase):
x = np.loadtxt(c, dtype=float, usecols=(1,2))
assert_array_equal(x, a[:,1:])
+ # Testing with arrays instead of tuples.
+ c.seek(0)
+ x = np.loadtxt(c, dtype=float, usecols=np.array([1,2]))
+ assert_array_equal(x, a[:,1:])
+
# Checking with dtypes defined converters.
data = '''JOE 70.1 25.3
BOB 60.5 27.9
@@ -241,6 +254,20 @@ class TestLoadTxt(TestCase):
a = np.array([(1,(2,3.0)),(4,(5,6.0))], dt)
assert_array_equal(x, a)
+ def test_empty_file(self):
+ c = StringIO.StringIO()
+ assert_raises(IOError, np.loadtxt, c)
+
+ def test_unused_converter(self):
+ c = StringIO.StringIO()
+ c.writelines(['1 21\n', '3 42\n'])
+ c.seek(0)
+ data = np.loadtxt(c, usecols=(1,), converters={0: lambda s: int(s, 16)})
+ assert_array_equal(data, [21, 42])
+
+ c.seek(0)
+ data = np.loadtxt(c, usecols=(1,), converters={1: lambda s: int(s, 16)})
+ assert_array_equal(data, [33, 66])
class Testfromregex(TestCase):
def test_record(self):
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py
index bd941adad..63e6a75de 100644
--- a/numpy/lib/tests/test_ufunclike.py
+++ b/numpy/lib/tests/test_ufunclike.py
@@ -6,14 +6,14 @@ Test fix:
>>> a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]])
>>> U.fix(a)
array([[ 1., 1., 1., 1.],
- [ 0., -1., -1., -1.]])
+ [-1., -1., -1., -1.]])
>>> y = nx.zeros(a.shape, float)
>>> U.fix(a, y)
array([[ 1., 1., 1., 1.],
- [ 0., -1., -1., -1.]])
+ [-1., -1., -1., -1.]])
>>> y
array([[ 1., 1., 1., 1.],
- [ 0., -1., -1., -1.]])
+ [-1., -1., -1., -1.]])
Test isposinf, isneginf, sign
>>> a = nx.array([nx.Inf, -nx.Inf, nx.NaN, 0.0, 3.0, -3.0])
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
index d779009e7..69eecbd87 100644
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -6,7 +6,7 @@ __all__ = ['diag','diagflat','eye','fliplr','flipud','rot90','tri','triu',
'tril','vander','histogram2d']
from numpy.core.numeric import asanyarray, equal, subtract, arange, \
- zeros, arange, greater_equal, multiply, ones, asarray
+ zeros, greater_equal, multiply, ones, asarray
def fliplr(m):
"""
diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py
index 37c38e94e..6df529609 100644
--- a/numpy/lib/ufunclike.py
+++ b/numpy/lib/ufunclike.py
@@ -5,22 +5,16 @@ storing results in an output array.
__all__ = ['fix', 'isneginf', 'isposinf', 'log2']
import numpy.core.numeric as nx
-from numpy.core.numeric import asarray, empty, isinf, signbit, asanyarray
-import numpy.core.umath as umath
def fix(x, y=None):
""" Round x to nearest integer towards zero.
"""
- x = asanyarray(x)
+ x = nx.asanyarray(x)
if y is None:
- y = nx.floor(x)
- else:
- nx.floor(x, y)
- if x.ndim == 0:
- if (x<0):
- y += 1
- else:
- y[x<0] = y[x<0]+1
+ y = nx.zeros_like(x)
+ y1 = nx.floor(x)
+ y2 = nx.ceil(x)
+ y[...] = nx.where(x >= 0, y1, y2)
return y
def isposinf(x, y=None):
@@ -50,9 +44,9 @@ def isposinf(x, y=None):
"""
if y is None:
- x = asarray(x)
- y = empty(x.shape, dtype=nx.bool_)
- umath.logical_and(isinf(x), ~signbit(x), y)
+ x = nx.asarray(x)
+ y = nx.empty(x.shape, dtype=nx.bool_)
+ nx.logical_and(nx.isinf(x), ~nx.signbit(x), y)
return y
def isneginf(x, y=None):
@@ -82,12 +76,12 @@ def isneginf(x, y=None):
"""
if y is None:
- x = asarray(x)
- y = empty(x.shape, dtype=nx.bool_)
- umath.logical_and(isinf(x), signbit(x), y)
+ x = nx.asarray(x)
+ y = nx.empty(x.shape, dtype=nx.bool_)
+ nx.logical_and(nx.isinf(x), nx.signbit(x), y)
return y
-_log2 = umath.log(2)
+_log2 = nx.log(2)
def log2(x, y=None):
"""
Return the base 2 logarithm.
@@ -116,10 +110,10 @@ def log2(x, y=None):
array([ NaN, 1., 2.])
"""
- x = asanyarray(x)
+ x = nx.asanyarray(x)
if y is None:
- y = umath.log(x)
+ y = nx.log(x)
else:
- umath.log(x, y)
+ nx.log(x, y)
y /= _log2
return y
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 684876591..0b2731005 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -1,12 +1,9 @@
import os
import sys
-import pkgutil
import types
import re
-from numpy.core.numerictypes import obj2sctype, generic, issubclass_, \
- issubsctype, issubdtype
-from numpy.core.multiarray import dtype as _dtype
+from numpy.core.numerictypes import issubclass_, issubsctype, issubdtype
from numpy.core import product, ndarray
__all__ = ['issubclass_', 'get_numpy_include', 'issubsctype',
@@ -682,15 +679,21 @@ def _lookfor_generate_cache(module, import_modules, regenerate):
_all = item.__all__
except AttributeError:
_all = None
+
# import sub-packages
if import_modules and hasattr(item, '__path__'):
- for m in pkgutil.iter_modules(item.__path__):
- if _all is not None and m[1] not in _all:
- continue
- try:
- __import__("%s.%s" % (name, m[1]))
- except ImportError:
- continue
+ for pth in item.__path__:
+ for mod_path in os.listdir(pth):
+ init_py = os.path.join(pth, mod_path, '__init__.py')
+ if not os.path.isfile(init_py):
+ continue
+ if _all is not None and mod_path not in _all:
+ continue
+ try:
+ __import__("%s.%s" % (name, mod_path))
+ except ImportError:
+ continue
+
for n, v in inspect.getmembers(item):
if _all is not None and n not in _all:
continue
diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c
index 026233262..a3ab42466 100644
--- a/numpy/linalg/lapack_litemodule.c
+++ b/numpy/linalg/lapack_litemodule.c
@@ -129,7 +129,7 @@ check_object(PyObject *ob, int t, char *obname,
#define IDATA(p) ((int *) (((PyArrayObject *)p)->data))
static PyObject *
-lapack_lite_dgeev(PyObject *self, PyObject *args)
+lapack_lite_dgeev(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
char jobvl;
@@ -169,7 +169,7 @@ lapack_lite_dgeev(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_dsyevd(PyObject *self, PyObject *args)
+lapack_lite_dsyevd(PyObject *NPY_UNUSED(self), PyObject *args)
{
/* Arguments */
/* ========= */
@@ -251,7 +251,7 @@ lapack_lite_dsyevd(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_zheevd(PyObject *self, PyObject *args)
+lapack_lite_zheevd(PyObject *NPY_UNUSED(self), PyObject *args)
{
/* Arguments */
/* ========= */
@@ -339,7 +339,7 @@ lapack_lite_zheevd(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_dgelsd(PyObject *self, PyObject *args)
+lapack_lite_dgelsd(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int m;
@@ -378,7 +378,7 @@ lapack_lite_dgelsd(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_dgesv(PyObject *self, PyObject *args)
+lapack_lite_dgesv(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int n;
@@ -404,7 +404,7 @@ lapack_lite_dgesv(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_dgesdd(PyObject *self, PyObject *args)
+lapack_lite_dgesdd(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
char jobz;
@@ -470,7 +470,7 @@ lapack_lite_dgesdd(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_dgetrf(PyObject *self, PyObject *args)
+lapack_lite_dgetrf(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int m;
@@ -492,7 +492,7 @@ lapack_lite_dgetrf(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_dpotrf(PyObject *self, PyObject *args)
+lapack_lite_dpotrf(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int n;
@@ -512,7 +512,7 @@ lapack_lite_dpotrf(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_dgeqrf(PyObject *self, PyObject *args)
+lapack_lite_dgeqrf(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int m, n, lwork;
@@ -538,7 +538,7 @@ lapack_lite_dgeqrf(PyObject *self, PyObject *args)
static PyObject *
-lapack_lite_dorgqr(PyObject *self, PyObject *args)
+lapack_lite_dorgqr(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int m, n, k, lwork;
@@ -559,7 +559,7 @@ lapack_lite_dorgqr(PyObject *self, PyObject *args)
static PyObject *
-lapack_lite_zgeev(PyObject *self, PyObject *args)
+lapack_lite_zgeev(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
char jobvl;
@@ -599,7 +599,7 @@ lapack_lite_zgeev(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_zgelsd(PyObject *self, PyObject *args)
+lapack_lite_zgelsd(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int m;
@@ -638,7 +638,7 @@ lapack_lite_zgelsd(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_zgesv(PyObject *self, PyObject *args)
+lapack_lite_zgesv(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int n;
@@ -664,7 +664,7 @@ lapack_lite_zgesv(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_zgesdd(PyObject *self, PyObject *args)
+lapack_lite_zgesdd(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
char jobz;
@@ -706,7 +706,7 @@ lapack_lite_zgesdd(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_zgetrf(PyObject *self, PyObject *args)
+lapack_lite_zgetrf(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int m;
@@ -728,7 +728,7 @@ lapack_lite_zgetrf(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_zpotrf(PyObject *self, PyObject *args)
+lapack_lite_zpotrf(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int n;
@@ -747,7 +747,7 @@ lapack_lite_zpotrf(PyObject *self, PyObject *args)
}
static PyObject *
-lapack_lite_zgeqrf(PyObject *self, PyObject *args)
+lapack_lite_zgeqrf(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int m, n, lwork;
@@ -770,7 +770,7 @@ lapack_lite_zgeqrf(PyObject *self, PyObject *args)
static PyObject *
-lapack_lite_zungqr(PyObject *self, PyObject *args)
+lapack_lite_zungqr(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status__;
int m, n, k, lwork;
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
index f9af033f0..c0bb95004 100644
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -9,16 +9,9 @@ dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetrf,
zgetrf, dpotrf, zpotrf, dgeqrf, zgeqrf, zungqr, dorgqr.
"""
-__all__ = ['matrix_power', 'solve', 'tensorsolve', 'tensorinv',
- 'inv', 'cholesky',
- 'eigvals',
- 'eigvalsh', 'pinv',
- 'det', 'svd',
- 'eig', 'eigh','lstsq', 'norm',
- 'qr',
- 'cond',
- 'LinAlgError'
- ]
+__all__ = ['matrix_power', 'solve', 'tensorsolve', 'tensorinv', 'inv',
+ 'cholesky', 'eigvals', 'eigvalsh', 'pinv', 'det', 'svd',
+ 'eig', 'eigh','lstsq', 'norm', 'qr', 'cond', 'LinAlgError']
from numpy.core import array, asarray, zeros, empty, transpose, \
intc, single, double, csingle, cdouble, inexact, complexfloating, \
@@ -27,7 +20,7 @@ from numpy.core import array, asarray, zeros, empty, transpose, \
isfinite, size
from numpy.lib import triu
from numpy.linalg import lapack_lite
-from numpy.core.defmatrix import matrix_power, matrix
+from numpy.core.defmatrix import matrix_power
fortran_int = intc
diff --git a/numpy/ma/bench.py b/numpy/ma/bench.py
index 19fbe9461..2cc8f6a80 100644
--- a/numpy/ma/bench.py
+++ b/numpy/ma/bench.py
@@ -6,9 +6,9 @@ import timeit
#ip = IPython.ipapi.get()
#from IPython import ipmagic
import numpy
-from numpy import ma
-from numpy.ma import filled
-from numpy.ma.testutils import assert_equal
+#from numpy import ma
+#from numpy.ma import filled
+#from numpy.ma.testutils import assert_equal
#####---------------------------------------------------------------------------
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index a31cbef1b..c71fccfa9 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -57,17 +57,14 @@ __all__ = ['MAError', 'MaskType', 'MaskedArray',
'var', 'where',
'zeros']
-import sys
-import types
import cPickle
import operator
import numpy as np
-from numpy import ndarray, typecodes, amax, amin, iscomplexobj,\
- bool_, complex_, float_, int_, object_, str_
+from numpy import ndarray, amax, amin, iscomplexobj, bool_, complex_, float_,\
+ int_, object_
from numpy import array as narray
-
import numpy.core.umath as umath
import numpy.core.numerictypes as ntypes
from numpy import expand_dims as n_expand_dims
@@ -81,8 +78,17 @@ np.seterr(all='ignore')
-def doc_note(note):
- return "\nNotes\n-----\n%s" % note
+def doc_note(initialdoc, note):
+ if initialdoc is None:
+ return
+ newdoc = """
+ %s
+
+ Notes
+ -----
+ %s
+ """
+ return newdoc % (initialdoc, note)
#####--------------------------------------------------------------------------
#---- --- Exceptions ---
@@ -328,6 +334,7 @@ def get_data(a, subok=True):
if not subok:
return data.view(ndarray)
return data
+
getdata = get_data
def fix_invalid(a, mask=nomask, copy=True, fill_value=None):
@@ -522,7 +529,7 @@ class _MaskedBinaryOperation:
self.__name__ = getattr(mbfunc, "__name__", str(mbfunc))
ufunc_domain[mbfunc] = None
ufunc_fills[mbfunc] = (fillx, filly)
- #
+
def __call__ (self, a, b, *args, **kwargs):
"Execute the call behavior."
m = mask_or(getmask(a), getmask(b))
@@ -539,7 +546,7 @@ class _MaskedBinaryOperation:
elif m:
return masked
return result
- #
+
def reduce(self, target, axis=0, dtype=None):
"""Reduce `target` along the given `axis`."""
if isinstance(target, MaskedArray):
@@ -742,11 +749,20 @@ def make_mask_descr(ndtype):
Each field is set to a bool.
"""
+ # Make sure we do have a dtype
+ if not isinstance(ndtype, np.dtype):
+ ndtype = np.dtype(ndtype)
+ # Do we have some name fields ?
if ndtype.names:
mdescr = [list(_) for _ in ndtype.descr]
for m in mdescr:
m[1] = '|b1'
- return [tuple(_) for _ in mdescr]
+ return np.dtype([tuple(_) for _ in mdescr])
+ # Is this some kind of composite a la (np.float,2)
+ elif ndtype.subdtype:
+ mdescr = list(ndtype.subdtype)
+ mdescr[0] = np.dtype(bool)
+ return np.dtype(tuple(mdescr))
else:
return MaskType
@@ -780,7 +796,7 @@ def is_mask(m):
return m.dtype.type is MaskType
except AttributeError:
return False
-#
+
def make_mask(m, copy=False, shrink=True, flag=None):
"""Return m as a mask, creating a copy if necessary or requested.
@@ -864,13 +880,15 @@ def mask_or (m1, m2, copy=False, shrink=True):
return m1
return make_mask(umath.logical_or(m1, m2), copy=copy, shrink=shrink)
+
#####--------------------------------------------------------------------------
#--- --- Masking functions ---
#####--------------------------------------------------------------------------
-def masked_where(condition, a, copy=True):
- """Return a as an array masked where condition is true.
- Masked values of a or condition are kept.
+def masked_where(condition, a, copy=True):
+ """
+ Return ``a`` as an array masked where ``condition`` is True.
+ Masked values of ``a`` or ``condition`` are kept.
Parameters
----------
@@ -879,12 +897,12 @@ def masked_where(condition, a, copy=True):
a : array_like
Array to mask.
copy : bool
- Whether to return a copy of a (True) or modify a in place.
+ Whether to return a copy of ``a`` (True) or modify ``a`` in place (False).
"""
cond = make_mask(condition)
a = np.array(a, copy=copy, subok=True)
-
+
(cshape, ashape) = (cond.shape, a.shape)
if cshape and cshape != ashape:
raise IndexError("Inconsistant shape between the condition and the input"\
@@ -916,12 +934,12 @@ def masked_less_equal(x, value, copy=True):
def masked_not_equal(x, value, copy=True):
"Shortcut to masked_where, with condition = (x != value)."
- return masked_where((x != value), x, copy=copy)
+ return masked_where(not_equal(x, value), x, copy=copy)
-#
def masked_equal(x, value, copy=True):
- """Shortcut to masked_where, with condition = (x == value). For
- floating point, consider `masked_values(x, value)` instead.
+ """
+ Shortcut to masked_where, with condition = (x == value). For
+ floating point, consider ``masked_values(x, value)`` instead.
"""
# An alternative implementation relies on filling first: probably not needed.
@@ -929,10 +947,11 @@ def masked_equal(x, value, copy=True):
# c = umath.equal(d, value)
# m = mask_or(c, getmask(x))
# return array(d, mask=m, copy=copy)
- return masked_where((x == value), x, copy=copy)
+ return masked_where(equal(x, value), x, copy=copy)
def masked_inside(x, v1, v2, copy=True):
- """Shortcut to masked_where, where condition is True for x inside
+ """
+ Shortcut to masked_where, where ``condition`` is True for x inside
the interval [v1,v2] (v1 <= x <= v2). The boundaries v1 and v2
can be given in either order.
@@ -948,9 +967,10 @@ def masked_inside(x, v1, v2, copy=True):
return masked_where(condition, x, copy=copy)
def masked_outside(x, v1, v2, copy=True):
- """Shortcut to masked_where, where condition is True for x outside
- the interval [v1,v2] (x < v1)|(x > v2). The boundaries v1 and v2
- can be given in either order.
+ """
+ Shortcut to ``masked_where``, where ``condition`` is True for x outside
+ the interval [v1,v2] (x < v1)|(x > v2).
+ The boundaries v1 and v2 can be given in either order.
Notes
-----
@@ -965,10 +985,11 @@ def masked_outside(x, v1, v2, copy=True):
#
def masked_object(x, value, copy=True, shrink=True):
- """Mask the array x where the data are exactly equal to value.
+ """
+ Mask the array ``x`` where the data are exactly equal to value.
This function is suitable only for object arrays: for floating
- point, please use ``masked_values`` instead.
+ point, please use :func:`masked_values` instead.
Parameters
----------
@@ -992,13 +1013,14 @@ def masked_object(x, value, copy=True, shrink=True):
return masked_array(x, mask=mask, copy=copy, fill_value=value)
def masked_values(x, value, rtol=1.e-5, atol=1.e-8, copy=True, shrink=True):
- """Mask the array x where the data are approximately equal in
+ """
+ Mask the array x where the data are approximately equal in
value, i.e.
(abs(x - value) <= atol+rtol*abs(value))
Suitable only for floating points. For integers, please use
- ``masked_equal``. The mask is set to nomask if posible.
+ :func:`masked_equal`. The mask is set to ``nomask`` if posible.
Parameters
----------
@@ -1028,8 +1050,9 @@ def masked_values(x, value, rtol=1.e-5, atol=1.e-8, copy=True, shrink=True):
return masked_array(xnew, mask=mask, copy=copy, fill_value=value)
def masked_invalid(a, copy=True):
- """Mask the array for invalid values (nans or infs). Any
- preexisting mask is conserved.
+ """
+ Mask the array for invalid values (NaNs or infs).
+ Any preexisting mask is conserved.
"""
a = np.array(a, copy=copy, subok=True)
@@ -1048,8 +1071,8 @@ def masked_invalid(a, copy=True):
#---- --- Printing options ---
#####--------------------------------------------------------------------------
class _MaskedPrintOption:
- """Handle the string used to represent missing data in a masked
- array.
+ """
+ Handle the string used to represent missing data in a masked array.
"""
def __init__ (self, display):
@@ -1087,7 +1110,8 @@ masked_print_option = _MaskedPrintOption('--')
#...............................................................................
class _arraymethod(object):
- """Define a wrapper for basic array methods.
+ """
+ Define a wrapper for basic array methods.
Upon call, returns a masked array, where the new _data array is
the output of the corresponding method called on the original
@@ -1170,7 +1194,8 @@ class FlatIter(object):
class MaskedArray(ndarray):
- """Arrays with possibly masked values. Masked values of True
+ """
+ Arrays with possibly masked values. Masked values of True
exclude the corresponding element from any computation.
Construction:
@@ -1218,7 +1243,7 @@ class MaskedArray(ndarray):
def __new__(cls, data=None, mask=nomask, dtype=None, copy=False,
subok=True, ndmin=0, fill_value=None,
- keep_mask=True, hard_mask=False, flag=None, shrink=True,
+ keep_mask=True, hard_mask=None, flag=None, shrink=True,
**options):
"""Create a new masked array from scratch.
@@ -1238,9 +1263,9 @@ class MaskedArray(ndarray):
copy = True
# Careful, cls might not always be MaskedArray...
if not isinstance(data, cls) or not subok:
- _data = _data.view(cls)
+ _data = ndarray.view(_data, cls)
else:
- _data = _data.view(type(data))
+ _data = ndarray.view(_data, type(data))
# Backwards compatibility w/ numpy.core.ma .......
if hasattr(data,'_mask') and not isinstance(data, ndarray):
_data._mask = data._mask
@@ -1322,7 +1347,10 @@ class MaskedArray(ndarray):
if fill_value is not None:
_data._fill_value = _check_fill_value(fill_value, _data.dtype)
# Process extra options ..
- _data._hardmask = hard_mask
+ if hard_mask is None:
+ _data._hardmask = getattr(data, '_hardmask', False)
+ else:
+ _data._hardmask = hard_mask
_data._baseclass = _baseclass
return _data
#
@@ -1355,7 +1383,15 @@ class MaskedArray(ndarray):
"""
# Get main attributes .........
self._update_from(obj)
- self._mask = getattr(obj, '_mask', nomask)
+ if isinstance(obj, ndarray):
+ odtype = obj.dtype
+ if odtype.names:
+ _mask = getattr(obj, '_mask', make_mask_none(obj.shape, odtype))
+ else:
+ _mask = getattr(obj, '_mask', nomask)
+ else:
+ _mask = nomask
+ self._mask = _mask
# Finalize the mask ...........
if self._mask is not nomask:
self._mask.shape = self.shape
@@ -1406,6 +1442,37 @@ class MaskedArray(ndarray):
#....
return result
#.............................................
+ def view(self, dtype=None, type=None):
+ if dtype is None:
+ if type is None:
+ output = ndarray.view(self)
+ else:
+ output = ndarray.view(self, type)
+ elif type is None:
+ try:
+ if issubclass(dtype, ndarray):
+ output = ndarray.view(self, dtype)
+ dtype = None
+ else:
+ output = ndarray.view(self, dtype)
+ except TypeError:
+ output = ndarray.view(self, dtype)
+ else:
+ output = ndarray.view(self, dtype, type)
+ # Should we update the mask ?
+ if (getattr(output,'_mask', nomask) is not nomask):
+ if dtype is None:
+ dtype = output.dtype
+ mdtype = make_mask_descr(dtype)
+
+ output._mask = self._mask.view(mdtype, ndarray)
+ output._mask.shape = output.shape
+ # Make sure to reset the _fill_value if needed
+ if getattr(output, '_fill_value', None):
+ output._fill_value = None
+ return output
+ view.__doc__ = ndarray.view.__doc__
+ #.............................................
def astype(self, newtype):
"""Returns a copy of the array cast to newtype."""
newtype = np.dtype(newtype)
@@ -1434,15 +1501,22 @@ class MaskedArray(ndarray):
# if getmask(indx) is not nomask:
# msg = "Masked arrays must be filled before they can be used as indices!"
# raise IndexError, msg
- dout = ndarray.__getitem__(self.view(ndarray), indx)
+ dout = ndarray.__getitem__(ndarray.view(self,ndarray), indx)
# We could directly use ndarray.__getitem__ on self...
# But then we would have to modify __array_finalize__ to prevent the
# mask of being reshaped if it hasn't been set up properly yet...
# So it's easier to stick to the current version
_mask = self._mask
if not getattr(dout,'ndim', False):
+ # A record ................
+ if isinstance(dout, np.void):
+ mask = _mask[indx]
+ if mask.view((bool,len(mask.dtype))).any():
+ dout = masked_array(dout, mask=mask)
+ else:
+ return dout
# Just a scalar............
- if _mask is not nomask and _mask[indx]:
+ elif _mask is not nomask and _mask[indx]:
return masked
else:
# Force dout to MA ........
@@ -1682,7 +1756,7 @@ class MaskedArray(ndarray):
underlying data.
"""
- return self.view(self._baseclass)
+ return ndarray.view(self, self._baseclass)
_data = property(fget=_get_data)
data = property(fget=_get_data)
@@ -1798,17 +1872,32 @@ class MaskedArray(ndarray):
def compress(self, condition, axis=None, out=None):
- """Return a where condition is True.
- If condition is a MaskedArray, missing values are considered as False.
+ """
+ Return `a` where condition is ``True``.
+ If condition is a `MaskedArray`, missing values are considered as ``False``.
- Returns
- -------
- A MaskedArray object.
+ Parameters
+ ----------
+ condition : var
+ Boolean 1-d array selecting which entries to return. If len(condition)
+ is less than the size of a along the axis, then output is truncated
+ to length of condition array.
+ axis : {None, int}, optional
+ Axis along which the operation must be performed.
+ out : {None, ndarray}, optional
+ Alternative output array in which to place the result. It must have
+ the same shape as the expected output but the type will be cast if
+ necessary.
- Notes
- -----
- Please note the difference with compressed() !
- The output of compress has a mask, the output of compressed does not.
+ Returns
+ -------
+ result : MaskedArray
+ A :class:`MaskedArray` object.
+
+ Warnings
+ --------
+ Please note the difference with :meth:`compressed` !
+ The output of :meth:`compress` has a mask, the output of :meth:`compressed` does not.
"""
# Get the basic components
@@ -1836,7 +1925,15 @@ class MaskedArray(ndarray):
res = self._data
else:
if m.shape == ():
- if m:
+ if m.dtype.names:
+ m = m.view((bool, len(m.dtype)))
+ if m.any():
+ r = np.array(self._data.tolist(), dtype=object)
+ np.putmask(r, m, f)
+ return str(tuple(r))
+ else:
+ return str(self._data)
+ elif m:
return str(f)
else:
return str(self._data)
@@ -1873,34 +1970,56 @@ masked_%(name)s(data = %(data)s,
mask = %(mask)s,
fill_value=%(fill)s)
"""
+ with_mask_flx = """\
+masked_%(name)s(data =
+ %(data)s,
+ mask =
+ %(mask)s,
+ fill_value=%(fill)s,
+ dtype=%(dtype)s)
+"""
+ with_mask1_flx = """\
+masked_%(name)s(data = %(data)s,
+ mask = %(mask)s,
+ fill_value=%(fill)s
+ dtype=%(dtype)s)
+"""
n = len(self.shape)
name = repr(self._data).split('(')[0]
- if n <= 1:
- return with_mask1 % {
- 'name': name,
- 'data': str(self),
- 'mask': str(self._mask),
- 'fill': str(self.fill_value),
- }
- return with_mask % {
- 'name': name,
- 'data': str(self),
- 'mask': str(self._mask),
- 'fill': str(self.fill_value),
- }
+ parameters = dict(name=name, data=str(self), mask=str(self._mask),
+ fill=str(self.fill_value), dtype=str(self.dtype))
+ if self.dtype.names:
+ if n<= 1:
+ return with_mask1_flx % parameters
+ return with_mask_flx % parameters
+ elif n <= 1:
+ return with_mask1 % parameters
+ return with_mask % parameters
#............................................
def __add__(self, other):
"Add other to self, and return a new masked array."
return add(self, other)
#
+ def __radd__(self, other):
+ "Add other to self, and return a new masked array."
+ return add(self, other)
+ #
def __sub__(self, other):
"Subtract other to self, and return a new masked array."
return subtract(self, other)
#
+ def __rsub__(self, other):
+ "Subtract other to self, and return a new masked array."
+ return subtract(other, self)
+ #
def __mul__(self, other):
"Multiply other by self, and return a new masked array."
return multiply(self, other)
#
+ def __rmul__(self, other):
+ "Multiply other by self, and return a new masked array."
+ return multiply(other, self)
+ #
def __div__(self, other):
"Divide other into self, and return a new masked array."
return divide(self, other)
@@ -2019,9 +2138,10 @@ masked_%(name)s(data = %(data)s,
Returns
-------
- A masked array where the mask is True where all data are
- masked. If axis is None, returns either a scalar ot the
- masked singleton if all values are masked.
+ result : MaskedArray
+ A masked array where the mask is True where all data are
+ masked. If axis is None, returns either a scalar ot the
+ masked singleton if all values are masked.
"""
m = self._mask
@@ -2163,7 +2283,7 @@ masked_%(name)s(data = %(data)s,
Check if all of the elements of `a` are true.
- Performs a logical_and over the given axis and returns the result.
+ Performs a :func:`logical_and` over the given axis and returns the result.
Masked values are considered as True during computation.
For convenience, the output array is masked where ALL the values along the
current axis are masked: if the output would have been a scalar and that
@@ -2325,10 +2445,8 @@ masked_%(name)s(data = %(data)s,
def cumsum(self, axis=None, dtype=None, out=None):
- """a.cumsum(axis=None, dtype=None, out=None)
-
+ """
Return the cumulative sum of the elements along the given axis.
-
The cumulative sum is calculated over the flattened array by
default, otherwise over the specified axis.
@@ -2339,19 +2457,23 @@ masked_%(name)s(data = %(data)s,
Parameters
----------
axis : {None, -1, int}, optional
- Axis along which the sum is computed. The default
- (`axis` = None) is to compute over the flattened array.
+ Axis along which the sum is computed. The default (`axis` = None) is to
+ compute over the flattened array. `axis` may be negative, in which case
+ it counts from the last to the first axis.
dtype : {None, dtype}, optional
- Determines the type of the returned array and of the accumulator
- where the elements are summed. If dtype has the value None and
- the type of a is an integer type of precision less than the default
- platform integer, then the default platform integer precision is
- used. Otherwise, the dtype is the same as that of a.
+ Type of the returned array and of the accumulator in which the
+ elements are summed. If `dtype` is not specified, it defaults
+ to the dtype of `a`, unless `a` has an integer dtype with a
+ precision less than that of the default platform integer. In
+ that case, the default platform integer is used.
out : ndarray, optional
Alternative output array in which to place the result. It must
have the same shape and buffer length as the expected output
but the type will be cast if necessary.
- WARNING : The mask is lost if out is not a valid MaskedArray !
+
+ Warning
+ -------
+ The mask is lost if out is not a valid :class:`MaskedArray` !
Returns
-------
@@ -2361,7 +2483,8 @@ masked_%(name)s(data = %(data)s,
Example
-------
- >>> print np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0]).cumsum()
+ >>> marr = np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0])
+ >>> print marr.cumsum()
[0 1 3 -- -- -- 9 16 24 33]
@@ -2382,8 +2505,7 @@ masked_%(name)s(data = %(data)s,
def prod(self, axis=None, dtype=None, out=None):
- """a.prod(axis=None, dtype=None, out=None)
-
+ """
Return the product of the array elements over the given axis.
Masked elements are set to 1 internally for computation.
@@ -2394,8 +2516,8 @@ masked_%(name)s(data = %(data)s,
product is over all the array elements.
dtype : {None, dtype}, optional
Determines the type of the returned array and of the accumulator
- where the elements are multiplied. If dtype has the value None and
- the type of a is an integer type of precision less than the default
+ where the elements are multiplied. If ``dtype`` has the value ``None``
+ and the type of a is an integer type of precision less than the default
platform integer, then the default platform integer precision is
used. Otherwise, the dtype is the same as that of a.
out : {None, array}, optional
@@ -2454,10 +2576,7 @@ masked_%(name)s(data = %(data)s,
def cumprod(self, axis=None, dtype=None, out=None):
"""
- a.cumprod(axis=None, dtype=None, out=None)
-
Return the cumulative product of the elements along the given axis.
-
The cumulative product is taken over the flattened array by
default, otherwise over the specified axis.
@@ -2472,21 +2591,24 @@ masked_%(name)s(data = %(data)s,
(`axis` = None) is to compute over the flattened array.
dtype : {None, dtype}, optional
Determines the type of the returned array and of the accumulator
- where the elements are multiplied. If dtype has the value None and
- the type of a is an integer type of precision less than the default
+ where the elements are multiplied. If ``dtype`` has the value ``None`` and
+ the type of ``a`` is an integer type of precision less than the default
platform integer, then the default platform integer precision is
- used. Otherwise, the dtype is the same as that of a.
+ used. Otherwise, the dtype is the same as that of ``a``.
out : ndarray, optional
Alternative output array in which to place the result. It must
have the same shape and buffer length as the expected output
but the type will be cast if necessary.
- WARNING : The mask is lost if out is not a valid MaskedArray !
+
+ Warning
+ -------
+ The mask is lost if out is not a valid MaskedArray !
Returns
-------
- cumprod : ndarray.
- A new array holding the result is returned unless out is
- specified, in which case a reference to out is returned.
+ cumprod : ndarray
+ A new array holding the result is returned unless out is specified,
+ in which case a reference to out is returned.
Notes
-----
@@ -2505,43 +2627,7 @@ masked_%(name)s(data = %(data)s,
def mean(self, axis=None, dtype=None, out=None):
- """a.mean(axis=None, dtype=None, out=None) -> mean
-
- Returns the average of the array elements. The average is taken over the
- flattened array by default, otherwise over the specified axis.
-
- Parameters
- ----------
- axis : integer
- Axis along which the means are computed. The default is
- to compute the mean of the flattened array.
- dtype : type
- Type to use in computing the means. For arrays of
- integer type the default is float32, for arrays of float types it
- is the same as the array type.
- out : ndarray
- Alternative output array in which to place the result. It must have
- the same shape as the expected output but the type will be cast if
- necessary.
-
- Returns
- -------
- mean : The return type varies, see above.
- A new array holding the result is returned unless out is specified,
- in which case a reference to out is returned.
-
- See Also
- --------
- var : variance
- std : standard deviation
-
- Notes
- -----
- The mean is the sum of the elements along the axis divided by the
- number of elements.
-
-
- """
+ ""
if self._mask is nomask:
result = super(MaskedArray, self).mean(axis=axis, dtype=dtype)
else:
@@ -2557,21 +2643,22 @@ masked_%(name)s(data = %(data)s,
outmask.flat = getattr(result, '_mask', nomask)
return out
return result
+ mean.__doc__ = ndarray.mean.__doc__
def anom(self, axis=None, dtype=None):
- """Return the anomalies (deviations from the average) along
- the given axis.
+ """
+ Return the anomalies (deviations from the average) along the given axis.
- Parameters
- ----------
- axis : int, optional
- Axis along which to perform the operation.
- If None, applies to a flattened version of the array.
- dtype : {dtype}, optional
- Datatype for the intermediary computation. If not
- given, the current dtype is used instead.
+ Parameters
+ ----------
+ axis : int, optional
+ Axis along which to perform the operation.
+ If None, applies to a flattened version of the array.
+ dtype : {dtype}, optional
+ Datatype for the intermediary computation.
+ If not given, the current dtype is used instead.
- """
+ """
m = self.mean(axis, dtype)
if not axis:
return (self - m)
@@ -2579,50 +2666,7 @@ masked_%(name)s(data = %(data)s,
return (self - expand_dims(m,axis))
def var(self, axis=None, dtype=None, out=None, ddof=0):
- """a.var(axis=None, dtype=None, out=None, ddof=0) -> variance
-
- Returns the variance of the array elements, a measure of the spread of a
- distribution. The variance is computed for the flattened array by default,
- otherwise over the specified axis.
-
- Parameters
- ----------
- axis : integer
- Axis along which the variance is computed. The default is to
- compute the variance of the flattened array.
- dtype : data-type
- Type to use in computing the variance. For arrays of integer type
- the default is float32, for arrays of float types it is the same as
- the array type.
- out : ndarray
- Alternative output array in which to place the result. It must have
- the same shape as the expected output but the type will be cast if
- necessary.
- ddof : {0, integer},
- Means Delta Degrees of Freedom. The divisor used in calculation is
- N - ddof.
-
- Returns
- -------
- variance : The return type varies, see above.
- A new array holding the result is returned unless out is specified,
- in which case a reference to out is returned.
-
- See Also
- --------
- std : standard deviation
- mean: average
-
- Notes
- -----
- The variance is the average of the squared deviations from the mean,
- i.e. var = mean(abs(x - x.mean())**2). The mean is computed by
- dividing by N-ddof, where N is the number of elements. The argument
- ddof defaults to zero; for an unbiased estimate supply ddof=1. Note
- that for complex numbers the absolute value is taken before squaring,
- so that the result is always real and nonnegative.
-
- """
+ ""
# Easy case: nomask, business as usual
if self._mask is nomask:
return self._data.var(axis=axis, dtype=dtype, out=out, ddof=ddof)
@@ -2656,52 +2700,11 @@ masked_%(name)s(data = %(data)s,
out.__setmask__(dvar.mask)
return out
return dvar
+ var.__doc__ = np.var.__doc__
- def std(self, axis=None, dtype=None, out=None, ddof=0):
- """a.std(axis=None, dtype=None, out=None, ddof=0)
-
- Returns the standard deviation of the array elements, a measure of the
- spread of a distribution. The standard deviation is computed for the
- flattened array by default, otherwise over the specified axis.
-
- Parameters
- ----------
- axis : integer
- Axis along which the standard deviation is computed. The default is
- to compute the standard deviation of the flattened array.
- dtype : type
- Type to use in computing the standard deviation. For arrays of
- integer type the default is float32, for arrays of float types it
- is the same as the array type.
- out : ndarray
- Alternative output array in which to place the result. It must have
- the same shape as the expected output but the type will be cast if
- necessary.
- ddof : {0, integer}
- Means Delta Degrees of Freedom. The divisor used in calculations
- is N-ddof.
-
- Returns
- -------
- standard deviation : The return type varies, see above.
- A new array holding the result is returned unless out is specified,
- in which case a reference to out is returned.
-
- See Also
- --------
- var : variance
- mean : average
- Notes
- -----
- The standard deviation is the square root of the average of the squared
- deviations from the mean, i.e. var = sqrt(mean(abs(x - x.mean())**2)). The
- computed standard deviation is computed by dividing by the number of
- elements, N-ddof. The option ddof defaults to zero, that is, a biased
- estimate. Note that for complex numbers std takes the absolute value before
- squaring, so that the result is always real and nonnegative.
-
- """
+ def std(self, axis=None, dtype=None, out=None, ddof=0):
+ ""
dvar = self.var(axis=axis,dtype=dtype,out=out, ddof=ddof)
if dvar is not masked:
dvar = sqrt(dvar)
@@ -2709,6 +2712,7 @@ masked_%(name)s(data = %(data)s,
out **= 0.5
return out
return dvar
+ std.__doc__ = np.std.__doc__
#............................................
def round(self, decimals=0, out=None):
@@ -2909,8 +2913,7 @@ masked_%(name)s(data = %(data)s,
#............................................
def min(self, axis=None, out=None, fill_value=None):
- """a.min(axis=None, out=None, fill_value=None)
-
+ """
Return the minimum along a given axis.
Parameters
@@ -2919,11 +2922,11 @@ masked_%(name)s(data = %(data)s,
Axis along which to operate. By default, ``axis`` is None and the
flattened input is used.
out : array_like, optional
- Alternative output array in which to place the result. Must
- be of the same shape and buffer length as the expected output.
+ Alternative output array in which to place the result. Must be of
+ the same shape and buffer length as the expected output.
fill_value : {var}, optional
Value used to fill in the masked values.
- If None, use the output of minimum_fill_value().
+ If None, use the output of `minimum_fill_value`.
Returns
-------
@@ -2931,6 +2934,11 @@ masked_%(name)s(data = %(data)s,
New array holding the result.
If ``out`` was specified, ``out`` is returned.
+ See Also
+ --------
+ minimum_fill_value
+ Returns the minimum filling value for a given datatype.
+
"""
_mask = ndarray.__getattribute__(self, '_mask')
newmask = _mask.all(axis=axis)
@@ -2989,6 +2997,11 @@ masked_%(name)s(data = %(data)s,
New array holding the result.
If ``out`` was specified, ``out`` is returned.
+ See Also
+ --------
+ maximum_fill_value
+ Returns the maximum filling value for a given datatype.
+
"""
_mask = ndarray.__getattribute__(self, '_mask')
newmask = _mask.all(axis=axis)
@@ -3195,6 +3208,14 @@ masked_%(name)s(data = %(data)s,
return (_mareconstruct,
(self.__class__, self._baseclass, (0,), 'b', ),
self.__getstate__())
+ #
+ def __deepcopy__(self, memo={}):
+ from copy import deepcopy
+ copied = MaskedArray.__new__(type(self), self, copy=True)
+ memo[id(self)] = copied
+ for (k,v) in self.__dict__.iteritems():
+ copied.__dict__[k] = deepcopy(v, memo)
+ return copied
def _mareconstruct(subtype, baseclass, baseshape, basetype,):
@@ -3295,6 +3316,8 @@ class _extrema_operation(object):
mb = getmaskarray(b)
m = logical_or.outer(ma, mb)
result = self.ufunc.outer(filled(a), filled(b))
+ if not isinstance(result, MaskedArray):
+ result = result.view(MaskedArray)
result._mask = m
return result
@@ -3538,13 +3561,15 @@ def concatenate(arrays, axis=0):
# ... all of them are True, and then check for dm.any()
# shrink = numpy.logical_or.reduce([getattr(a,'_shrinkmask',True) for a in arrays])
# if shrink and not dm.any():
- if not dm.any():
+ if not dm.dtype.fields and not dm.any():
data._mask = nomask
else:
data._mask = dm.reshape(d.shape)
return data
def count(a, axis = None):
+ if isinstance(a, MaskedArray):
+ return a.count(axis)
return masked_array(a, copy=False).count(axis)
count.__doc__ = MaskedArray.count.__doc__
@@ -3630,7 +3655,8 @@ def putmask(a, mask, values): #, mode='raise'):
return
def transpose(a, axes=None):
- """Return a view of the array with dimensions permuted according to axes,
+ """
+ Return a view of the array with dimensions permuted according to axes,
as a masked array.
If ``axes`` is None (default), the output view has reversed
@@ -3839,7 +3865,6 @@ def round_(a, decimals=0, out=None):
def inner(a, b):
- "maskedarray version of the numpy function."
fa = filled(a, 0)
fb = filled(b, 0)
if len(fa.shape) == 0:
@@ -3847,8 +3872,8 @@ def inner(a, b):
if len(fb.shape) == 0:
fb.shape = (1,)
return np.inner(fa, fb).view(MaskedArray)
-inner.__doc__ = np.inner.__doc__
-inner.__doc__ += doc_note("Masked values are replaced by 0.")
+inner.__doc__ = doc_note(np.inner.__doc__,
+ "Masked values are replaced by 0.")
innerproduct = inner
def outer(a, b):
@@ -3864,8 +3889,8 @@ def outer(a, b):
mb = getmaskarray(b)
m = make_mask(1-np.outer(1-ma, 1-mb), copy=0)
return masked_array(d, mask=m)
-outer.__doc__ = np.outer.__doc__
-outer.__doc__ += doc_note("Masked values are replaced by 0.")
+outer.__doc__ = doc_note(np.outer.__doc__,
+ "Masked values are replaced by 0.")
outerproduct = outer
def allequal (a, b, fill_value=True):
@@ -3935,7 +3960,8 @@ def asanyarray(a, dtype=None):
#---- --- Pickling ---
#####--------------------------------------------------------------------------
def dump(a,F):
- """Pickle the MaskedArray `a` to the file `F`. `F` can either be
+ """
+ Pickle the MaskedArray `a` to the file `F`. `F` can either be
the handle of an exiting file, or a string representing a file
name.
@@ -3945,15 +3971,16 @@ def dump(a,F):
return cPickle.dump(a,F)
def dumps(a):
- """Return a string corresponding to the pickling of the
- MaskedArray.
+ """
+ Return a string corresponding to the pickling of the MaskedArray.
"""
return cPickle.dumps(a)
def load(F):
- """Wrapper around ``cPickle.load`` which accepts either a
- file-like object or a filename.
+ """
+ Wrapper around ``cPickle.load`` which accepts either a file-like object
+ or a filename.
"""
if not hasattr(F, 'readline'):
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index 77b3d1923..ded2d475f 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -95,13 +95,21 @@ def masked_all_like(arr):
#####--------------------------------------------------------------------------
class _fromnxfunction:
"""Defines a wrapper to adapt numpy functions to masked arrays."""
+
def __init__(self, funcname):
self.__name__ = funcname
self.__doc__ = self.getdoc()
+
def getdoc(self):
"Retrieves the __doc__ string from the function."
- return getattr(np, self.__name__).__doc__ +\
- "*Notes*:\n (The function is applied to both the _data and the _mask, if any.)"
+ inidoc = getattr(np, self.__name__).__doc__
+ if inidoc:
+ locdoc = "Notes\n-----\nThe function is applied to both the _data"\
+ " and the _mask, if any."
+ return '\n'.join((inidoc, locdoc))
+ return
+
+
def __call__(self, *args, **params):
func = getattr(np, self.__name__)
if len(args)==1:
@@ -407,7 +415,7 @@ def median(a, axis=None, out=None, overwrite_input=False):
"""
def _median1D(data):
- counts = filled(count(data, axis),0)
+ counts = filled(count(data),0)
(idx, rmd) = divmod(counts, 2)
if rmd:
choice = slice(idx, idx+1)
diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py
index 5e80695e7..a175be2ba 100644
--- a/numpy/ma/mrecords.py
+++ b/numpy/ma/mrecords.py
@@ -16,23 +16,21 @@ By comparison, mrecarrays support masking individual fields.
__author__ = "Pierre GF Gerard-Marchant"
import sys
-import types
import numpy as np
-from numpy import bool_, complex_, float_, int_, str_, object_, dtype, \
- chararray, ndarray, recarray, record, array as narray
+from numpy import bool_, dtype, \
+ ndarray, recarray, array as narray
import numpy.core.numerictypes as ntypes
-from numpy.core.records import find_duplicate, format_parser
from numpy.core.records import fromarrays as recfromarrays, \
- fromrecords as recfromrecords
+ fromrecords as recfromrecords
_byteorderconv = np.core.records._byteorderconv
_typestr = ntypes._typestr
import numpy.ma as ma
from numpy.ma import MAError, MaskedArray, masked, nomask, masked_array,\
- make_mask, mask_or, getdata, getmask, getmaskarray, filled, \
- default_fill_value, masked_print_option
+ getdata, getmaskarray, filled
+
_check_fill_value = ma.core._check_fill_value
import warnings
@@ -108,8 +106,6 @@ class MaskedRecords(MaskedArray, object):
_fill_value : {record}
Filling values for each field.
"""
- _defaultfieldmask = nomask
- _defaulthardmask = False
#............................................
def __new__(cls, shape, dtype=None, buf=None, offset=0, strides=None,
formats=None, names=None, titles=None,
@@ -153,26 +149,26 @@ class MaskedRecords(MaskedArray, object):
return self
#......................................................
def __array_finalize__(self,obj):
- MaskedArray._update_from(self,obj)
# Make sure we have a _fieldmask by default ..
- _fieldmask = getattr(obj, '_fieldmask', None)
- if _fieldmask is None:
+ _mask = getattr(obj, '_mask', None)
+ if _mask is None:
objmask = getattr(obj, '_mask', nomask)
+ _dtype = ndarray.__getattribute__(self,'dtype')
if objmask is nomask:
- _mask = ma.make_mask_none(self.shape, dtype=self.dtype)
+ _mask = ma.make_mask_none(self.shape, dtype=_dtype)
else:
- mdescr = ma.make_mask_descr(self.dtype)
+ mdescr = ma.make_mask_descr(_dtype)
_mask = narray([tuple([m]*len(mdescr)) for m in objmask],
dtype=mdescr).view(recarray)
- else:
- _mask = _fieldmask
# Update some of the attributes
- _locdict = self.__dict__
- if _locdict['_baseclass'] == ndarray:
- _locdict['_baseclass'] = recarray
- _locdict.update(_mask=_mask, _fieldmask=_mask)
+ _dict = self.__dict__
+ _dict.update(_mask=_mask)
+ self._update_from(obj)
+ if _dict['_baseclass'] == ndarray:
+ _dict['_baseclass'] = recarray
return
+
def _getdata(self):
"Returns the data as a recarray."
return ndarray.view(self,recarray)
@@ -203,36 +199,42 @@ class MaskedRecords(MaskedArray, object):
if obj.dtype.fields:
raise NotImplementedError("MaskedRecords is currently limited to"\
"simple records...")
- obj = obj.view(MaskedArray)
- obj._baseclass = ndarray
- obj._isfield = True
# Get some special attributes
- _fill_value = _localdict.get('_fill_value', None)
- _mask = _localdict.get('_mask', None)
# Reset the object's mask
+ hasmasked = False
+ _mask = _localdict.get('_mask', None)
if _mask is not None:
try:
- obj._mask = _mask[attr]
+ _mask = _mask[attr]
except IndexError:
# Couldn't find a mask: use the default (nomask)
pass
- # Reset the field values
- if _fill_value is not None:
- try:
- obj._fill_value = _fill_value[attr]
- except ValueError:
- obj._fill_value = None
+ hasmasked = _mask.view((np.bool,(len(_mask.dtype) or 1))).any()
+ if (obj.shape or hasmasked):
+ obj = obj.view(MaskedArray)
+ obj._baseclass = ndarray
+ obj._isfield = True
+ obj._mask = _mask
+ # Reset the field values
+ _fill_value = _localdict.get('_fill_value', None)
+ if _fill_value is not None:
+ try:
+ obj._fill_value = _fill_value[attr]
+ except ValueError:
+ obj._fill_value = None
+ else:
+ obj = obj.item()
return obj
def __setattr__(self, attr, val):
"Sets the attribute attr to the value val."
# Should we call __setmask__ first ?
- if attr in ['_mask','mask','_fieldmask','fieldmask']:
+ if attr in ['mask', 'fieldmask']:
self.__setmask__(val)
return
# Create a shortcut (so that we don't have to call getattr all the time)
- _localdict = self.__dict__
+ _localdict = object.__getattribute__(self, '__dict__')
# Check whether we're creating a new field
newattr = attr not in _localdict
try:
@@ -241,14 +243,14 @@ class MaskedRecords(MaskedArray, object):
except:
# Not a generic attribute: exit if it's not a valid field
fielddict = ndarray.__getattribute__(self,'dtype').fields or {}
- if attr not in fielddict:
+ optinfo = ndarray.__getattribute__(self,'_optinfo') or {}
+ if not (attr in fielddict or attr in optinfo):
exctype, value = sys.exc_info()[:2]
raise exctype, value
else:
# Get the list of names ......
fielddict = ndarray.__getattribute__(self,'dtype').fields or {}
# Check the attribute
-##### _localdict = self.__dict__
if attr not in fielddict:
return ret
if newattr: # We just added this one
@@ -282,8 +284,8 @@ class MaskedRecords(MaskedArray, object):
"""Returns all the fields sharing the same fieldname base.
The fieldname base is either `_data` or `_mask`."""
_localdict = self.__dict__
- _mask = _localdict['_fieldmask']
- _data = self._data
+ _mask = ndarray.__getattribute__(self,'_mask')
+ _data = ndarray.view(self, _localdict['_baseclass'])
# We want a field ........
if isinstance(indx, basestring):
#!!!: Make sure _sharedmask is True to propagate back to _fieldmask
@@ -333,18 +335,44 @@ The fieldname base is either `_data` or `_mask`."""
reprstr.extend([fmt % (' fill_value', self.fill_value),
' )'])
return str("\n".join(reprstr))
- #......................................................
- def view(self, obj):
+# #......................................................
+ def view(self, dtype=None, type=None):
"""Returns a view of the mrecarray."""
- try:
- if issubclass(obj, ndarray):
- return ndarray.view(self, obj)
- except TypeError:
- pass
- dtype_ = np.dtype(obj)
- if dtype_.fields is None:
- return self.__array__().view(dtype_)
- return ndarray.view(self, obj)
+ # OK, basic copy-paste from MaskedArray.view...
+ if dtype is None:
+ if type is None:
+ output = ndarray.view(self)
+ else:
+ output = ndarray.view(self, type)
+ # Here again...
+ elif type is None:
+ try:
+ if issubclass(dtype, ndarray):
+ output = ndarray.view(self, dtype)
+ dtype = None
+ else:
+ output = ndarray.view(self, dtype)
+ # OK, there's the change
+ except TypeError:
+ dtype = np.dtype(dtype)
+ # we need to revert to MaskedArray, but keeping the possibility
+ # ...of subclasses (eg, TimeSeriesRecords), so we'll force a type
+ # ...set to the first parent
+ if dtype.fields is None:
+ basetype = self.__class__.__bases__[0]
+ output = self.__array__().view(dtype, basetype)
+ output._update_from(self)
+ else:
+ output = ndarray.view(self, dtype)
+ output._fill_value = None
+ else:
+ output = ndarray.view(self, dtype, type)
+ # Update the mask, just like in MaskedArray.view
+ if (getattr(output,'_mask', nomask) is not nomask):
+ mdtype = ma.make_mask_descr(output.dtype)
+ output._mask = self._mask.view(mdtype, ndarray)
+ output._mask.shape = output.shape
+ return output
def harden_mask(self):
"Forces the mask to hard"
@@ -357,7 +385,7 @@ The fieldname base is either `_data` or `_mask`."""
"""Returns a copy of the masked record."""
_localdict = self.__dict__
copied = self._data.copy().view(type(self))
- copied._fieldmask = self._fieldmask.copy()
+ copied._mask = self._mask.copy()
return copied
def tolist(self, fill_value=None):
@@ -373,7 +401,7 @@ The fieldname base is either `_data` or `_mask`."""
if fill_value is not None:
return self.filled(fill_value).tolist()
result = narray(self.filled().tolist(), dtype=object)
- mask = narray(self._fieldmask.tolist())
+ mask = narray(self._mask.tolist())
result[mask] = None
return result.tolist()
#--------------------------------------------
@@ -387,7 +415,7 @@ The fieldname base is either `_data` or `_mask`."""
self.dtype,
self.flags.fnc,
self._data.tostring(),
- self._fieldmask.tostring(),
+ self._mask.tostring(),
self._fill_value,
)
return state
@@ -407,7 +435,7 @@ The fieldname base is either `_data` or `_mask`."""
(ver, shp, typ, isf, raw, msk, flv) = state
ndarray.__setstate__(self, (shp, typ, isf, raw))
mdtype = dtype([(k,bool_) for (k,_) in self.dtype.descr])
- self.__dict__['_fieldmask'].__setstate__((shp, mdtype, isf, msk))
+ self.__dict__['_mask'].__setstate__((shp, mdtype, isf, msk))
self.fill_value = flv
#
def __reduce__(self):
@@ -471,7 +499,7 @@ def fromarrays(arraylist, dtype=None, shape=None, formats=None,
dtype=dtype, shape=shape, formats=formats,
names=names, titles=titles, aligned=aligned,
byteorder=byteorder).view(mrecarray)
- _array._fieldmask.flat = zip(*masklist)
+ _array._mask.flat = zip(*masklist)
if fill_value is not None:
_array.fill_value = fill_value
return _array
@@ -505,13 +533,17 @@ def fromrecords(reclist, dtype=None, shape=None, formats=None, names=None,
mask : {nomask, sequence}, optional.
External mask to apply on the data.
-*Notes*:
+ Notes
+ -----
Lists of tuples should be preferred over lists of lists for faster processing.
"""
# Grab the initial _fieldmask, if needed:
- _fieldmask = getattr(reclist, '_fieldmask', None)
+ _mask = getattr(reclist, '_mask', None)
# Get the list of records.....
- nfields = len(reclist[0])
+ try:
+ nfields = len(reclist[0])
+ except TypeError:
+ nfields = len(reclist[0].dtype)
if isinstance(reclist, ndarray):
# Make sure we don't have some hidden mask
if isinstance(reclist,MaskedArray):
@@ -531,13 +563,13 @@ def fromrecords(reclist, dtype=None, shape=None, formats=None, names=None,
mask = np.array(mask, copy=False)
maskrecordlength = len(mask.dtype)
if maskrecordlength:
- mrec._fieldmask.flat = mask
+ mrec._mask.flat = mask
elif len(mask.shape) == 2:
- mrec._fieldmask.flat = [tuple(m) for m in mask]
+ mrec._mask.flat = [tuple(m) for m in mask]
else:
- mrec._mask = mask
- if _fieldmask is not None:
- mrec._fieldmask[:] = _fieldmask
+ mrec.__setmask__(mask)
+ if _mask is not None:
+ mrec._mask[:] = _mask
return mrec
def _guessvartypes(arr):
@@ -654,7 +686,7 @@ and `newfieldname` as name. If `newfieldname` is None, the new field name is
set to 'fi', where `i` is the number of existing fields.
"""
_data = mrecord._data
- _mask = mrecord._fieldmask
+ _mask = mrecord._mask
if newfieldname is None or newfieldname in reserved_fields:
newfieldname = 'f%i' % len(_data.dtype)
newfield = ma.array(newfield)
@@ -678,5 +710,5 @@ set to 'fi', where `i` is the number of existing fields.
# Add the mask of the new field
newmask.setfield(getmaskarray(newfield),
*newmask.dtype.fields[newfieldname])
- newdata._fieldmask = newmask
+ newdata._mask = newmask
return newdata
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 89abde60a..6fe9d62a2 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -60,15 +60,15 @@ class TestMaskedArray(TestCase):
x = masked_array(0, mask=False)
assert_equal(str(x), '0')
x = array(0, mask=1)
- assert(x.filled().dtype is x._data.dtype)
+ self.failUnless(x.filled().dtype is x._data.dtype)
def test_basic1d(self):
"Test of basic array creation and properties in 1 dimension."
(x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d
- assert(not isMaskedArray(x))
- assert(isMaskedArray(xm))
- assert((xm-ym).filled(0).any())
+ self.failUnless(not isMaskedArray(x))
+ self.failUnless(isMaskedArray(xm))
+ self.failUnless((xm-ym).filled(0).any())
fail_if_equal(xm.mask.astype(int_), ym.mask.astype(int_))
s = x.shape
assert_equal(np.shape(xm), s)
@@ -92,8 +92,8 @@ class TestMaskedArray(TestCase):
ym.shape = s
xf.shape = s
#
- assert(not isMaskedArray(x))
- assert(isMaskedArray(xm))
+ self.failUnless(not isMaskedArray(x))
+ self.failUnless(isMaskedArray(xm))
assert_equal(shape(xm), s)
assert_equal(xm.shape, s)
assert_equal( xm.size , reduce(lambda x,y:x*y, s))
@@ -132,6 +132,15 @@ class TestMaskedArray(TestCase):
assert_array_equal(z,[1,1,0,0])
assert_array_equal(z.mask,[False,True,False,False])
+ def test_concatenate_flexible(self):
+ "Tests the concatenation on flexible arrays."
+ data = masked_array(zip(np.random.rand(10),
+ np.arange(10)),
+ dtype=[('a',float),('b',int)])
+ #
+ test = concatenate([data[:5], data[5:]])
+ assert_equal_records(test, data)
+
def test_creation_ndmin(self):
"Check the use of ndmin"
x = array([1,2,3],mask=[1,0,0], ndmin=2)
@@ -168,15 +177,17 @@ class TestMaskedArray(TestCase):
x.mask = nomask
data = array((x,x[::-1]))
assert_equal(data, [[0,1,2,3,4],[4,3,2,1,0]])
- assert(data.mask is nomask)
+ self.failUnless(data.mask is nomask)
def test_asarray(self):
(x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d
xm.fill_value = -9999
+ xm._hardmask = True
xmm = asarray(xm)
assert_equal(xmm._data, xm._data)
assert_equal(xmm._mask, xm._mask)
assert_equal(xmm.fill_value, xm.fill_value)
+ assert_equal(xmm._hardmask, xm._hardmask)
def test_fix_invalid(self):
"Checks fix_invalid."
@@ -189,8 +200,8 @@ class TestMaskedArray(TestCase):
"Test of masked element"
x = arange(6)
x[1] = masked
- assert(str(masked) == '--')
- assert(x[1] is masked)
+ self.failUnless(str(masked) == '--')
+ self.failUnless(x[1] is masked)
assert_equal(filled(x[1], 0), 0)
# don't know why these should raise an exception...
#self.failUnlessRaises(Exception, lambda x,y: x+y, masked, masked)
@@ -204,12 +215,12 @@ class TestMaskedArray(TestCase):
x = (1,2,3,4,5)
a[0] = x
assert_equal(a[0], x)
- assert(a[0] is x)
+ self.failUnless(a[0] is x)
#
import datetime
dt = datetime.datetime.now()
a[0] = dt
- assert(a[0] is dt)
+ self.failUnless(a[0] is dt)
def test_indexing(self):
@@ -268,39 +279,39 @@ class TestMaskedArray(TestCase):
n = [0,0,1,0,0]
m = make_mask(n)
m2 = make_mask(m)
- assert(m is m2)
+ self.failUnless(m is m2)
m3 = make_mask(m, copy=1)
- assert(m is not m3)
+ self.failUnless(m is not m3)
warnings.simplefilter('ignore', DeprecationWarning)
x1 = np.arange(5)
y1 = array(x1, mask=m)
- #assert( y1._data is x1)
+ #self.failUnless( y1._data is x1)
assert_equal(y1._data.__array_interface__, x1.__array_interface__)
- assert( allequal(x1,y1.raw_data()))
- #assert( y1.mask is m)
+ self.failUnless( allequal(x1,y1.raw_data()))
+ #self.failUnless( y1.mask is m)
assert_equal(y1._mask.__array_interface__, m.__array_interface__)
warnings.simplefilter('default', DeprecationWarning)
y1a = array(y1)
- #assert( y1a.raw_data() is y1.raw_data())
- assert( y1a._data.__array_interface__ == y1._data.__array_interface__)
- assert( y1a.mask is y1.mask)
+ #self.failUnless( y1a.raw_data() is y1.raw_data())
+ self.failUnless( y1a._data.__array_interface__ == y1._data.__array_interface__)
+ self.failUnless( y1a.mask is y1.mask)
y2 = array(x1, mask=m)
- #assert( y2.raw_data() is x1)
- assert (y2._data.__array_interface__ == x1.__array_interface__)
- #assert( y2.mask is m)
- assert (y2._mask.__array_interface__ == m.__array_interface__)
- assert( y2[2] is masked)
+ #self.failUnless( y2.raw_data() is x1)
+ self.failUnless(y2._data.__array_interface__ == x1.__array_interface__)
+ #self.failUnless( y2.mask is m)
+ self.failUnless(y2._mask.__array_interface__ == m.__array_interface__)
+ self.failUnless( y2[2] is masked)
y2[2] = 9
- assert( y2[2] is not masked)
- #assert( y2.mask is not m)
- assert (y2._mask.__array_interface__ != m.__array_interface__)
- assert( allequal(y2.mask, 0))
+ self.failUnless( y2[2] is not masked)
+ #self.failUnless( y2.mask is not m)
+ self.failUnless(y2._mask.__array_interface__ != m.__array_interface__)
+ self.failUnless( allequal(y2.mask, 0))
y3 = array(x1*1.0, mask=m)
- assert(filled(y3).dtype is (x1*1.0).dtype)
+ self.failUnless(filled(y3).dtype is (x1*1.0).dtype)
x4 = arange(4)
x4[2] = masked
@@ -330,6 +341,24 @@ class TestMaskedArray(TestCase):
assert_not_equal(y._mask.ctypes.data, x._mask.ctypes.data)
+ def test_deepcopy(self):
+ from copy import deepcopy
+ a = array([0,1,2], mask=[False,True,False])
+ copied = deepcopy(a)
+ assert_equal(copied.mask, a.mask)
+ assert_not_equal(id(a._mask), id(copied._mask))
+ #
+ copied[1] = 1
+ assert_equal(copied.mask,[0,0,0])
+ assert_equal(a.mask, [0,1,0])
+ #
+ copied = deepcopy(a)
+ assert_equal(copied.mask, a.mask)
+ copied.mask[1] = False
+ assert_equal(copied.mask,[0,0,0])
+ assert_equal(a.mask, [0,1,0])
+
+
def test_pickling(self):
"Tests pickling"
import cPickle
@@ -345,7 +374,7 @@ class TestMaskedArray(TestCase):
a_pickled = cPickle.loads(a.dumps())
assert_equal(a_pickled._mask, a._mask)
assert_equal(a_pickled, a)
- assert(isinstance(a_pickled._data,np.matrix))
+ self.failUnless(isinstance(a_pickled._data,np.matrix))
def test_single_element_subscript(self):
@@ -372,7 +401,7 @@ class TestMaskedArray(TestCase):
a = array([1,2,3],mask=[1,0,0])
self.assertRaises(TypeError, lambda:float(a))
assert_equal(float(a[-1]), 3.)
- assert(np.isnan(float(a[0])))
+ self.failUnless(np.isnan(float(a[0])))
self.assertRaises(TypeError, int, a)
assert_equal(int(a[-1]), 3)
self.assertRaises(MAError, lambda:int(a[0]))
@@ -546,11 +575,11 @@ class TestMaskedArrayArithmetic(TestCase):
"Tests some scalar arithmetics on MaskedArrays."
# Masked singleton should remain masked no matter what
xm = array(0, mask=1)
- assert((1/array(0)).mask)
- assert((1 + xm).mask)
- assert((-xm).mask)
- assert(maximum(xm, xm).mask)
- assert(minimum(xm, xm).mask)
+ self.failUnless((1/array(0)).mask)
+ self.failUnless((1 + xm).mask)
+ self.failUnless((-xm).mask)
+ self.failUnless(maximum(xm, xm).mask)
+ self.failUnless(minimum(xm, xm).mask)
def test_arithmetic_with_masked_singleton(self):
"Checks that there's no collapsing to masked"
@@ -604,7 +633,7 @@ class TestMaskedArrayArithmetic(TestCase):
def test_count_func (self):
"Tests count"
ott = array([0.,1.,2.,3.], mask=[1,0,0,0])
- assert( isinstance(count(ott), int))
+ self.failUnless( isinstance(count(ott), int))
assert_equal(3, count(ott))
assert_equal(1, count(1))
assert_equal(0, array(1,mask=[1]))
@@ -638,6 +667,23 @@ class TestMaskedArrayArithmetic(TestCase):
x[-1,-1] = masked
assert_equal(maximum(x), 2)
+ def test_minimummaximum_func(self):
+ a = np.ones((2,2))
+ aminimum = minimum(a,a)
+ self.failUnless(isinstance(aminimum, MaskedArray))
+ assert_equal(aminimum, np.minimum(a,a))
+ #
+ aminimum = minimum.outer(a,a)
+ self.failUnless(isinstance(aminimum, MaskedArray))
+ assert_equal(aminimum, np.minimum.outer(a,a))
+ #
+ amaximum = maximum(a,a)
+ self.failUnless(isinstance(amaximum, MaskedArray))
+ assert_equal(amaximum, np.maximum(a,a))
+ #
+ amaximum = maximum.outer(a,a)
+ self.failUnless(isinstance(amaximum, MaskedArray))
+ assert_equal(amaximum, np.maximum.outer(a,a))
def test_minmax_funcs_with_output(self):
"Tests the min/max functions with explicit outputs"
@@ -651,11 +697,11 @@ class TestMaskedArrayArithmetic(TestCase):
# Use the np version
nout = np.empty((4,), dtype=int)
result = npfunc(xm,axis=0,out=nout)
- assert(result is nout)
+ self.failUnless(result is nout)
# Use the ma version
nout.fill(-999)
result = mafunc(xm,axis=0,out=nout)
- assert(result is nout)
+ self.failUnless(result is nout)
def test_minmax_methods(self):
@@ -663,22 +709,22 @@ class TestMaskedArrayArithmetic(TestCase):
(_, _, _, _, _, xm, _, _, _, _) = self.d
xm.shape = (xm.size,)
assert_equal(xm.max(), 10)
- assert(xm[0].max() is masked)
- assert(xm[0].max(0) is masked)
- assert(xm[0].max(-1) is masked)
+ self.failUnless(xm[0].max() is masked)
+ self.failUnless(xm[0].max(0) is masked)
+ self.failUnless(xm[0].max(-1) is masked)
assert_equal(xm.min(), -10.)
- assert(xm[0].min() is masked)
- assert(xm[0].min(0) is masked)
- assert(xm[0].min(-1) is masked)
+ self.failUnless(xm[0].min() is masked)
+ self.failUnless(xm[0].min(0) is masked)
+ self.failUnless(xm[0].min(-1) is masked)
assert_equal(xm.ptp(), 20.)
- assert(xm[0].ptp() is masked)
- assert(xm[0].ptp(0) is masked)
- assert(xm[0].ptp(-1) is masked)
+ self.failUnless(xm[0].ptp() is masked)
+ self.failUnless(xm[0].ptp(0) is masked)
+ self.failUnless(xm[0].ptp(-1) is masked)
#
x = array([1,2,3], mask=True)
- assert(x.min() is masked)
- assert(x.max() is masked)
- assert(x.ptp() is masked)
+ self.failUnless(x.min() is masked)
+ self.failUnless(x.max() is masked)
+ self.failUnless(x.ptp() is masked)
#........................
def test_addsumprod (self):
"Tests add, sum, product."
@@ -751,13 +797,13 @@ class TestMaskedArrayArithmetic(TestCase):
output.fill(-9999)
result = npfunc(xm, axis=0,out=output)
# ... the result should be the given output
- assert(result is output)
+ self.failUnless(result is output)
assert_equal(result, xmmeth(axis=0, out=output))
#
output = empty(4, dtype=int)
result = xmmeth(axis=0, out=output)
- assert(result is output)
- assert(output[0] is masked)
+ self.failUnless(result is output)
+ self.failUnless(output[0] is masked)
#------------------------------------------------------------------------------
@@ -791,8 +837,8 @@ class TestMaskedArrayAttributes(TestCase):
assert_equal(xs._data, [0,10,2,3,40])
#assert_equal(xh.mask.ctypes._data, m.ctypes._data)
assert_equal(xs.mask, [0,0,0,1,0])
- assert(xh._hardmask)
- assert(not xs._hardmask)
+ self.failUnless(xh._hardmask)
+ self.failUnless(not xs._hardmask)
xh[1:4] = [10,20,30]
xs[1:4] = [10,20,30]
assert_equal(xh._data, [0,10,20,3,4])
@@ -885,39 +931,39 @@ class TestFillingValues(TestCase):
ndtype = [('a',int),('b',float),('c',"|S3")]
# A check on a list should return a single record
fval = _check_fill_value([-999,-999.9,"???"], ndtype)
- assert(isinstance(fval,ndarray))
+ self.failUnless(isinstance(fval,ndarray))
assert_equal(fval.item(), [-999,-999.9,"???"])
# A check on Non should output the defaults
fval = _check_fill_value(None, ndtype)
- assert(isinstance(fval,ndarray))
+ self.failUnless(isinstance(fval,ndarray))
assert_equal(fval.item(), [default_fill_value(0),
default_fill_value(0.),
default_fill_value("0")])
#.....Using a flexible type as fill_value should work
fill_val = np.array((-999,-999.9,"???"),dtype=ndtype)
fval = _check_fill_value(fill_val, ndtype)
- assert(isinstance(fval,ndarray))
+ self.failUnless(isinstance(fval,ndarray))
assert_equal(fval.item(), [-999,-999.9,"???"])
#.....Using a flexible type w/ a different type shouldn't matter
fill_val = np.array((-999,-999.9,"???"),
dtype=[("A",int),("B",float),("C","|S3")])
fval = _check_fill_value(fill_val, ndtype)
- assert(isinstance(fval,ndarray))
+ self.failUnless(isinstance(fval,ndarray))
assert_equal(fval.item(), [-999,-999.9,"???"])
#.....Using an object-array shouldn't matter either
fill_value = np.array((-999,-999.9,"???"), dtype=object)
fval = _check_fill_value(fill_val, ndtype)
- assert(isinstance(fval,ndarray))
+ self.failUnless(isinstance(fval,ndarray))
assert_equal(fval.item(), [-999,-999.9,"???"])
#
fill_value = np.array((-999,-999.9,"???"))
fval = _check_fill_value(fill_val, ndtype)
- assert(isinstance(fval,ndarray))
+ self.failUnless(isinstance(fval,ndarray))
assert_equal(fval.item(), [-999,-999.9,"???"])
#.....One-field-only flexible type should work as well
ndtype = [("a",int)]
fval = _check_fill_value(-999, ndtype)
- assert(isinstance(fval,ndarray))
+ self.failUnless(isinstance(fval,ndarray))
assert_equal(fval.item(), (-999,))
@@ -1041,8 +1087,8 @@ class TestUfuncs(TestCase):
def test_reduce(self):
"Tests reduce on MaskedArrays."
a = self.d[0]
- assert(not alltrue(a,axis=0))
- assert(sometrue(a,axis=0))
+ self.failUnless(not alltrue(a,axis=0))
+ self.failUnless(sometrue(a,axis=0))
assert_equal(sum(a[:3],axis=0), 0)
assert_equal(product(a,axis=0), 0)
assert_equal(add.reduce(a), pi)
@@ -1055,8 +1101,8 @@ class TestUfuncs(TestCase):
assert_equal(amask.min(), 5)
assert_equal(amask.max(0), a.max(0))
assert_equal(amask.min(0), [5,6,7,8])
- assert(amask.max(1)[0].mask)
- assert(amask.min(1)[0].mask)
+ self.failUnless(amask.max(1)[0].mask)
+ self.failUnless(amask.min(1)[0].mask)
#------------------------------------------------------------------------------
@@ -1309,18 +1355,18 @@ class TestMaskedArrayMethods(TestCase):
store = empty(1, dtype=bool)
full = array([1,2,3], mask=True)
#
- assert(full.all() is masked)
+ self.failUnless(full.all() is masked)
full.all(out=store)
- assert(store)
- assert(store._mask, True)
- assert(store is not masked)
+ self.failUnless(store)
+ self.failUnless(store._mask, True)
+ self.failUnless(store is not masked)
#
store = empty(1, dtype=bool)
- assert(full.any() is masked)
+ self.failUnless(full.any() is masked)
full.any(out=store)
- assert(not store)
- assert(store._mask, True)
- assert(store is not masked)
+ self.failUnless(not store)
+ self.failUnless(store._mask, True)
+ self.failUnless(store is not masked)
def test_argmax_argmin(self):
@@ -1408,7 +1454,7 @@ class TestMaskedArrayMethods(TestCase):
a = array(np.matrix([1,2,3,4]), mask=[0,0,0,0])
b = a.compressed()
assert_equal(b,a)
- assert(isinstance(b,np.matrix))
+ self.failUnless(isinstance(b,np.matrix))
a[0,0] = masked
b = a.compressed()
assert_equal(b, [[2,3,4]])
@@ -1436,12 +1482,12 @@ class TestMaskedArrayMethods(TestCase):
n = [0,0,0,1,1]
m = make_mask(n)
x = array(d, mask = m)
- assert( x[3] is masked)
- assert( x[4] is masked)
+ self.failUnless( x[3] is masked)
+ self.failUnless( x[4] is masked)
x[[1,4]] = [10,40]
-# assert( x.mask is not m)
- assert( x[3] is masked)
- assert( x[4] is not masked)
+# self.failUnless( x.mask is not m)
+ self.failUnless( x[3] is masked)
+ self.failUnless( x[4] is not masked)
assert_equal(x, [0,10,2,-1,40])
#
x = masked_array(arange(10), mask=[1,0,0,0,0]*2)
@@ -1561,7 +1607,7 @@ class TestMaskedArrayMethods(TestCase):
#
x = [1,4,2,3]
sortedx = sort(x)
- assert(not isinstance(sorted, MaskedArray))
+ self.failUnless(not isinstance(sorted, MaskedArray))
#
x = array([0,1,-1,-2,2], mask=nomask, dtype=np.int8)
sortedx = sort(x, endwith=False)
@@ -1621,7 +1667,7 @@ class TestMaskedArrayMethods(TestCase):
assert_equal(data.squeeze(), [1,2,3])
assert_equal(data.squeeze()._mask, [1,1,1])
data = masked_array([[1]], mask=True)
- assert(data.squeeze() is masked)
+ self.failUnless(data.squeeze() is masked)
def test_swapaxes(self):
@@ -1668,8 +1714,8 @@ class TestMaskedArrayMethods(TestCase):
x = array(np.arange(12))
x[[1,-2]] = masked
xlist = x.tolist()
- assert(xlist[1] is None)
- assert(xlist[-2] is None)
+ self.failUnless(xlist[1] is None)
+ self.failUnless(xlist[-2] is None)
#
x.shape = (3,4)
xlist = x.tolist()
@@ -1784,12 +1830,12 @@ class TestMaskArrayMathMethod(TestCase):
output.fill(-9999)
result = npfunc(xm, axis=0,out=output)
# ... the result should be the given output
- assert(result is output)
+ self.failUnless(result is output)
assert_equal(result, xmmeth(axis=0, out=output))
#
output = empty((3,4), dtype=int)
result = xmmeth(axis=0, out=output)
- assert(result is output)
+ self.failUnless(result is output)
def test_ptp(self):
@@ -1844,31 +1890,31 @@ class TestMaskArrayMathMethod(TestCase):
x = array(arange(10), mask=True)
for methodname in ('var', 'std'):
method = getattr(x,methodname)
- assert(method() is masked)
- assert(method(0) is masked)
- assert(method(-1) is masked)
+ self.failUnless(method() is masked)
+ self.failUnless(method(0) is masked)
+ self.failUnless(method(-1) is masked)
# Using a masked array as explicit output
_ = method(out=mout)
- assert(mout is not masked)
+ self.failUnless(mout is not masked)
assert_equal(mout.mask, True)
# Using a ndarray as explicit output
_ = method(out=nout)
- assert(np.isnan(nout))
+ self.failUnless(np.isnan(nout))
#
x = array(arange(10), mask=True)
x[-1] = 9
for methodname in ('var', 'std'):
method = getattr(x,methodname)
- assert(method(ddof=1) is masked)
- assert(method(0, ddof=1) is masked)
- assert(method(-1, ddof=1) is masked)
+ self.failUnless(method(ddof=1) is masked)
+ self.failUnless(method(0, ddof=1) is masked)
+ self.failUnless(method(-1, ddof=1) is masked)
# Using a masked array as explicit output
_ = method(out=mout, ddof=1)
- assert(mout is not masked)
+ self.failUnless(mout is not masked)
assert_equal(mout.mask, True)
# Using a ndarray as explicit output
_ = method(out=nout, ddof=1)
- assert(np.isnan(nout))
+ self.failUnless(np.isnan(nout))
#------------------------------------------------------------------------------
@@ -1942,13 +1988,21 @@ class TestMaskedArrayFunctions(TestCase):
xm.set_fill_value(1.e+20)
self.info = (xm, ym)
- #
def test_masked_where_bool(self):
x = [1,2]
y = masked_where(False,x)
assert_equal(y,[1,2])
assert_equal(y[1],2)
+ def test_masked_equal_wlist(self):
+ x = [1, 2, 3]
+ mx = masked_equal(x, 3)
+ assert_equal(mx, x)
+ assert_equal(mx._mask, [0,0,1])
+ mx = masked_not_equal(x, 3)
+ assert_equal(mx, x)
+ assert_equal(mx._mask, [1,1,0])
+
def test_masked_where_condition(self):
"Tests masking functions."
x = array([1.,2.,3.,4.,5.])
@@ -1978,7 +2032,7 @@ class TestMaskedArrayFunctions(TestCase):
else:
raise AssertionError("Should have failed...")
test = masked_equal(a,1)
- assert(test.mask, [0,1,0,0,0,0,0,0,0,0])
+ assert_equal(test.mask, [0,1,0,0,0,0,0,0,0,0])
def test_masked_otherfunctions(self):
@@ -2024,24 +2078,24 @@ class TestMaskedArrayFunctions(TestCase):
output.fill(-9999)
result = np.round(xm, decimals=2,out=output)
# ... the result should be the given output
- assert(result is output)
+ self.failUnless(result is output)
assert_equal(result, xm.round(decimals=2, out=output))
#
output = empty((3,4), dtype=float)
result = xm.round(decimals=2, out=output)
- assert(result is output)
+ self.failUnless(result is output)
def test_identity(self):
a = identity(5)
- assert(isinstance(a, MaskedArray))
+ self.failUnless(isinstance(a, MaskedArray))
assert_equal(a, np.identity(5))
def test_power(self):
x = -1.1
assert_almost_equal(power(x,2.), 1.21)
- assert(power(x,masked) is masked)
+ self.failUnless(power(x,masked) is masked)
x = array([-1.1,-1.1,1.1,1.1,0.])
b = array([0.5,2.,0.5,2.,-1.], mask=[0,0,0,0,1])
y = power(x,b)
@@ -2174,7 +2228,7 @@ class TestMaskedArrayFunctions(TestCase):
store = empty(4, dtype=int)
chosen = choose([2, 3, 1, 0], choices, out=store)
assert_equal(store, array([20, 31, 12, 3]))
- assert(store is chosen)
+ self.failUnless(store is chosen)
# Check with some masked indices + out
store = empty(4, dtype=int)
indices_ = array([2, 3, 1, 0], mask=[1,0,0,1])
@@ -2196,25 +2250,40 @@ class TestMaskedArrayFunctions(TestCase):
# Try the default
b = a.reshape((5,2))
assert_equal(b.shape, (5,2))
- assert(b.flags['C'])
+ self.failUnless(b.flags['C'])
# Try w/ arguments as list instead of tuple
b = a.reshape(5,2)
assert_equal(b.shape, (5,2))
- assert(b.flags['C'])
+ self.failUnless(b.flags['C'])
# Try w/ order
b = a.reshape((5,2), order='F')
assert_equal(b.shape, (5,2))
- assert(b.flags['F'])
+ self.failUnless(b.flags['F'])
# Try w/ order
b = a.reshape(5,2, order='F')
assert_equal(b.shape, (5,2))
- assert(b.flags['F'])
+ self.failUnless(b.flags['F'])
#
c = np.reshape(a, (2,5))
- assert(isinstance(c, MaskedArray))
+ self.failUnless(isinstance(c, MaskedArray))
assert_equal(c.shape, (2,5))
- assert(c[0,0] is masked)
- assert(c.flags['C'])
+ self.failUnless(c[0,0] is masked)
+ self.failUnless(c.flags['C'])
+
+
+ def test_make_mask_descr(self):
+ "Test make_mask_descr"
+ ntype = [('a',np.float), ('b',np.float)]
+ test = make_mask_descr(ntype)
+ assert_equal(test, [('a',np.bool),('b',np.bool)])
+ #
+ ntype = (np.float, 2)
+ test = make_mask_descr(ntype)
+ assert_equal(test, (np.bool,2))
+ #
+ ntype = np.float
+ test = make_mask_descr(ntype)
+ assert_equal(test, np.dtype(np.bool))
#------------------------------------------------------------------------------
@@ -2299,7 +2368,123 @@ class TestMaskedFields(TestCase):
assert_equal(getmaskarray(test),
np.array([(1, 1) , (1, 1), (1, 1)],
dtype=[('a', '|b1'), ('b', '|b1')]))
-
+ #
+ def test_view(self):
+ "Test view w/ flexible dtype"
+ iterator = zip(np.arange(10), np.random.rand(10))
+ data = np.array(iterator)
+ a = array(iterator, dtype=[('a',float),('b',float)])
+ a.mask[0] = (1,0)
+ controlmask = np.array([1]+19*[0], dtype=bool)
+ # Transform globally to simple dtype
+ test = a.view(float)
+ assert_equal(test, data.ravel())
+ assert_equal(test.mask, controlmask)
+ # Transform globally to dty
+ test = a.view((float,2))
+ assert_equal(test, data)
+ assert_equal(test.mask, controlmask.reshape(-1,2))
+ #
+ test = a.view((float,2), np.matrix)
+ assert_equal(test, data)
+ self.failUnless(isinstance(test, np.matrix))
+ #
+ def test_getitem(self):
+ ndtype = [('a',float), ('b',float)]
+ a = array(zip(np.random.rand(10),np.arange(10)), dtype=ndtype)
+ a.mask = np.array(zip([0,0,0,0,0,0,0,0,1,1],
+ [1,0,0,0,0,0,0,0,1,0]),
+ dtype=[('a',bool),('b',bool)])
+ # No mask
+ self.failUnless(isinstance(a[1], np.void))
+ # One element masked
+ self.failUnless(isinstance(a[0], MaskedArray))
+ assert_equal_records(a[0]._data, a._data[0])
+ assert_equal_records(a[0]._mask, a._mask[0])
+ # All element masked
+ self.failUnless(isinstance(a[-2], MaskedArray))
+ assert_equal_records(a[-2]._data, a._data[-2])
+ assert_equal_records(a[-2]._mask, a._mask[-2])
+
+
+class TestMaskedView(TestCase):
+ #
+ def setUp(self):
+ iterator = zip(np.arange(10), np.random.rand(10))
+ data = np.array(iterator)
+ a = array(iterator, dtype=[('a',float),('b',float)])
+ a.mask[0] = (1,0)
+ controlmask = np.array([1]+19*[0], dtype=bool)
+ self.data = (data, a, controlmask)
+ #
+ def test_view_to_nothing(self):
+ (data, a, controlmask) = self.data
+ test = a.view()
+ self.failUnless(isinstance(test, MaskedArray))
+ assert_equal(test._data, a._data)
+ assert_equal(test._mask, a._mask)
+
+ #
+ def test_view_to_type(self):
+ (data, a, controlmask) = self.data
+ test = a.view(np.ndarray)
+ self.failUnless(not isinstance(test, MaskedArray))
+ assert_equal(test, a._data)
+ assert_equal_records(test, data.view(a.dtype).squeeze())
+ #
+ def test_view_to_simple_dtype(self):
+ (data, a, controlmask) = self.data
+ # View globally
+ test = a.view(float)
+ self.failUnless(isinstance(test, MaskedArray))
+ assert_equal(test, data.ravel())
+ assert_equal(test.mask, controlmask)
+ #
+ def test_view_to_flexible_dtype(self):
+ (data, a, controlmask) = self.data
+ #
+ test = a.view([('A',float),('B',float)])
+ assert_equal(test.mask.dtype.names, ('A', 'B'))
+ assert_equal(test['A'], a['a'])
+ assert_equal(test['B'], a['b'])
+ #
+ test = a[0].view([('A',float),('B',float)])
+ self.failUnless(isinstance(test, MaskedArray))
+ assert_equal(test.mask.dtype.names, ('A', 'B'))
+ assert_equal(test['A'], a['a'][0])
+ assert_equal(test['B'], a['b'][0])
+ #
+ test = a[-1].view([('A',float),('B',float)])
+ self.failUnless(not isinstance(test, MaskedArray))
+ assert_equal(test.dtype.names, ('A', 'B'))
+ assert_equal(test['A'], a['a'][-1])
+ assert_equal(test['B'], a['b'][-1])
+
+ #
+ def test_view_to_subdtype(self):
+ (data, a, controlmask) = self.data
+ # View globally
+ test = a.view((float,2))
+ self.failUnless(isinstance(test, MaskedArray))
+ assert_equal(test, data)
+ assert_equal(test.mask, controlmask.reshape(-1,2))
+ # View on 1 masked element
+ test = a[0].view((float,2))
+ self.failUnless(isinstance(test, MaskedArray))
+ assert_equal(test, data[0])
+ assert_equal(test.mask, (1,0))
+ # View on 1 unmasked element
+ test = a[-1].view((float,2))
+ self.failUnless(not isinstance(test, MaskedArray))
+ assert_equal(test, data[-1])
+ #
+ def test_view_to_dtype_and_type(self):
+ (data, a, controlmask) = self.data
+ #
+ test = a.view((float,2), np.matrix)
+ assert_equal(test, data)
+ self.failUnless(isinstance(test, np.matrix))
+ self.failUnless(not isinstance(test, MaskedArray))
###############################################################################
#------------------------------------------------------------------------------
diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
index f6105f843..f41cff952 100644
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -11,7 +11,7 @@ __version__ = '1.0'
__revision__ = "$Revision: 3473 $"
__date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $'
-import numpy
+import numpy as np
from numpy.testing import TestCase, run_module_suite
from numpy.ma.testutils import *
from numpy.ma.core import *
@@ -26,7 +26,7 @@ class TestAverage(TestCase):
assert_equal(2.0, average(ott, weights=[1., 1., 2., 1.]))
result, wts = average(ott, weights=[1.,1.,2.,1.], returned=1)
assert_equal(2.0, result)
- assert(wts == 4.0)
+ self.failUnless(wts == 4.0)
ott[:] = masked
assert_equal(average(ott,axis=0).mask, [True])
ott = array([0.,1.,2.,3.], mask=[1,0,0,0])
@@ -104,7 +104,7 @@ class TestConcatenator(TestCase):
m = [1,0,0,0,0]
d = masked_array(b,mask=m)
c = mr_[d,0,0,d]
- assert(isinstance(c,MaskedArray) or isinstance(c,core.MaskedArray))
+ self.failUnless(isinstance(c,MaskedArray) or isinstance(c,core.MaskedArray))
assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])
assert_array_equal(c.mask, mr_[m,0,0,m])
@@ -117,12 +117,12 @@ class TestConcatenator(TestCase):
b_1 = masked_array(a_1,mask=m_1)
b_2 = masked_array(a_2,mask=m_2)
d = mr_['1',b_1,b_2] # append columns
- assert(d.shape == (5,10))
+ self.failUnless(d.shape == (5,10))
assert_array_equal(d[:,:5],b_1)
assert_array_equal(d[:,5:],b_2)
assert_array_equal(d.mask, np.r_['1',m_1,m_2])
d = mr_[b_1,b_2]
- assert(d.shape == (10,5))
+ self.failUnless(d.shape == (10,5))
assert_array_equal(d[:5,:],b_1)
assert_array_equal(d[5:,:],b_2)
assert_array_equal(d.mask, np.r_[m_1,m_2])
@@ -158,14 +158,14 @@ class TestNotMasked(TestCase):
assert_equal(tmp[-3], slice(0,3,None))
#
tmp = notmasked_contiguous(a, 0)
- assert(len(tmp[-1]) == 1)
- assert(tmp[-2] is None)
+ self.failUnless(len(tmp[-1]) == 1)
+ self.failUnless(tmp[-2] is None)
assert_equal(tmp[-3],tmp[-1])
- assert(len(tmp[0]) == 2)
+ self.failUnless(len(tmp[0]) == 2)
#
tmp = notmasked_contiguous(a, 1)
assert_equal(tmp[0][-1], slice(0,3,None))
- assert(tmp[1] is None)
+ self.failUnless(tmp[1] is None)
assert_equal(tmp[2][-1], slice(7,7,None))
assert_equal(tmp[2][-2], slice(0,5,None))
@@ -205,12 +205,12 @@ class Test2DFunctions(TestCase):
assert_equal(mask_rowcols(x,0).mask, [[1,1,1],[1,1,1],[0,0,0]] )
assert_equal(mask_rowcols(x,1,).mask, [[1,1,0],[1,1,0],[1,1,0]] )
x = array(x._data, mask=[[1,0,0],[0,1,0],[0,0,1]])
- assert(mask_rowcols(x).all() is masked)
- assert(mask_rowcols(x,0).all() is masked)
- assert(mask_rowcols(x,1).all() is masked)
- assert(mask_rowcols(x).mask.all())
- assert(mask_rowcols(x,0).mask.all())
- assert(mask_rowcols(x,1).mask.all())
+ self.failUnless(mask_rowcols(x).all() is masked)
+ self.failUnless(mask_rowcols(x,0).all() is masked)
+ self.failUnless(mask_rowcols(x,1).all() is masked)
+ self.failUnless(mask_rowcols(x).mask.all())
+ self.failUnless(mask_rowcols(x,0).mask.all())
+ self.failUnless(mask_rowcols(x,1).mask.all())
#
def test_dot(self):
"Tests dot product"
@@ -332,25 +332,36 @@ class TestMedian(TestCase):
def test_2d(self):
"Tests median w/ 2D"
(n,p) = (101,30)
- x = masked_array(numpy.linspace(-1.,1.,n),)
+ x = masked_array(np.linspace(-1.,1.,n),)
x[:10] = x[-10:] = masked
- z = masked_array(numpy.empty((n,p), dtype=numpy.float_))
+ z = masked_array(np.empty((n,p), dtype=float))
z[:,0] = x[:]
- idx = numpy.arange(len(x))
+ idx = np.arange(len(x))
for i in range(1,p):
- numpy.random.shuffle(idx)
+ np.random.shuffle(idx)
z[:,i] = x[idx]
assert_equal(median(z[:,0]), 0)
- assert_equal(median(z), numpy.zeros((p,)))
+ assert_equal(median(z), 0)
+ assert_equal(median(z, axis=0), np.zeros(p))
+ assert_equal(median(z.T, axis=1), np.zeros(p))
+ #
+ def test_2d_waxis(self):
+ "Tests median w/ 2D arrays and different axis."
+ x = masked_array(np.arange(30).reshape(10,3))
+ x[:3] = x[-3:] = masked
+ assert_equal(median(x), 14.5)
+ assert_equal(median(x, axis=0), [13.5,14.5,15.5])
+ assert_equal(median(x,axis=1), [0,0,0,10,13,16,19,0,0,0])
+ assert_equal(median(x,axis=1).mask, [1,1,1,0,0,0,0,1,1,1])
#
def test_3d(self):
"Tests median w/ 3D"
- x = numpy.ma.arange(24).reshape(3,4,2)
+ x = np.ma.arange(24).reshape(3,4,2)
x[x%3==0] = masked
assert_equal(median(x,0), [[12,9],[6,15],[12,9],[18,15]])
x.shape = (4,3,2)
assert_equal(median(x,0),[[99,10],[11,99],[13,14]])
- x = numpy.ma.arange(24).reshape(4,3,2)
+ x = np.ma.arange(24).reshape(4,3,2)
x[x%5==0] = masked
assert_equal(median(x,0), [[12,10],[8,9],[16,17]])
@@ -483,9 +494,9 @@ class TestPolynomial(TestCase):
def test_polyfit(self):
"Tests polyfit"
# On ndarrays
- x = numpy.random.rand(10)
- y = numpy.random.rand(20).reshape(-1,2)
- assert_almost_equal(polyfit(x,y,3),numpy.polyfit(x,y,3))
+ x = np.random.rand(10)
+ y = np.random.rand(20).reshape(-1,2)
+ assert_almost_equal(polyfit(x,y,3),np.polyfit(x,y,3))
# ON 1D maskedarrays
x = x.view(MaskedArray)
x[0] = masked
@@ -493,17 +504,17 @@ class TestPolynomial(TestCase):
y[0,0] = y[-1,-1] = masked
#
(C,R,K,S,D) = polyfit(x,y[:,0],3,full=True)
- (c,r,k,s,d) = numpy.polyfit(x[1:], y[1:,0].compressed(), 3, full=True)
+ (c,r,k,s,d) = np.polyfit(x[1:], y[1:,0].compressed(), 3, full=True)
for (a,a_) in zip((C,R,K,S,D),(c,r,k,s,d)):
assert_almost_equal(a, a_)
#
(C,R,K,S,D) = polyfit(x,y[:,-1],3,full=True)
- (c,r,k,s,d) = numpy.polyfit(x[1:-1], y[1:-1,-1], 3, full=True)
+ (c,r,k,s,d) = np.polyfit(x[1:-1], y[1:-1,-1], 3, full=True)
for (a,a_) in zip((C,R,K,S,D),(c,r,k,s,d)):
assert_almost_equal(a, a_)
#
(C,R,K,S,D) = polyfit(x,y,3,full=True)
- (c,r,k,s,d) = numpy.polyfit(x[1:-1], y[1:-1,:], 3, full=True)
+ (c,r,k,s,d) = np.polyfit(x[1:-1], y[1:-1,:], 3, full=True)
for (a,a_) in zip((C,R,K,S,D),(c,r,k,s,d)):
assert_almost_equal(a, a_)
diff --git a/numpy/ma/tests/test_mrecords.py b/numpy/ma/tests/test_mrecords.py
index 38758393c..6e9248953 100644
--- a/numpy/ma/tests/test_mrecords.py
+++ b/numpy/ma/tests/test_mrecords.py
@@ -8,23 +8,19 @@ __author__ = "Pierre GF Gerard-Marchant ($Author: jarrod.millman $)"
__revision__ = "$Revision: 3473 $"
__date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $'
-import types
-
import numpy as np
from numpy import recarray
from numpy.core.records import fromrecords as recfromrecords, \
- fromarrays as recfromarrays
+ fromarrays as recfromarrays
import numpy.ma.testutils
from numpy.ma.testutils import *
import numpy.ma as ma
-from numpy.ma import masked, nomask, getdata, getmaskarray
+from numpy.ma import masked, nomask
-import numpy.ma.mrecords
-reload(numpy.ma.mrecords)
-from numpy.ma.mrecords import MaskedRecords, mrecarray,\
- fromarrays, fromtextfile, fromrecords, addfield
+from numpy.ma.mrecords import MaskedRecords, mrecarray, fromarrays, \
+ fromtextfile, fromrecords, addfield
#..............................................................................
class TestMRecords(TestCase):
@@ -69,8 +65,6 @@ class TestMRecords(TestCase):
assert_equal(mbase_first.tolist(), (1,1.1,'one'))
# Used to be mask, now it's recordmask
assert_equal(mbase_first.recordmask, nomask)
- # _fieldmask and _mask should be the same thing
- assert_equal(mbase_first._fieldmask.item(), (False, False, False))
assert_equal(mbase_first._mask.item(), (False, False, False))
assert_equal(mbase_first['a'], mbase['a'][0])
mbase_last = mbase[-1]
@@ -79,7 +73,7 @@ class TestMRecords(TestCase):
assert_equal(mbase_last.tolist(), (None,None,None))
# Used to be mask, now it's recordmask
assert_equal(mbase_last.recordmask, True)
- assert_equal(mbase_last._fieldmask.item(), (True, True, True))
+ assert_equal(mbase_last._mask.item(), (True, True, True))
assert_equal(mbase_last['a'], mbase['a'][-1])
assert (mbase_last['a'] is masked)
# as slice ..........
@@ -111,7 +105,7 @@ class TestMRecords(TestCase):
assert_equal(ma.getmaskarray(mbase['a']), [0]*5)
# Use to be _mask, now it's recordmask
assert_equal(mbase.recordmask, [False]*5)
- assert_equal(mbase._fieldmask.tolist(),
+ assert_equal(mbase._mask.tolist(),
np.array([(0,0,0),(0,1,1),(0,0,0),(0,0,0),(0,1,1)],
dtype=bool))
# Set a field to mask ........................
@@ -121,7 +115,7 @@ class TestMRecords(TestCase):
assert_equal(mbase.c.recordmask, [1]*5)
assert_equal(ma.getmaskarray(mbase['c']), [1]*5)
assert_equal(ma.getdata(mbase['c']), ['N/A']*5)
- assert_equal(mbase._fieldmask.tolist(),
+ assert_equal(mbase._mask.tolist(),
np.array([(0,0,1),(0,1,1),(0,0,1),(0,0,1),(0,1,1)],
dtype=bool))
# Set fields by slices .......................
@@ -163,23 +157,23 @@ class TestMRecords(TestCase):
base = self.base.copy()
mbase = base.view(mrecarray)
# Set the mask to True .......................
- mbase._mask = masked
+ mbase.mask = masked
assert_equal(ma.getmaskarray(mbase['b']), [1]*5)
assert_equal(mbase['a']._mask, mbase['b']._mask)
assert_equal(mbase['a']._mask, mbase['c']._mask)
- assert_equal(mbase._fieldmask.tolist(),
+ assert_equal(mbase._mask.tolist(),
np.array([(1,1,1)]*5, dtype=bool))
# Delete the mask ............................
- mbase._mask = nomask
+ mbase.mask = nomask
assert_equal(ma.getmaskarray(mbase['c']), [0]*5)
- assert_equal(mbase._fieldmask.tolist(),
+ assert_equal(mbase._mask.tolist(),
np.array([(0,0,0)]*5, dtype=bool))
#
def test_set_mask_fromarray(self):
base = self.base.copy()
mbase = base.view(mrecarray)
# Sets the mask w/ an array
- mbase._mask = [1,0,0,0,1]
+ mbase.mask = [1,0,0,0,1]
assert_equal(mbase.a.mask, [1,0,0,0,1])
assert_equal(mbase.b.mask, [1,0,0,0,1])
assert_equal(mbase.c.mask, [1,0,0,0,1])
@@ -207,10 +201,10 @@ class TestMRecords(TestCase):
#
def test_set_elements(self):
base = self.base.copy()
- mbase = base.view(mrecarray)
# Set an element to mask .....................
+ mbase = base.view(mrecarray).copy()
mbase[-2] = masked
- assert_equal(mbase._fieldmask.tolist(),
+ assert_equal(mbase._mask.tolist(),
np.array([(0,0,0),(1,1,1),(0,0,0),(1,1,1),(1,1,1)],
dtype=bool))
# Used to be mask, now it's recordmask!
@@ -268,16 +262,16 @@ class TestMRecords(TestCase):
base = self.base.copy()
mbase = base.view(mrecarray)
mbase.harden_mask()
- assert(mbase._hardmask)
- mbase._mask = nomask
+ self.failUnless(mbase._hardmask)
+ mbase.mask = nomask
assert_equal_records(mbase._mask, base._mask)
mbase.soften_mask()
- assert(not mbase._hardmask)
- mbase._mask = nomask
+ self.failUnless(not mbase._hardmask)
+ mbase.mask = nomask
# So, the mask of a field is no longer set to nomask...
assert_equal_records(mbase._mask,
ma.make_mask_none(base.shape,base.dtype))
- assert(ma.make_mask(mbase['b']._mask) is nomask)
+ self.failUnless(ma.make_mask(mbase['b']._mask) is nomask)
assert_equal(mbase['a']._mask,mbase['b']._mask)
#
def test_pickling(self):
@@ -290,7 +284,7 @@ class TestMRecords(TestCase):
assert_equal(mrec_.dtype, mrec.dtype)
assert_equal_records(mrec_._data, mrec._data)
assert_equal(mrec_._mask, mrec._mask)
- assert_equal_records(mrec_._fieldmask, mrec._fieldmask)
+ assert_equal_records(mrec_._mask, mrec._mask)
#
def test_filled(self):
"Test filling the array"
@@ -344,6 +338,45 @@ class TestMRecords(TestCase):
np.array([(0,0,0),(1,1,1)], dtype=mult.dtype))
+class TestView(TestCase):
+ #
+ def setUp(self):
+ (a, b) = (np.arange(10), np.random.rand(10))
+ ndtype = [('a',np.float), ('b',np.float)]
+ arr = np.array(zip(a,b), dtype=ndtype)
+ rec = arr.view(np.recarray)
+ #
+ marr = ma.array(zip(a,b), dtype=ndtype, fill_value=(-9., -99.))
+ mrec = fromarrays([a,b], dtype=ndtype, fill_value=(-9., -99.))
+ mrec.mask[3] = (False, True)
+ self.data = (mrec, a, b, arr)
+ #
+ def test_view_by_itself(self):
+ (mrec, a, b, arr) = self.data
+ test = mrec.view()
+ self.failUnless(isinstance(test, MaskedRecords))
+ assert_equal_records(test, mrec)
+ assert_equal_records(test._mask, mrec._mask)
+ #
+ def test_view_simple_dtype(self):
+ (mrec, a, b, arr) = self.data
+ ntype = (np.float, 2)
+ test = mrec.view(ntype)
+ self.failUnless(isinstance(test, ma.MaskedArray))
+ assert_equal(test, np.array(zip(a,b), dtype=np.float))
+ self.failUnless(test[3,1] is ma.masked)
+ #
+ def test_view_flexible_type(self):
+ (mrec, a, b, arr) = self.data
+ alttype = [('A',np.float), ('B',np.float)]
+ test = mrec.view(alttype)
+ self.failUnless(isinstance(test, MaskedRecords))
+ assert_equal_records(test, arr.view(alttype))
+ self.failUnless(test['B'][3] is masked)
+ assert_equal(test.dtype, np.dtype(alttype))
+ self.failUnless(test._fill_value is None)
+
+
################################################################################
class TestMRecordsImport(TestCase):
"Base test class for MaskedArrays."
@@ -399,7 +432,7 @@ class TestMRecordsImport(TestCase):
_mrec = fromrecords(mrec)
assert_equal(_mrec.dtype, mrec.dtype)
assert_equal_records(_mrec._data, mrec.filled())
- assert_equal_records(_mrec._fieldmask, mrec._fieldmask)
+ assert_equal_records(_mrec._mask, mrec._mask)
def test_fromrecords_wmask(self):
"Tests construction from records w/ mask."
@@ -407,20 +440,20 @@ class TestMRecordsImport(TestCase):
#
_mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=[0,1,0,])
assert_equal_records(_mrec._data, mrec._data)
- assert_equal(_mrec._fieldmask.tolist(), [(0,0,0),(1,1,1),(0,0,0)])
+ assert_equal(_mrec._mask.tolist(), [(0,0,0),(1,1,1),(0,0,0)])
#
_mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=True)
assert_equal_records(_mrec._data, mrec._data)
- assert_equal(_mrec._fieldmask.tolist(), [(1,1,1),(1,1,1),(1,1,1)])
+ assert_equal(_mrec._mask.tolist(), [(1,1,1),(1,1,1),(1,1,1)])
#
- _mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=mrec._fieldmask)
+ _mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=mrec._mask)
assert_equal_records(_mrec._data, mrec._data)
- assert_equal(_mrec._fieldmask.tolist(), mrec._fieldmask.tolist())
+ assert_equal(_mrec._mask.tolist(), mrec._mask.tolist())
#
_mrec = fromrecords(nrec.tolist(), dtype=ddtype,
- mask=mrec._fieldmask.tolist())
+ mask=mrec._mask.tolist())
assert_equal_records(_mrec._data, mrec._data)
- assert_equal(_mrec._fieldmask.tolist(), mrec._fieldmask.tolist())
+ assert_equal(_mrec._mask.tolist(), mrec._mask.tolist())
def test_fromtextfile(self):
"Tests reading from a text file."
@@ -432,7 +465,6 @@ class TestMRecordsImport(TestCase):
'strings',4,-1e-10,,,1
"""
import os
- from datetime import datetime
import tempfile
(tmp_fd,tmp_fl) = tempfile.mkstemp()
os.write(tmp_fd, fcontent)
@@ -440,7 +472,7 @@ class TestMRecordsImport(TestCase):
mrectxt = fromtextfile(tmp_fl, delimitor=',',varnames='ABCDEFG')
os.remove(tmp_fl)
#
- assert(isinstance(mrectxt, MaskedRecords))
+ self.failUnless(isinstance(mrectxt, MaskedRecords))
assert_equal(mrectxt.F, [1,1,1,1])
assert_equal(mrectxt.E._mask, [1,1,1,1])
assert_equal(mrectxt.C, [1,2,3.e+5,-1e-10])
diff --git a/numpy/ma/tests/test_old_ma.py b/numpy/ma/tests/test_old_ma.py
index 5e881e736..4887a228c 100644
--- a/numpy/ma/tests/test_old_ma.py
+++ b/numpy/ma/tests/test_old_ma.py
@@ -1,5 +1,5 @@
import numpy
-import types, time
+import types
from numpy.ma import *
from numpy.core.numerictypes import float32
from numpy.ma.core import umath
diff --git a/numpy/ma/tests/test_subclassing.py b/numpy/ma/tests/test_subclassing.py
index eff7b268d..939b8ee56 100644
--- a/numpy/ma/tests/test_subclassing.py
+++ b/numpy/ma/tests/test_subclassing.py
@@ -11,8 +11,6 @@ __revision__ = "$Revision: 3473 $"
__date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $'
import numpy as np
-import numpy.core.numeric as numeric
-
from numpy.testing import *
from numpy.ma.testutils import *
from numpy.ma.core import *
@@ -78,24 +76,24 @@ class TestSubclassing(TestCase):
m = [0,0,1,0,0]
xsub = SubArray(x)
xmsub = masked_array(xsub, mask=m)
- assert isinstance(xmsub, MaskedArray)
+ self.failUnless(isinstance(xmsub, MaskedArray))
assert_equal(xmsub._data, xsub)
- assert isinstance(xmsub._data, SubArray)
+ self.failUnless(isinstance(xmsub._data, SubArray))
def test_maskedarray_subclassing(self):
"Tests subclassing MaskedArray"
x = np.arange(5)
mx = mmatrix(x,mask=[0,1,0,0,0])
- assert isinstance(mx._data, np.matrix)
+ self.failUnless(isinstance(mx._data, np.matrix))
"Tests masked_unary_operation"
- assert isinstance(add(mx,mx), mmatrix)
- assert isinstance(add(mx,x), mmatrix)
+ self.failUnless(isinstance(add(mx,mx), mmatrix))
+ self.failUnless(isinstance(add(mx,x), mmatrix))
assert_equal(add(mx,x), mx+x)
- assert isinstance(add(mx,mx)._data, np.matrix)
- assert isinstance(add.outer(mx,mx), mmatrix)
+ self.failUnless(isinstance(add(mx,mx)._data, np.matrix))
+ self.failUnless(isinstance(add.outer(mx,mx), mmatrix))
"Tests masked_binary_operation"
- assert isinstance(hypot(mx,mx), mmatrix)
- assert isinstance(hypot(mx,x), mmatrix)
+ self.failUnless(isinstance(hypot(mx,mx), mmatrix))
+ self.failUnless(isinstance(hypot(mx,x), mmatrix))
def test_attributepropagation(self):
x = array(arange(5), mask=[0]+[1]*4)
@@ -103,16 +101,16 @@ class TestSubclassing(TestCase):
ym = msubarray(x)
#
z = (my+1)
- assert isinstance(z,MaskedArray)
- assert not isinstance(z, MSubArray)
- assert isinstance(z._data, SubArray)
+ self.failUnless(isinstance(z,MaskedArray))
+ self.failUnless(not isinstance(z, MSubArray))
+ self.failUnless(isinstance(z._data, SubArray))
assert_equal(z._data.info, {})
#
z = (ym+1)
- assert isinstance(z, MaskedArray)
- assert isinstance(z, MSubArray)
- assert isinstance(z._data, SubArray)
- assert z._data.info['added'] > 0
+ self.failUnless(isinstance(z, MaskedArray))
+ self.failUnless(isinstance(z, MSubArray))
+ self.failUnless(isinstance(z._data, SubArray))
+ self.failUnless(z._data.info['added'] > 0)
#
ym._set_mask([1,0,0,0,1])
assert_equal(ym._mask, [1,0,0,0,1])
@@ -121,7 +119,7 @@ class TestSubclassing(TestCase):
#
xsub = subarray(x, info={'name':'x'})
mxsub = masked_array(xsub)
- assert hasattr(mxsub, 'info')
+ self.failUnless(hasattr(mxsub, 'info'))
assert_equal(mxsub.info, xsub.info)
def test_subclasspreservation(self):
@@ -132,22 +130,22 @@ class TestSubclassing(TestCase):
xsub = MSubArray(x, mask=m, info={'xsub':xinfo})
#
mxsub = masked_array(xsub, subok=False)
- assert not isinstance(mxsub, MSubArray)
- assert isinstance(mxsub, MaskedArray)
+ self.failUnless(not isinstance(mxsub, MSubArray))
+ self.failUnless(isinstance(mxsub, MaskedArray))
assert_equal(mxsub._mask, m)
#
mxsub = asarray(xsub)
- assert not isinstance(mxsub, MSubArray)
- assert isinstance(mxsub, MaskedArray)
+ self.failUnless(not isinstance(mxsub, MSubArray))
+ self.failUnless(isinstance(mxsub, MaskedArray))
assert_equal(mxsub._mask, m)
#
mxsub = masked_array(xsub, subok=True)
- assert isinstance(mxsub, MSubArray)
+ self.failUnless(isinstance(mxsub, MSubArray))
assert_equal(mxsub.info, xsub.info)
assert_equal(mxsub._mask, xsub._mask)
#
mxsub = asanyarray(xsub)
- assert isinstance(mxsub, MSubArray)
+ self.failUnless(isinstance(mxsub, MSubArray))
assert_equal(mxsub.info, xsub.info)
assert_equal(mxsub._mask, m)
@@ -156,24 +154,4 @@ class TestSubclassing(TestCase):
if __name__ == '__main__':
run_module_suite()
- if 0:
- x = array(arange(5), mask=[0]+[1]*4)
- my = masked_array(subarray(x))
- ym = msubarray(x)
- #
- z = (my+1)
- assert isinstance(z,MaskedArray)
- assert not isinstance(z, MSubArray)
- assert isinstance(z._data, SubArray)
- assert_equal(z._data.info, {})
- #
- z = (ym+1)
- assert isinstance(z, MaskedArray)
- assert isinstance(z, MSubArray)
- assert isinstance(z._data, SubArray)
- assert z._data.info['added'] > 0
- #
- ym._set_mask([1,0,0,0,1])
- assert_equal(ym._mask, [1,0,0,0,1])
- ym._series._set_mask([0,0,0,0,1])
- assert_equal(ym._mask, [0,0,0,0,1])
+
diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py
index 8de590be5..28754bccc 100644
--- a/numpy/ma/testutils.py
+++ b/numpy/ma/testutils.py
@@ -16,12 +16,10 @@ import numpy as np
from numpy import ndarray, float_
import numpy.core.umath as umath
from numpy.testing import *
-from numpy.testing.utils import build_err_msg, rand
import numpy.testing.utils as utils
-import core
-from core import mask_or, getmask, getmaskarray, masked_array, nomask, masked
-from core import fix_invalid, filled, equal, less
+from core import mask_or, getmask, masked_array, nomask, masked, filled, \
+ equal, less
#------------------------------------------------------------------------------
def approx (a, b, fill_value=True, rtol=1.e-5, atol=1.e-8):
@@ -83,10 +81,12 @@ def assert_equal(actual,desired,err_msg=''):
"""
# Case #1: dictionary .....
if isinstance(desired, dict):
- assert isinstance(actual, dict), repr(type(actual))
+ if not isinstance(actual, dict):
+ raise AssertionError(repr(type(actual)))
assert_equal(len(actual),len(desired),err_msg)
for k,i in desired.items():
- assert k in actual, repr(k)
+ if not k in actual:
+ raise AssertionError("%s not in %s" % (k,actual))
assert_equal(actual[k], desired[k], 'key=%r\n%s' % (k,err_msg))
return
# Case #2: lists .....
@@ -94,7 +94,8 @@ def assert_equal(actual,desired,err_msg=''):
return _assert_equal_on_sequences(actual, desired, err_msg='')
if not (isinstance(actual, ndarray) or isinstance(desired, ndarray)):
msg = build_err_msg([actual, desired], err_msg,)
- assert desired == actual, msg
+ if not desired == actual:
+ raise AssertionError(msg)
return
# Case #4. arrays or equivalent
if ((actual is masked) and not (desired is masked)) or \
@@ -124,10 +125,12 @@ def fail_if_equal(actual,desired,err_msg='',):
"""Raises an assertion error if two items are equal.
"""
if isinstance(desired, dict):
- assert isinstance(actual, dict), repr(type(actual))
+ if not isinstance(actual, dict):
+ raise AssertionError(repr(type(actual)))
fail_if_equal(len(actual),len(desired),err_msg)
for k,i in desired.items():
- assert k in actual, repr(k)
+ if not k in actual:
+ raise AssertionError(repr(k))
fail_if_equal(actual[k], desired[k], 'key=%r\n%s' % (k,err_msg))
return
if isinstance(desired, (list,tuple)) and isinstance(actual, (list,tuple)):
@@ -138,7 +141,8 @@ def fail_if_equal(actual,desired,err_msg='',):
if isinstance(actual, np.ndarray) or isinstance(desired, np.ndarray):
return fail_if_array_equal(actual, desired, err_msg)
msg = build_err_msg([actual, desired], err_msg)
- assert desired != actual, msg
+ if not desired != actual:
+ raise AssertionError(msg)
assert_not_equal = fail_if_equal
@@ -151,7 +155,8 @@ def assert_almost_equal(actual, desired, decimal=7, err_msg='', verbose=True):
err_msg=err_msg, verbose=verbose)
msg = build_err_msg([actual, desired],
err_msg=err_msg, verbose=verbose)
- assert round(abs(desired - actual),decimal) == 0, msg
+ if not round(abs(desired - actual),decimal) == 0:
+ raise AssertionError(msg)
assert_close = assert_almost_equal
diff --git a/numpy/ma/timer_comparison.py b/numpy/ma/timer_comparison.py
index 45f0b22a6..282931494 100644
--- a/numpy/ma/timer_comparison.py
+++ b/numpy/ma/timer_comparison.py
@@ -1,16 +1,14 @@
-
import timeit
-import numpy
-from numpy import int_, float_, bool_
-import numpy.core.fromnumeric as fromnumeric
-
-from numpy.testing.utils import build_err_msg, rand
+import numpy as np
+from numpy import float_
+import np.core.fromnumeric as fromnumeric
+from np.testing.utils import build_err_msg
-numpy.seterr(all='ignore')
+np.seterr(all='ignore')
-pi = numpy.pi
+pi = np.pi
class moduletester:
#-----------------------------------
@@ -61,15 +59,15 @@ class moduletester:
y = self.filled(self.masked_array(yf, mask=m), fill_value)
if (x.dtype.char != "O"):
x = x.astype(float_)
- if isinstance(x, numpy.ndarray) and x.size > 1:
- x[numpy.isnan(x)] = 0
- elif numpy.isnan(x):
+ if isinstance(x, np.ndarray) and x.size > 1:
+ x[np.isnan(x)] = 0
+ elif np.isnan(x):
x = 0
if (y.dtype.char != "O"):
y = y.astype(float_)
- if isinstance(y, numpy.ndarray) and y.size > 1:
- y[numpy.isnan(y)] = 0
- elif numpy.isnan(y):
+ if isinstance(y, np.ndarray) and y.size > 1:
+ y[np.isnan(y)] = 0
+ elif np.isnan(y):
y = 0
try:
cond = (x.shape==() or y.shape==()) or x.shape == y.shape
@@ -110,23 +108,23 @@ class moduletester:
#----------------------------------
def test_0(self):
"Tests creation"
- x = numpy.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.])
+ x = np.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.])
m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
xm = self.masked_array(x, mask=m)
xm[0]
#----------------------------------
def test_1(self):
"Tests creation"
- x = numpy.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.])
- y = numpy.array([5.,0.,3., 2., -1., -4., 0., -10., 10., 1., 0., 3.])
+ x = np.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.])
+ y = np.array([5.,0.,3., 2., -1., -4., 0., -10., 10., 1., 0., 3.])
a10 = 10.
m1 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
m2 = [0, 0, 1, 0, 0, 1, 1, 0, 0, 0 ,0, 1]
xm = self.masked_array(x, mask=m1)
ym = self.masked_array(y, mask=m2)
- z = numpy.array([-.5, 0., .5, .8])
+ z = np.array([-.5, 0., .5, .8])
zm = self.masked_array(z, mask=[0,1,0,0])
- xf = numpy.where(m1, 1.e+20, x)
+ xf = np.where(m1, 1.e+20, x)
xm.set_fill_value(1.e+20)
#.....
assert((xm-ym).filled(0).any())
@@ -146,13 +144,13 @@ class moduletester:
#----------------------------------
def test_2(self):
"Tests conversions and indexing"
- x1 = numpy.array([1,2,4,3])
+ x1 = np.array([1,2,4,3])
x2 = self.array(x1, mask=[1,0,0,0])
x3 = self.array(x1, mask=[0,1,0,1])
x4 = self.array(x1)
# test conversion to strings
junk, garbage = str(x2), repr(x2)
-# assert_equal(numpy.sort(x1), self.sort(x2, fill_value=0))
+# assert_equal(np.sort(x1), self.sort(x2, fill_value=0))
# tests of indexing
assert type(x2[1]) is type(x1[1])
assert x1[1] == x2[1]
@@ -178,12 +176,12 @@ class moduletester:
x4[:] = self.masked_array([1,2,3,4],[0,1,1,0])
# assert self.allequal(self.getmask(x4), self.array([0,1,1,0]))
# assert self.allequal(x4, self.array([1,2,3,4]))
- x1 = numpy.arange(5)*1.0
+ x1 = np.arange(5)*1.0
x2 = self.masked_values(x1, 3.0)
# assert self.allequal(x1,x2)
# assert self.allequal(self.array([0,0,0,1,0], self.MaskType), x2.mask)
x1 = self.array([1,'hello',2,3],object)
- x2 = numpy.array([1,'hello',2,3],object)
+ x2 = np.array([1,'hello',2,3],object)
s1 = x1[1]
s2 = x2[1]
assert x1[1:1].shape == (0,)
@@ -216,15 +214,15 @@ class moduletester:
def test_4(self):
"Test of take, transpose, inner, outer products"
x = self.arange(24)
- y = numpy.arange(24)
+ y = np.arange(24)
x[5:6] = self.masked
x = x.reshape(2,3,4)
y = y.reshape(2,3,4)
- assert self.allequal(numpy.transpose(y,(2,0,1)), self.transpose(x,(2,0,1)))
- assert self.allequal(numpy.take(y, (2,0,1), 1), self.take(x, (2,0,1), 1))
- assert self.allequal(numpy.inner(self.filled(x,0), self.filled(y,0)),
+ assert self.allequal(np.transpose(y,(2,0,1)), self.transpose(x,(2,0,1)))
+ assert self.allequal(np.take(y, (2,0,1), 1), self.take(x, (2,0,1), 1))
+ assert self.allequal(np.inner(self.filled(x,0), self.filled(y,0)),
self.inner(x, y))
- assert self.allequal(numpy.outer(self.filled(x,0), self.filled(y,0)),
+ assert self.allequal(np.outer(self.filled(x,0), self.filled(y,0)),
self.outer(x, y))
y = self.array(['abc', 1, 'def', 2, 3], object)
y[2] = self.masked
@@ -396,8 +394,8 @@ class moduletester:
self.assert_array_equal(self.average(x, axis=0), 2.5)
self.assert_array_equal(self.average(x, axis=0, weights=w1), 2.5)
y = self.array([self.arange(6), 2.0*self.arange(6)])
- self.assert_array_equal(self.average(y, None), numpy.add.reduce(numpy.arange(6))*3./12.)
- self.assert_array_equal(self.average(y, axis=0), numpy.arange(6) * 3./2.)
+ self.assert_array_equal(self.average(y, None), np.add.reduce(np.arange(6))*3./12.)
+ self.assert_array_equal(self.average(y, axis=0), np.arange(6) * 3./2.)
self.assert_array_equal(self.average(y, axis=1), [self.average(x,axis=0), self.average(x,axis=0) * 2.0])
self.assert_array_equal(self.average(y, None, weights=w2), 20./6.)
self.assert_array_equal(self.average(y, axis=0, weights=w2), [0.,1.,2.,3.,4.,10.])
@@ -420,7 +418,7 @@ class moduletester:
#------------------------
def test_A(self):
x = self.arange(24)
- y = numpy.arange(24)
+ y = np.arange(24)
x[5:6] = self.masked
x = x.reshape(2,3,4)
@@ -431,10 +429,10 @@ if __name__ == '__main__':
setup_base = "from __main__ import moduletester \n"\
"import numpy\n" \
"tester = moduletester(module)\n"
-# setup_new = "import numpy.ma.core_ini as module\n"+setup_base
- setup_cur = "import numpy.ma.core as module\n"+setup_base
-# setup_alt = "import numpy.ma.core_alt as module\n"+setup_base
-# setup_tmp = "import numpy.ma.core_tmp as module\n"+setup_base
+# setup_new = "import np.ma.core_ini as module\n"+setup_base
+ setup_cur = "import np.ma.core as module\n"+setup_base
+# setup_alt = "import np.ma.core_alt as module\n"+setup_base
+# setup_tmp = "import np.ma.core_tmp as module\n"+setup_base
(nrepeat, nloop) = (10, 10)
@@ -445,10 +443,10 @@ if __name__ == '__main__':
cur = timeit.Timer(func, setup_cur).repeat(nrepeat, nloop*10)
# alt = timeit.Timer(func, setup_alt).repeat(nrepeat, nloop*10)
# tmp = timeit.Timer(func, setup_tmp).repeat(nrepeat, nloop*10)
-# new = numpy.sort(new)
- cur = numpy.sort(cur)
-# alt = numpy.sort(alt)
-# tmp = numpy.sort(tmp)
+# new = np.sort(new)
+ cur = np.sort(cur)
+# alt = np.sort(alt)
+# tmp = np.sort(tmp)
print "#%i" % i +50*'.'
print eval("moduletester.test_%i.__doc__" % i)
# print "core_ini : %.3f - %.3f" % (new[0], new[1])
diff --git a/numpy/numarray/_capi.c b/numpy/numarray/_capi.c
index 07fcc0c2d..7b41b5458 100644
--- a/numpy/numarray/_capi.c
+++ b/numpy/numarray/_capi.c
@@ -225,7 +225,7 @@ static double num_round(double x)
** should always be 0 *
*/
-static int int_dividebyzero_error(long value, long unused) {
+static int int_dividebyzero_error(long NPY_UNUSED(value), long NPY_UNUSED(unused)) {
double dummy;
dummy = 1./numarray_zero;
if (dummy) /* to prevent optimizer from eliminating expression */
@@ -876,7 +876,7 @@ NumTypeFromPyValue(PyObject *self, PyObject *args) {
cfunc and wrapper.
*/
static PyObject *
-cfunc_call(PyObject *self, PyObject *argsTuple, PyObject *argsDict)
+cfunc_call(PyObject *self, PyObject *argsTuple, PyObject *NPY_UNUSED(argsDict))
{
CfuncObject *me = (CfuncObject *) self;
switch(me->descr.type) {
@@ -2546,9 +2546,9 @@ static PyObject *
NA_callStrideConvCFuncCore(
PyObject *self, int nshape, maybelong *shape,
PyObject *inbuffObj, long inboffset,
- int ninbstrides, maybelong *inbstrides,
+ int NPY_UNUSED(ninbstrides), maybelong *inbstrides,
PyObject *outbuffObj, long outboffset,
- int noutbstrides, maybelong *outbstrides,
+ int NPY_UNUSED(noutbstrides), maybelong *outbstrides,
long nbytes)
{
CfuncObject *me = (CfuncObject *) self;
@@ -2627,17 +2627,17 @@ NA_stridesFromShape(int nshape, maybelong *shape, maybelong bytestride,
}
static int
-NA_OperatorCheck(PyObject *op) {
+NA_OperatorCheck(PyObject *NPY_UNUSED(op)) {
return 0;
}
static int
-NA_ConverterCheck(PyObject *op) {
+NA_ConverterCheck(PyObject *NPY_UNUSED(op)) {
return 0;
}
static int
-NA_UfuncCheck(PyObject *op) {
+NA_UfuncCheck(PyObject *NPY_UNUSED(op)) {
return 0;
}
@@ -2647,8 +2647,8 @@ NA_CfuncCheck(PyObject *op) {
}
static int
-NA_getByteOffset(PyArrayObject *array, int nindices, maybelong *indices,
- long *offset)
+NA_getByteOffset(PyArrayObject *NPY_UNUSED(array), int NPY_UNUSED(nindices),
+ maybelong *NPY_UNUSED(indices), long *NPY_UNUSED(offset))
{
return 0;
}
@@ -2742,8 +2742,9 @@ NA_NumarrayType(PyObject *seq)
/* ignores bytestride */
static PyArrayObject *
NA_NewAllFromBuffer(int ndim, maybelong *shape, NumarrayType type,
- PyObject *bufferObject, maybelong byteoffset, maybelong bytestride,
- int byteorder, int aligned, int writeable)
+ PyObject *bufferObject, maybelong byteoffset,
+ maybelong NPY_UNUSED(bytestride), int byteorder,
+ int NPY_UNUSED(aligned), int NPY_UNUSED(writeable))
{
PyArrayObject *self = NULL;
PyArray_Descr *dtype;
@@ -2822,17 +2823,17 @@ NA_NDArrayCheckExact(PyObject *op) {
}
static int
-NA_OperatorCheckExact(PyObject *op) {
+NA_OperatorCheckExact(PyObject *NPY_UNUSED(op)) {
return 0;
}
static int
-NA_ConverterCheckExact(PyObject *op) {
+NA_ConverterCheckExact(PyObject *NPY_UNUSED(op)) {
return 0;
}
static int
-NA_UfuncCheckExact(PyObject *op) {
+NA_UfuncCheckExact(PyObject *NPY_UNUSED(op)) {
return 0;
}
@@ -2854,7 +2855,7 @@ NA_getArrayData(PyArrayObject *obj)
/* Byteswap is not a flag of the array --- it is implicit in the data-type */
static void
-NA_updateByteswap(PyArrayObject *self)
+NA_updateByteswap(PyArrayObject *NPY_UNUSED(self))
{
return;
}
diff --git a/numpy/numarray/alter_code2.py b/numpy/numarray/alter_code2.py
index 87ec5aa07..4bb773850 100644
--- a/numpy/numarray/alter_code2.py
+++ b/numpy/numarray/alter_code2.py
@@ -12,12 +12,9 @@ import warnings
warnings.warn("numpy.numarray.alter_code2 is not working yet.")
import sys
-
import os
-import re
import glob
-
def makenewfile(name, filestr):
fid = file(name, 'w')
fid.write(filestr)
diff --git a/numpy/numarray/functions.py b/numpy/numarray/functions.py
index bd920219b..6a0fd2958 100644
--- a/numpy/numarray/functions.py
+++ b/numpy/numarray/functions.py
@@ -20,13 +20,13 @@ __all__ += ['vdot', 'dot', 'matrixmultiply', 'ravel', 'indices',
'any', 'argmax', 'argmin', 'argsort', 'around', 'array_equal',
'array_equiv', 'arrayrange', 'array_str', 'array_repr',
'array2list', 'average', 'choose', 'CLIP', 'RAISE', 'WRAP',
- 'clip', 'compress', 'concatenate', 'copy', 'copy_reg',
+ 'clip', 'compress', 'copy', 'copy_reg',
'diagonal', 'divide_remainder', 'e', 'explicit_type', 'pi',
'flush_caches', 'fromfile', 'os', 'sys', 'STRICT',
'SLOPPY', 'WARN', 'EarlyEOFError', 'SizeMismatchError',
'SizeMismatchWarning', 'FileSeekWarning', 'fromstring',
'fromfunction', 'fromlist', 'getShape', 'getTypeObject',
- 'identity', 'indices', 'info', 'innerproduct', 'inputarray',
+ 'identity', 'info', 'innerproduct', 'inputarray',
'isBigEndian', 'kroneckerproduct', 'lexsort', 'math',
'operator', 'outerproduct', 'put', 'putmask', 'rank',
'repeat', 'reshape', 'resize', 'round', 'searchsorted',
@@ -45,9 +45,9 @@ import math
import operator
from numpy import dot as matrixmultiply, dot, vdot, ravel, concatenate, all,\
- allclose, any, around, argsort, array_equal, array_equiv,\
+ allclose, any, argsort, array_equal, array_equiv,\
array_str, array_repr, CLIP, RAISE, WRAP, clip, concatenate, \
- diagonal, e, pi, indices, inner as innerproduct, nonzero, \
+ diagonal, e, pi, inner as innerproduct, nonzero, \
outer as outerproduct, kron as kroneckerproduct, lexsort, putmask, rank, \
resize, searchsorted, shape, size, sort, swapaxes, trace, transpose
import numpy as np
@@ -321,7 +321,7 @@ def getTypeObject(sequence, type):
if type is not None:
return type
try:
- return typefrom(N.array(sequence))
+ return typefrom(np.array(sequence))
except:
raise TypeError("Can't determine a reasonable type from sequence")
@@ -458,7 +458,7 @@ def take(array, indices, axis=0, outarr=None, clipmode=RAISE):
res = work[indices]
if outarr is None:
return res
- out[...] = res
+ outarr[...] = res
return
def tensormultiply(a1, a2):
@@ -466,9 +466,9 @@ def tensormultiply(a1, a2):
if (a1.shape[-1] != a2.shape[0]):
raise ValueError("Unmatched dimensions")
shape = a1.shape[:-1] + a2.shape[1:]
- return np.reshape(dot(N.reshape(a1, (-1, a1.shape[-1])),
- np.reshape(a2, (a2.shape[0],-1))),
- shape)
+ return np.reshape(dot(np.reshape(a1, (-1, a1.shape[-1])),
+ np.reshape(a2, (a2.shape[0],-1))),
+ shape)
def cumsum(a1, axis=0, out=None, type=None, dim=0):
return np.asarray(a1).cumsum(axis,dtype=type,out=out)
diff --git a/numpy/numarray/numerictypes.py b/numpy/numarray/numerictypes.py
index 99473097d..7bc91612e 100644
--- a/numpy/numarray/numerictypes.py
+++ b/numpy/numarray/numerictypes.py
@@ -54,9 +54,6 @@ except:
#from typeconv import typeConverters as _typeConverters
#import numinclude
#from _numerictype import _numerictype, typeDict
-import types as _types
-import copy as _copy
-import sys as _sys
# Enumeration of numarray type codes
typeDict = {}
diff --git a/numpy/numarray/session.py b/numpy/numarray/session.py
index e1b079103..0982742ab 100644
--- a/numpy/numarray/session.py
+++ b/numpy/numarray/session.py
@@ -16,7 +16,6 @@ First, some unfortunate (probably unnecessary) concessions to doctest
to keep the test run free of warnings.
>>> del _PROXY_ALLOWED
->>> del copy
>>> del __builtins__
By default, save() stores every variable in the caller's namespace:
@@ -76,7 +75,6 @@ which is not restored by a simple import is lost.
__all__ = ['load', 'save']
-import copy
import sys
import pickle
diff --git a/numpy/numarray/util.py b/numpy/numarray/util.py
index 2a7efb60d..01002f194 100644
--- a/numpy/numarray/util.py
+++ b/numpy/numarray/util.py
@@ -1,7 +1,8 @@
-from numpy import geterr
+import os
+import numpy
-__all__ = ['MathDomainError', 'UnderflowError', 'NumOverflowError', 'handleError',
- 'get_numarray_include_dirs']
+__all__ = ['MathDomainError', 'UnderflowError', 'NumOverflowError',
+ 'handleError', 'get_numarray_include_dirs']
class MathDomainError(ArithmeticError): pass
class UnderflowError(ArithmeticError): pass
@@ -9,31 +10,29 @@ class NumOverflowError(OverflowError, ArithmeticError): pass
def handleError(errorStatus, sourcemsg):
"""Take error status and use error mode to handle it."""
- modes = geterr()
- if errorStatus & FPE_INVALID:
+ modes = numpy.geterr()
+ if errorStatus & numpy.FPE_INVALID:
if modes['invalid'] == "warn":
print "Warning: Encountered invalid numeric result(s)", sourcemsg
if modes['invalid'] == "raise":
raise MathDomainError(sourcemsg)
- if errorStatus & FPE_DIVIDEBYZERO:
+ if errorStatus & numpy.FPE_DIVIDEBYZERO:
if modes['dividebyzero'] == "warn":
print "Warning: Encountered divide by zero(s)", sourcemsg
if modes['dividebyzero'] == "raise":
raise ZeroDivisionError(sourcemsg)
- if errorStatus & FPE_OVERFLOW:
+ if errorStatus & numpy.FPE_OVERFLOW:
if modes['overflow'] == "warn":
print "Warning: Encountered overflow(s)", sourcemsg
if modes['overflow'] == "raise":
raise NumOverflowError(sourcemsg)
- if errorStatus & FPE_UNDERFLOW:
+ if errorStatus & numpy.FPE_UNDERFLOW:
if modes['underflow'] == "warn":
print "Warning: Encountered underflow(s)", sourcemsg
if modes['underflow'] == "raise":
raise UnderflowError(sourcemsg)
-import os
-import numpy
def get_numarray_include_dirs():
base = os.path.dirname(numpy.__file__)
newdirs = [os.path.join(base, 'numarray')]
diff --git a/numpy/oldnumeric/arrayfns.py b/numpy/oldnumeric/arrayfns.py
index 4c31a6827..dbb910770 100644
--- a/numpy/oldnumeric/arrayfns.py
+++ b/numpy/oldnumeric/arrayfns.py
@@ -1,10 +1,11 @@
"""Backward compatible with arrayfns from Numeric
"""
-__all__ = ['array_set', 'construct3', 'digitize', 'error', 'find_mask', 'histogram', 'index_sort',
- 'interp', 'nz', 'reverse', 'span', 'to_corners', 'zmin_zmax']
+__all__ = ['array_set', 'construct3', 'digitize', 'error', 'find_mask',
+ 'histogram', 'index_sort', 'interp', 'nz', 'reverse', 'span',
+ 'to_corners', 'zmin_zmax']
-import numpy as nx
+import numpy as np
from numpy import asarray
class error(Exception):
@@ -14,7 +15,7 @@ def array_set(vals1, indices, vals2):
indices = asarray(indices)
if indices.ndim != 1:
raise ValueError, "index array must be 1-d"
- if not isinstance(vals1, ndarray):
+ if not isinstance(vals1, np.ndarray):
raise TypeError, "vals1 must be an ndarray"
vals1 = asarray(vals1)
vals2 = asarray(vals2)
@@ -31,7 +32,7 @@ def index_sort(arr):
def interp(y, x, z, typ=None):
"""y(z) interpolated by treating y(x) as piecewise function
"""
- res = numpy.interp(z, x, y)
+ res = np.interp(z, x, y)
if typ is None or typ == 'd':
return res
if typ == 'f':
@@ -40,17 +41,17 @@ def interp(y, x, z, typ=None):
raise error, "incompatible typecode"
def nz(x):
- x = asarray(x,dtype=nx.ubyte)
+ x = asarray(x,dtype=np.ubyte)
if x.ndim != 1:
raise TypeError, "intput must have 1 dimension."
- indxs = nx.flatnonzero(x != 0)
+ indxs = np.flatnonzero(x != 0)
return indxs[-1].item()+1
def reverse(x, n):
x = asarray(x,dtype='d')
if x.ndim != 2:
raise ValueError, "input must be 2-d"
- y = nx.empty_like(x)
+ y = np.empty_like(x)
if n == 0:
y[...] = x[::-1,:]
elif n == 1:
@@ -58,11 +59,11 @@ def reverse(x, n):
return y
def span(lo, hi, num, d2=0):
- x = linspace(lo, hi, num)
+ x = np.linspace(lo, hi, num)
if d2 <= 0:
return x
else:
- ret = empty((d2,num),x.dtype)
+ ret = np.empty((d2,num),x.dtype)
ret[...] = x
return ret
@@ -71,15 +72,15 @@ def zmin_zmax(z, ireg):
ireg = asarray(ireg, dtype=int)
if z.shape != ireg.shape or z.ndim != 2:
raise ValueError, "z and ireg must be the same shape and 2-d"
- ix, iy = nx.nonzero(ireg)
+ ix, iy = np.nonzero(ireg)
# Now, add more indices
x1m = ix - 1
y1m = iy-1
i1 = x1m>=0
i2 = y1m>=0
i3 = i1 & i2
- nix = nx.r_[ix, x1m[i1], x1m[i1], ix[i2] ]
- niy = nx.r_[iy, iy[i1], y1m[i3], y1m[i2]]
+ nix = np.r_[ix, x1m[i1], x1m[i1], ix[i2] ]
+ niy = np.r_[iy, iy[i1], y1m[i3], y1m[i2]]
# remove any negative indices
zres = z[nix,niy]
return zres.min().item(), zres.max().item()
diff --git a/numpy/oldnumeric/compat.py b/numpy/oldnumeric/compat.py
index 7f123fa69..3e1d53d0e 100644
--- a/numpy/oldnumeric/compat.py
+++ b/numpy/oldnumeric/compat.py
@@ -12,7 +12,7 @@ __all__ = ['NewAxis',
import numpy.core.multiarray as multiarray
import numpy.core.umath as um
-from numpy.core.numeric import array, correlate
+from numpy.core.numeric import array
import functions
import sys
diff --git a/numpy/oldnumeric/mlab.py b/numpy/oldnumeric/mlab.py
index 47be89e1b..c11e34c1f 100644
--- a/numpy/oldnumeric/mlab.py
+++ b/numpy/oldnumeric/mlab.py
@@ -1,6 +1,10 @@
# This module is for compatibility only. All functions are defined elsewhere.
-__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle', 'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort', 'LinearAlgebra', 'RandomArray', 'prod', 'std', 'hamming', 'flipud', 'max', 'blackman', 'corrcoef', 'bartlett', 'eye', 'squeeze', 'sinc', 'tri', 'cov', 'svd', 'min', 'median', 'fliplr', 'eig', 'mean']
+__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle',
+ 'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort',
+ 'LinearAlgebra', 'RandomArray', 'prod', 'std', 'hamming', 'flipud',
+ 'max', 'blackman', 'corrcoef', 'bartlett', 'eye', 'squeeze', 'sinc',
+ 'tri', 'cov', 'svd', 'min', 'median', 'fliplr', 'eig', 'mean']
import numpy.oldnumeric.linear_algebra as LinearAlgebra
import numpy.oldnumeric.random_array as RandomArray
@@ -12,7 +16,7 @@ from numpy import tril, trapz as _Ntrapz, hanning, rot90, triu, diff, \
from numpy.linalg import eig, svd
from numpy.random import rand, randn
-import numpy as nn
+import numpy as np
from typeconv import convtypecode
@@ -22,7 +26,7 @@ def eye(N, M=None, k=0, typecode=None, dtype=None):
"""
dtype = convtypecode(typecode, dtype)
if M is None: M = N
- m = nn.equal(nn.subtract.outer(nn.arange(N), nn.arange(M)),-k)
+ m = np.equal(np.subtract.outer(np.arange(N), np.arange(M)),-k)
if m.dtype != dtype:
return m.astype(dtype)
@@ -32,7 +36,7 @@ def tri(N, M=None, k=0, typecode=None, dtype=None):
"""
dtype = convtypecode(typecode, dtype)
if M is None: M = N
- m = nn.greater_equal(nn.subtract.outer(nn.arange(N), nn.arange(M)),-k)
+ m = np.greater_equal(np.subtract.outer(np.arange(N), np.arange(M)),-k)
if m.dtype != dtype:
return m.astype(dtype)
diff --git a/numpy/oldnumeric/rng.py b/numpy/oldnumeric/rng.py
index fcf08bb37..b4c72a68c 100644
--- a/numpy/oldnumeric/rng.py
+++ b/numpy/oldnumeric/rng.py
@@ -4,9 +4,9 @@
# It is for backwards compatibility only.
-__all__ = ['CreateGenerator','ExponentialDistribution','LogNormalDistribution','NormalDistribution',
- 'UniformDistribution', 'error', 'default_distribution', 'random_sample', 'ranf',
- 'standard_generator']
+__all__ = ['CreateGenerator','ExponentialDistribution','LogNormalDistribution',
+ 'NormalDistribution', 'UniformDistribution', 'error', 'ranf',
+ 'default_distribution', 'random_sample', 'standard_generator']
import numpy.random.mtrand as mt
import math
@@ -44,7 +44,7 @@ class ExponentialDistribution(Distribution):
return 0.0
else:
lambda_ = self._args[0]
- return lambda_*exp(-lambda_*x)
+ return lambda_*math.exp(-lambda_*x)
class LogNormalDistribution(Distribution):
def __init__(self, m, s):
@@ -61,7 +61,7 @@ class LogNormalDistribution(Distribution):
def density(x):
m,s = self._args
y = (math.log(x)-self._mn)/self._sn
- return self._fac*exp(-0.5*y*y)/x
+ return self._fac*math.exp(-0.5*y*y)/x
class NormalDistribution(Distribution):
@@ -76,7 +76,7 @@ class NormalDistribution(Distribution):
def density(x):
m,s = self._args
y = (x-m)/s
- return self._fac*exp(-0.5*y*y)
+ return self._fac*math.exp(-0.5*y*y)
class UniformDistribution(Distribution):
def __init__(self, a, b):
diff --git a/numpy/random/info.py b/numpy/random/info.py
index 8c2cae44a..6139e5784 100644
--- a/numpy/random/info.py
+++ b/numpy/random/info.py
@@ -1,6 +1,85 @@
-"""\
-Core Random Tools
-=================
+"""
+========================
+Random Number Generation
+========================
+
+==================== =========================================================
+Utility functions
+==============================================================================
+random Uniformly distributed values of a given shape.
+bytes Uniformly distributed random bytes.
+random_integers Uniformly distributed integers in a given range.
+random_sample Uniformly distributed floats in a given range.
+permutation Randomly permute a sequence / generate a random sequence.
+shuffle Randomly permute a sequence in place.
+seed Seed the random number generator.
+==================== =========================================================
+
+==================== =========================================================
+Compatibility functions
+==============================================================================
+rand Uniformly distributed values.
+randn Normally distributed values.
+ranf Uniformly distributed floating point numbers.
+randint Uniformly distributed integers in a given range.
+==================== =========================================================
+
+==================== =========================================================
+Univariate distributions
+==============================================================================
+beta Beta distribution over ``[0, 1]``.
+binomial Binomial distribution.
+chisquare :math:`\\chi^2` distribution.
+exponential Exponential distribution.
+f F (Fisher-Snedecor) distribution.
+gamma Gamma distribution.
+geometric Geometric distribution.
+gumbel Gumbel distribution.
+hypergeometric Hypergeometric distribution.
+laplace Laplace distribution.
+logistic Logistic distribution.
+lognormal Log-normal distribution.
+logseries Logarithmic series distribution.
+negative_binomial Negative binomial distribution.
+noncentral_chisquare Non-central chi-square distribution.
+noncentral_f Non-central F distribution.
+normal Normal / Gaussian distribution.
+pareto Pareto distribution.
+poisson Poisson distribution.
+power Power distribution.
+rayleigh Rayleigh distribution.
+triangular Triangular distribution.
+uniform Uniform distribution.
+vonmises Von Mises circular distribution.
+wald Wald (inverse Gaussian) distribution.
+weibull Weibull distribution.
+zipf Zipf's distribution over ranked data.
+==================== =========================================================
+
+==================== =========================================================
+Multivariate distributions
+==============================================================================
+dirichlet Multivariate generalization of Beta distribution.
+multinomial Multivariate generalization of the binomial distribution.
+multivariate_normal Multivariate generalization of the normal distribution.
+==================== =========================================================
+
+==================== =========================================================
+Standard distributions
+==============================================================================
+standard_cauchy Standard Cauchy-Lorentz distribution.
+standard_exponential Standard exponential distribution.
+standard_gamma Standard Gamma distribution.
+standard_normal Standard normal distribution.
+standard_t Standard Student's t-distribution.
+==================== =========================================================
+
+==================== =========================================================
+Internal functions
+==============================================================================
+get_state Get tuple representing internal state of generator.
+set_state Set state of generator.
+==================== =========================================================
"""
diff --git a/numpy/random/mtrand/distributions.c b/numpy/random/mtrand/distributions.c
index a4eaff66e..8cd508f7a 100644
--- a/numpy/random/mtrand/distributions.c
+++ b/numpy/random/mtrand/distributions.c
@@ -448,7 +448,7 @@ long rk_binomial(rk_state *state, long n, double p)
}
-long rk_negative_binomial(rk_state *state, long n, double p)
+long rk_negative_binomial(rk_state *state, double n, double p)
{
double Y;
@@ -848,14 +848,29 @@ double rk_triangular(rk_state *state, double left, double mode, double right)
long rk_logseries(rk_state *state, double p)
{
double q, r, U, V;
+ long result;
r = log(1.0 - p);
-
- V = rk_double(state);
- if (V >= p) return 1;
- U = rk_double(state);
- q = 1.0 - exp(r*U);
- if (V <= q*q) return (long)floor(1 + log(V)/log(q));
- if (V <= q) return 1;
- return 2;
+
+ while (1) {
+ V = rk_double(state);
+ if (V >= p) {
+ return 1;
+ }
+ U = rk_double(state);
+ q = 1.0 - exp(r*U);
+ if (V <= q*q) {
+ result = (long)floor(1 + log(V)/log(q));
+ if (result < 1) {
+ continue;
+ }
+ else {
+ return result;
+ }
+ }
+ if (V <= q) {
+ return 1;
+ }
+ return 2;
+ }
}
diff --git a/numpy/random/mtrand/distributions.h b/numpy/random/mtrand/distributions.h
index 0d6de639d..6f60a4ff3 100644
--- a/numpy/random/mtrand/distributions.h
+++ b/numpy/random/mtrand/distributions.h
@@ -103,7 +103,7 @@ extern long rk_binomial_inversion(rk_state *state, long n, double p);
/* Negative binomial distribution computed by generating a Gamma(n, (1-p)/p)
* variate Y and returning a Poisson(Y) variate (Devroye p. 543). */
-extern long rk_negative_binomial(rk_state *state, long n, double p);
+extern long rk_negative_binomial(rk_state *state, double n, double p);
/* Poisson distribution with mean=lam.
* When lam < 10, a basic algorithm using repeated multiplications of uniform
diff --git a/numpy/random/mtrand/mtrand.c b/numpy/random/mtrand/mtrand.c
index cec6d95d9..96812f620 100644
--- a/numpy/random/mtrand/mtrand.c
+++ b/numpy/random/mtrand/mtrand.c
@@ -1,4 +1,4 @@
-/* 0.9.7 on Fri Aug 8 02:36:33 2008 */
+/* Generated by Pyrex 0.9.6.4 on Sun Aug 24 16:14:30 2008 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -83,6 +83,8 @@ typedef long (*__pyx_t_6mtrand_rk_disc0)(rk_state *);
typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *,long,double);
+typedef long (*__pyx_t_6mtrand_rk_discdd)(rk_state *,double,double);
+
typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *,long,long,long);
typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *,double);
@@ -167,6 +169,8 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *,__pyx_t_6mtrand_rk_cont3
static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *,__pyx_t_6mtrand_rk_disc0,PyObject *); /*proto*/
static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *,__pyx_t_6mtrand_rk_discnp,PyObject *,long,double); /*proto*/
static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *,__pyx_t_6mtrand_rk_discnp,PyObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *,__pyx_t_6mtrand_rk_discdd,PyObject *,double,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *,__pyx_t_6mtrand_rk_discdd,PyObject *,PyArrayObject *,PyArrayObject *); /*proto*/
static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *,__pyx_t_6mtrand_rk_discnmN,PyObject *,long,long,long); /*proto*/
static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *,__pyx_t_6mtrand_rk_discnmN,PyObject *,PyArrayObject *,PyArrayObject *,PyArrayObject *); /*proto*/
static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *,__pyx_t_6mtrand_rk_discd,PyObject *,double); /*proto*/
@@ -243,10 +247,10 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state,__pyx_t_6mt
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":130 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":131 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -254,19 +258,19 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state,__pyx_t_6mt
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":133 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":134 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -274,18 +278,18 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state,__pyx_t_6mt
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":134 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":135 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":135 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":136 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":136 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":137 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":138 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":139 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -319,10 +323,10 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state,__pyx_t_
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":147 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":148 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -330,19 +334,19 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state,__pyx_t_
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":150 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":151 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -350,18 +354,18 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state,__pyx_t_
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":151 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":152 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":152 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":153 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":153 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":154 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":155 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":156 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -382,6 +386,8 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state,__pyx_t_
return __pyx_r;
}
+static PyObject *__pyx_n_ValueError;
+
static PyObject *__pyx_k61p;
static char __pyx_k61[] = "size is not compatible with inputs";
@@ -406,56 +412,56 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state,__pyx_t_6mt
__pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":166 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":167 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":167 */
- __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":168 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":168 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":169 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":169 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":170 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":170 */
- __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":171 */
+ __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_itera));
__pyx_v_itera = ((PyArrayIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":171 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":172 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":172 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":173 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":173 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":174 */
PyArray_ITER_NEXT(__pyx_v_itera);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":175 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":176 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -463,48 +469,50 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state,__pyx_t_6mt
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":176 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":177 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":177 */
- __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":178 */
+ __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":179 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":180 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
Py_INCREF(__pyx_k61p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k61p);
- __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k61p);
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":181 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":182 */
__pyx_5 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":182 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":183 */
__pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":183 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":184 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":184 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":185 */
PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
}
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":185 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":186 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -539,10 +547,10 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state,__pyx_t_
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":194 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":195 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -550,19 +558,19 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state,__pyx_t_
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":197 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":198 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -570,18 +578,18 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state,__pyx_t_
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":198 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":199 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":199 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":200 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":200 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":201 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":202 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":203 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -625,60 +633,60 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state,__pyx_t_6mt
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":215 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":216 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":216 */
- __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":217 */
+ __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":217 */
- __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":218 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":218 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":219 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":219 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":220 */
__pyx_3 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":220 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":221 */
__pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":221 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":222 */
__pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":222 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":223 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":223 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":224 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":225 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":226 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5);
__pyx_5 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
@@ -686,54 +694,56 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state,__pyx_t_6mt
arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":226 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":227 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":227 */
- __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":228 */
+ __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":228 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":229 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
Py_INCREF(__pyx_k62p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k62p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":230 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":231 */
__pyx_3 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":231 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":232 */
__pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":232 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":233 */
__pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":233 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":234 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":234 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":235 */
PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":235 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":236 */
PyArray_MultiIter_NEXTi(__pyx_v_multi,2);
}
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":236 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":237 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -768,10 +778,10 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state,__pyx_t_
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":246 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":247 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -779,19 +789,19 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state,__pyx_t_
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":249 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":250 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -799,18 +809,18 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state,__pyx_t_
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":250 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":251 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":251 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":252 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":252 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":253 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":254 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":255 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -856,63 +866,63 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state,__pyx_t_6mt
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":268 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":269 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":269 */
- __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":270 */
+ __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":270 */
- __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":271 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":271 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":272 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":272 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":273 */
__pyx_3 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":273 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":274 */
__pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":274 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":275 */
__pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":275 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":276 */
__pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":276 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":277 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]),(__pyx_v_oc_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":277 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":278 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":279 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":280 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5);
__pyx_5 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
@@ -920,54 +930,56 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state,__pyx_t_6mt
arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":280 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":281 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":281 */
- __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":282 */
+ __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":283 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":284 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}
Py_INCREF(__pyx_k63p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k63p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k63p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":285 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":286 */
__pyx_3 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":286 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":287 */
__pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":287 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":288 */
__pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":288 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":289 */
__pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,3));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":289 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":290 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]),(__pyx_v_oc_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":290 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":291 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":291 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":292 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -990,6 +1002,8 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state,__pyx_t_6mt
return __pyx_r;
}
+static PyObject *__pyx_n_int;
+
static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_disc0 __pyx_v_func,PyObject *__pyx_v_size) {
long *__pyx_v_array_data;
PyArrayObject *arrayObject;
@@ -1003,10 +1017,10 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state,__pyx_t_6mt
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":299 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":300 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -1014,35 +1028,36 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state,__pyx_t_6mt
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":302 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":303 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":303 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":304 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":304 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":305 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":305 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":306 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":307 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":308 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1076,10 +1091,10 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state,__pyx_t
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":315 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":316 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -1087,35 +1102,36 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state,__pyx_t
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":318 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":319 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":319 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":320 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":320 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":321 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":321 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":322 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":323 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":324 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1159,112 +1175,115 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state,__pyx_t_6m
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":334 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":335 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":335 */
- __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":336 */
+ __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":336 */
- __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":337 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":337 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":338 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":338 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":339 */
__pyx_3 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":339 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":340 */
__pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":340 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":341 */
__pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":341 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":342 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":342 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":343 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":344 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":345 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":345 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":346 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":346 */
- __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":347 */
+ __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":347 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":348 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}
Py_INCREF(__pyx_k64p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k64p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":349 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":350 */
__pyx_3 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":350 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":351 */
__pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":351 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":352 */
__pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":352 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":353 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":353 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":354 */
PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":354 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":355 */
PyArray_MultiIter_NEXTi(__pyx_v_multi,2);
}
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":356 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":357 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1286,7 +1305,7 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state,__pyx_t_6m
return __pyx_r;
}
-static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnmN __pyx_v_func,PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {
+static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discdd __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_n,double __pyx_v_p) {
long *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -1299,10 +1318,10 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state,__pyx_
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":365 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":365 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -1310,35 +1329,263 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state,__pyx_
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":368 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":368 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":369 */
+ __pyx_v_length = PyArray_SIZE(arrayObject);
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":370 */
+ __pyx_v_array_data = ((long *)arrayObject->data);
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":371 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);
+ }
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":373 */
+ Py_INCREF(((PyObject *)arrayObject));
+ __pyx_r = ((PyObject *)arrayObject);
+ goto __pyx_L0;
+ }
+ __pyx_L2:;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_3);
+ Py_XDECREF(__pyx_4);
+ __Pyx_AddTraceback("mtrand.discdd_array_sc");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_k65p;
+
+static char __pyx_k65[] = "size is not compatible with inputs";
+
+static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discdd __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_on,PyArrayObject *__pyx_v_op) {
+ long *__pyx_v_array_data;
+ PyArrayObject *arrayObject;
+ npy_intp __pyx_v_i;
+ double *__pyx_v_op_data;
+ double *__pyx_v_on_data;
+ PyArrayMultiIterObject *__pyx_v_multi;
+ PyObject *__pyx_r;
+ int __pyx_1;
+ PyObject *__pyx_2 = 0;
+ npy_intp __pyx_3;
+ PyObject *__pyx_4 = 0;
+ PyObject *__pyx_5 = 0;
+ Py_INCREF(__pyx_v_size);
+ Py_INCREF(__pyx_v_on);
+ Py_INCREF(__pyx_v_op);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":384 */
+ __pyx_1 = __pyx_v_size == Py_None;
+ if (__pyx_1) {
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":385 */
+ __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)__pyx_v_multi));
+ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":386 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":387 */
+ __pyx_v_array_data = ((long *)arrayObject->data);
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":388 */
+ __pyx_3 = __pyx_v_multi->size;
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":389 */
+ __pyx_v_on_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":390 */
+ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":391 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]));
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":392 */
+ PyArray_MultiIter_NEXT(__pyx_v_multi);
+ }
+ goto __pyx_L2;
+ }
+ /*else*/ {
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":394 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;}
+ Py_INCREF(__pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":395 */
+ __pyx_v_array_data = ((long *)arrayObject->data);
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":396 */
+ __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
+ Py_DECREF(((PyObject *)__pyx_v_multi));
+ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":397 */
+ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
+ if (__pyx_1) {
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
+ Py_INCREF(__pyx_k65p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k65p);
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":399 */
+ __pyx_3 = __pyx_v_multi->size;
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":400 */
+ __pyx_v_on_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":401 */
+ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":402 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":369 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":403 */
+ PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":404 */
+ PyArray_MultiIter_NEXTi(__pyx_v_multi,2);
+ }
+ }
+ __pyx_L2:;
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":406 */
+ Py_INCREF(((PyObject *)arrayObject));
+ __pyx_r = ((PyObject *)arrayObject);
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_4);
+ Py_XDECREF(__pyx_5);
+ __Pyx_AddTraceback("mtrand.discdd_array");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_multi);
+ Py_DECREF(__pyx_v_size);
+ Py_DECREF(__pyx_v_on);
+ Py_DECREF(__pyx_v_op);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnmN __pyx_v_func,PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {
+ long *__pyx_v_array_data;
+ PyArrayObject *arrayObject;
+ long __pyx_v_length;
+ long __pyx_v_i;
+ PyObject *__pyx_r;
+ int __pyx_1;
+ PyObject *__pyx_2 = 0;
+ PyObject *__pyx_3 = 0;
+ PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":415 */
+ __pyx_1 = __pyx_v_size == Py_None;
+ if (__pyx_1) {
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;}
+ __pyx_r = __pyx_2;
+ __pyx_2 = 0;
+ goto __pyx_L0;
+ goto __pyx_L2;
+ }
+ /*else*/ {
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":418 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+ Py_INCREF(__pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":419 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":370 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":420 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":371 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":421 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":373 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":423 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1359,9 +1606,9 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state,__pyx_
return __pyx_r;
}
-static PyObject *__pyx_k65p;
+static PyObject *__pyx_k66p;
-static char __pyx_k65[] = "size is not compatible with inputs";
+static char __pyx_k66[] = "size is not compatible with inputs";
static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnmN __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_on,PyArrayObject *__pyx_v_om,PyArrayObject *__pyx_v_oN) {
long *__pyx_v_array_data;
@@ -1384,115 +1631,118 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state,__pyx_t_6
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":386 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":436 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":387 */
- __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":437 */
+ __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":388 */
- __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":438 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":389 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":439 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":390 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":440 */
__pyx_3 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":391 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":441 */
__pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":392 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":442 */
__pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":393 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":443 */
__pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":394 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":444 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_om_data[0]),(__pyx_v_oN_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":395 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":445 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":397 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":447 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":398 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":448 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":399 */
- __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":449 */
+ __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":401 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":451 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
- Py_INCREF(__pyx_k65p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k65p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
+ Py_INCREF(__pyx_k66p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k66p);
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":403 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":453 */
__pyx_3 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":404 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":454 */
__pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":405 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":455 */
__pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":406 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":456 */
__pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,3));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":407 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":457 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_om_data[0]),(__pyx_v_oN_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":408 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":458 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":410 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":460 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1528,10 +1778,10 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state,__pyx_t_
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":418 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":468 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -1539,35 +1789,36 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state,__pyx_t_
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":421 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":471 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":422 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":472 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":423 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":473 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":424 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":474 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":426 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":476 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1588,9 +1839,9 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state,__pyx_t_
return __pyx_r;
}
-static PyObject *__pyx_k66p;
+static PyObject *__pyx_k67p;
-static char __pyx_k66[] = "size is not compatible with inputs";
+static char __pyx_k67[] = "size is not compatible with inputs";
static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discd __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa) {
long *__pyx_v_array_data;
@@ -1612,102 +1863,105 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state,__pyx_t_6mt
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":437 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":487 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":438 */
- __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":488 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":439 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":489 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":440 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":490 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":441 */
- __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":491 */
+ __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_itera));
__pyx_v_itera = ((PyArrayIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":442 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":492 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":443 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":493 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":444 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":494 */
PyArray_ITER_NEXT(__pyx_v_itera);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":446 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":496 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":447 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":497 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":448 */
- __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":498 */
+ __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":449 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":499 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
- Py_INCREF(__pyx_k66p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k66p);
- __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
+ Py_INCREF(__pyx_k67p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k67p);
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":451 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":501 */
__pyx_5 = __pyx_v_multi->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":452 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":502 */
__pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":453 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":503 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":454 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":504 */
PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
}
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":455 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":505 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1737,29 +1991,29 @@ static double __pyx_f_6mtrand_kahan_sum(double *__pyx_v_darr,long __pyx_v_n) {
long __pyx_v_i;
double __pyx_r;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":460 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":510 */
__pyx_v_sum = (__pyx_v_darr[0]);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":461 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":511 */
__pyx_v_c = 0.0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":462 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":512 */
for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":463 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":513 */
__pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":464 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":514 */
__pyx_v_t = (__pyx_v_sum + __pyx_v_y);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":465 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":515 */
__pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":466 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":516 */
__pyx_v_sum = __pyx_v_t;
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":467 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":517 */
__pyx_r = __pyx_v_sum;
goto __pyx_L0;
@@ -1781,15 +2035,15 @@ static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObje
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_seed);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":497 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":547 */
((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state))));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":499 */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":549 */
+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}
Py_INCREF(__pyx_v_seed);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);
- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
@@ -1815,10 +2069,10 @@ static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {
__pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL);
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":503 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":553 */
PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":504 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":554 */
((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = NULL;
goto __pyx_L2;
}
@@ -1827,6 +2081,7 @@ static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {
Py_DECREF(__pyx_v_self);
}
+static PyObject *__pyx_n_type;
static PyObject *__pyx_n_integer;
static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
@@ -1840,7 +2095,8 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
- unsigned long __pyx_4;
+ PyObject *__pyx_4 = 0;
+ unsigned long __pyx_5;
static char *__pyx_argnames[] = {"seed",0};
__pyx_v_seed = __pyx_k3;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed)) return 0;
@@ -1849,56 +2105,62 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb
arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_iseed = Py_None; Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":520 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":570 */
__pyx_1 = __pyx_v_seed == Py_None;
if (__pyx_1) {
__pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
goto __pyx_L2;
}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
Py_INCREF(__pyx_v_seed);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);
- __pyx_3 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = __pyx_3 == ((PyObject *)(&PyInt_Type));
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
+ __pyx_1 = __pyx_4 == __pyx_2;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
- rk_seed(__pyx_4,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+ __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}
+ rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
goto __pyx_L2;
}
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsInstance(__pyx_v_seed,__pyx_3); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_integer); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsInstance(__pyx_v_seed,__pyx_4); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":525 */
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":575 */
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
Py_INCREF(__pyx_v_seed);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);
- __pyx_3 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_iseed);
- __pyx_v_iseed = __pyx_3;
- __pyx_3 = 0;
+ __pyx_v_iseed = __pyx_4;
+ __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":526 */
- __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}
- rk_seed(__pyx_4,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":576 */
+ __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L1;}
+ rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
goto __pyx_L2;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":528 */
- __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":578 */
+ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject_obj));
arrayObject_obj = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":529 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":579 */
init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long *)arrayObject_obj->data),(arrayObject_obj->dimensions[0]));
}
__pyx_L2:;
@@ -1908,6 +2170,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
+ Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("mtrand.RandomState.seed");
__pyx_r = 0;
__pyx_L0:;
@@ -1938,20 +2201,20 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,
Py_INCREF(__pyx_v_self);
arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":542 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":592 */
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
+ __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
__pyx_1 = 0;
__pyx_4 = 0;
- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1)));
@@ -1959,22 +2222,22 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,
arrayObject_state = ((PyArrayObject *)__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":543 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":593 */
memcpy(((void *)arrayObject_state->data),((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),(624 * (sizeof(long))));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":544 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":594 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;}
Py_INCREF(((PyObject *)arrayObject_state));
PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)arrayObject_state));
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_1);
__pyx_1 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
@@ -1982,11 +2245,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,
arrayObject_state = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":545 */
- __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
- __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":595 */
+ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;}
Py_INCREF(__pyx_n_MT19937);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_MT19937);
Py_INCREF(((PyObject *)arrayObject_state));
@@ -2016,11 +2279,13 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,
return __pyx_r;
}
-static PyObject *__pyx_k69p;
+static PyObject *__pyx_n_TypeError;
+
static PyObject *__pyx_k70p;
+static PyObject *__pyx_k71p;
-static char __pyx_k69[] = "algorithm must be 'MT19937'";
-static char __pyx_k70[] = "state must be 624 longs";
+static char __pyx_k70[] = "algorithm must be 'MT19937'";
+static char __pyx_k71[] = "state must be 624 longs";
static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_set_state[] = "\n set_state(state)\n\n Set the state from a tuple.\n\n state = (\'MT19937\', int key[624], int pos, int has_gauss, float cached_gaussian)\n\n For backwards compatibility, the following form is also accepted\n although it is missing some information about the cached Gaussian value.\n\n state = (\'MT19937\', int key[624], int pos)\n\n ";
@@ -2034,10 +2299,10 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,
PyObject *__pyx_v_cached_gaussian;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
- int __pyx_2;
- PyObject *__pyx_3 = 0;
- Py_ssize_t __pyx_4;
- PyObject *__pyx_5 = 0;
+ PyObject *__pyx_2 = 0;
+ int __pyx_3;
+ PyObject *__pyx_4 = 0;
+ Py_ssize_t __pyx_5;
PyObject *__pyx_6 = 0;
double __pyx_7;
static char *__pyx_argnames[] = {"state",0};
@@ -2050,81 +2315,85 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,
__pyx_v_has_gauss = Py_None; Py_INCREF(Py_None);
__pyx_v_cached_gaussian = Py_None; Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":564 */
- __pyx_1 = PySequence_GetItem(__pyx_v_state, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":614 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_algorithm_name);
- __pyx_v_algorithm_name = __pyx_1;
- __pyx_1 = 0;
+ __pyx_v_algorithm_name = __pyx_2;
+ __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":565 */
- if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}
- __pyx_2 = __pyx_2 != 0;
- if (__pyx_2) {
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;}
- Py_INCREF(__pyx_k69p);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k69p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":615 */
+ if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;}
+ __pyx_3 = __pyx_3 != 0;
+ if (__pyx_3) {
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;}
+ Py_INCREF(__pyx_k70p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k70p);
+ __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":567 */
- __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;}
- __pyx_3 = PyObject_GetIter(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":617 */
+ __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;}
+ __pyx_4 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
Py_DECREF(__pyx_v_key);
- __pyx_v_key = __pyx_1;
- __pyx_1 = 0;
- __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;}
- __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;}
+ __pyx_v_key = __pyx_4;
+ __pyx_4 = 0;
+ __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
+ __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_v_pos = __pyx_2;
- if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_v_pos = __pyx_3;
+ if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":568 */
- __pyx_4 = PyObject_Length(__pyx_v_state); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; goto __pyx_L1;}
- __pyx_2 = (__pyx_4 == 3);
- if (__pyx_2) {
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":618 */
+ __pyx_5 = PyObject_Length(__pyx_v_state); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}
+ __pyx_3 = (__pyx_5 == 3);
+ if (__pyx_3) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":569 */
- __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":619 */
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}
Py_DECREF(__pyx_v_has_gauss);
- __pyx_v_has_gauss = __pyx_1;
- __pyx_1 = 0;
+ __pyx_v_has_gauss = __pyx_4;
+ __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":570 */
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":620 */
+ __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; goto __pyx_L1;}
Py_DECREF(__pyx_v_cached_gaussian);
- __pyx_v_cached_gaussian = __pyx_3;
- __pyx_3 = 0;
+ __pyx_v_cached_gaussian = __pyx_1;
+ __pyx_1 = 0;
goto __pyx_L3;
}
/*else*/ {
- __pyx_1 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
- __pyx_3 = PyObject_GetIter(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
+ __pyx_2 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetIter(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
Py_DECREF(__pyx_v_has_gauss);
__pyx_v_has_gauss = __pyx_1;
__pyx_1 = 0;
- __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
+ __pyx_2 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
Py_DECREF(__pyx_v_cached_gaussian);
- __pyx_v_cached_gaussian = __pyx_1;
- __pyx_1 = 0;
- if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_v_cached_gaussian = __pyx_2;
+ __pyx_2 = 0;
+ if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":573 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":623 */
/*try:*/ {
- __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L4;}
+ __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; goto __pyx_L4;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1)));
Py_DECREF(((PyObject *)arrayObject_obj));
arrayObject_obj = ((PyArrayObject *)__pyx_1);
@@ -2132,62 +2401,67 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,
}
goto __pyx_L5;
__pyx_L4:;
- Py_XDECREF(__pyx_3); __pyx_3 = 0;
+ Py_XDECREF(__pyx_2); __pyx_2 = 0;
+ Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":575 */
- __pyx_2 = PyErr_ExceptionMatches(PyExc_TypeError);
- if (__pyx_2) {
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":625 */
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; goto __pyx_L1;}
+ __pyx_3 = PyErr_ExceptionMatches(__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ if (__pyx_3) {
__Pyx_AddTraceback("mtrand.set_state");
- if (__Pyx_GetException(&__pyx_3, &__pyx_1, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
- __pyx_6 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}
+ if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; goto __pyx_L1;}
+ __pyx_6 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_6)));
Py_DECREF(((PyObject *)arrayObject_obj));
arrayObject_obj = ((PyArrayObject *)__pyx_6);
Py_DECREF(__pyx_6); __pyx_6 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
goto __pyx_L5;
}
goto __pyx_L1;
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":578 */
- __pyx_2 = ((arrayObject_obj->dimensions[0]) != 624);
- if (__pyx_2) {
- __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;}
- Py_INCREF(__pyx_k70p);
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k70p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":628 */
+ __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);
+ if (__pyx_3) {
+ __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;}
+ Py_INCREF(__pyx_k71p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k71p);
+ __pyx_1 = PyObject_CallObject(__pyx_6, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_1, 0, 0);
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":580 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":630 */
memcpy(((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),((void *)arrayObject_obj->data),(624 * (sizeof(long))));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":581 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":631 */
((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":582 */
- __pyx_2 = PyInt_AsLong(__pyx_v_has_gauss); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}
- ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_2;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":632 */
+ __pyx_3 = PyInt_AsLong(__pyx_v_has_gauss); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}
+ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_3;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":583 */
- __pyx_7 = PyFloat_AsDouble(__pyx_v_cached_gaussian); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":633 */
+ __pyx_7 = PyFloat_AsDouble(__pyx_v_cached_gaussian); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; goto __pyx_L1;}
((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_7;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_3);
- Py_XDECREF(__pyx_5);
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("mtrand.RandomState.set_state");
__pyx_r = 0;
@@ -2210,8 +2484,8 @@ static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_se
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}
- __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
@@ -2240,11 +2514,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_se
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_state);
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;}
Py_INCREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);
- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
@@ -2276,16 +2550,16 @@ static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
- __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_4);
@@ -2321,7 +2595,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_s
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_size);
- __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;}
+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -2349,7 +2623,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self,
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_size);
- __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}
+ __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -2366,9 +2640,9 @@ static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self,
return __pyx_r;
}
-static PyObject *__pyx_k71p;
+static PyObject *__pyx_k72p;
-static char __pyx_k71[] = "low >= high";
+static char __pyx_k72[] = "low >= high";
static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_randint[] = "\n randint(low, high=None, size=None)\n\n Return random integers x such that low <= x < high.\n\n If high is None, then 0 <= x < low.\n\n ";
@@ -2399,52 +2673,54 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P
Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":648 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":698 */
__pyx_1 = __pyx_v_high == Py_None;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":649 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":699 */
__pyx_v_lo = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":650 */
- __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":700 */
+ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}
__pyx_v_hi = __pyx_2;
goto __pyx_L2;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":652 */
- __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":702 */
+ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}
__pyx_v_lo = __pyx_2;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":653 */
- __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":703 */
+ __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;}
__pyx_v_hi = __pyx_2;
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":655 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":705 */
__pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":656 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":706 */
__pyx_1 = (__pyx_v_diff < 0);
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;}
- Py_INCREF(__pyx_k71p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);
- __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;}
+ Py_INCREF(__pyx_k72p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k72p);
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_5, 0, 0);
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":659 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":709 */
__pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- __pyx_3 = PyInt_FromLong((((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)) + __pyx_v_lo)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong((((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)) + __pyx_v_lo)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; goto __pyx_L1;}
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;
@@ -2452,35 +2728,36 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":662 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":712 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_5);
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ arrayObject = ((PyArrayObject *)__pyx_3);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":663 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":713 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":664 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":714 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":665 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":715 */
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":667 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":717 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -2517,19 +2794,19 @@ static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyO
Py_INCREF(__pyx_v_self);
__pyx_v_bytestring = Py_None; Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":692 */
- __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":742 */
+ __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; goto __pyx_L1;}
Py_DECREF(__pyx_v_bytestring);
__pyx_v_bytestring = __pyx_1;
__pyx_1 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":693 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":743 */
__pyx_v_bytes = PyString_AS_STRING(__pyx_v_bytestring);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":694 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":744 */
rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":695 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":745 */
Py_INCREF(__pyx_v_bytestring);
__pyx_r = __pyx_v_bytestring;
goto __pyx_L0;
@@ -2579,16 +2856,16 @@ static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, P
__pyx_v_odiff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_temp = Py_None; Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":772 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":822 */
__pyx_v_flow = PyFloat_AsDouble(__pyx_v_low);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":773 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":823 */
__pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":774 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":824 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_flow,(__pyx_v_fhigh - __pyx_v_flow)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;}
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_flow,(__pyx_v_fhigh - __pyx_v_flow)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -2596,51 +2873,51 @@ static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, P
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":776 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":826 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":777 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":827 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_olow));
__pyx_v_olow = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":778 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":828 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_ohigh));
__pyx_v_ohigh = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":779 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":829 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_ohigh));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ohigh));
Py_INCREF(((PyObject *)__pyx_v_olow));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_olow));
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_temp);
__pyx_v_temp = __pyx_4;
__pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":780 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":830 */
Py_INCREF(__pyx_v_temp);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":782 */
- __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":832 */
+ __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_odiff));
__pyx_v_odiff = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":783 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_olow,__pyx_v_odiff); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":833 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_olow,__pyx_v_odiff); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -2688,11 +2965,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb
return 0;
}
Py_INCREF(__pyx_v_self);
- __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}
+ __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; goto __pyx_L1;}
__pyx_2 = (__pyx_1 == 0);
if (__pyx_2) {
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}
- __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
@@ -2700,11 +2977,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb
goto __pyx_L2;
}
/*else*/ {
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}
- __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}
- if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}
- __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}
+ __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}
+ if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}
+ __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
@@ -2750,11 +3027,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO
return 0;
}
Py_INCREF(__pyx_v_self);
- __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;}
+ __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; goto __pyx_L1;}
__pyx_2 = (__pyx_1 == 0);
if (__pyx_2) {
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;}
- __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
@@ -2762,11 +3039,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO
goto __pyx_L2;
}
/*else*/ {
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
Py_INCREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_args);
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_5;
@@ -2811,17 +3088,17 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v
Py_INCREF(__pyx_v_high);
Py_INCREF(__pyx_v_size);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":854 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":904 */
__pyx_1 = __pyx_v_high == Py_None;
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":855 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":905 */
Py_INCREF(__pyx_v_low);
Py_DECREF(__pyx_v_high);
__pyx_v_high = __pyx_v_low;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":856 */
- __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":906 */
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;}
Py_DECREF(__pyx_v_low);
__pyx_v_low = __pyx_2;
__pyx_2 = 0;
@@ -2829,19 +3106,19 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":857 */
- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}
- __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}
- __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":907 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;}
+ __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;}
Py_INCREF(__pyx_v_low);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);
__pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
@@ -2875,7 +3152,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_size);
- __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}
+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -2895,11 +3172,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v
static PyObject *__pyx_n_any;
static PyObject *__pyx_n_less_equal;
-static PyObject *__pyx_k73p;
static PyObject *__pyx_k74p;
+static PyObject *__pyx_k75p;
-static char __pyx_k73[] = "scale <= 0";
static char __pyx_k74[] = "scale <= 0";
+static char __pyx_k75[] = "scale <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_normal[] = "\n normal(loc=0.0, scale=1.0, size=None)\n\n Draw random samples from a normal (Gaussian) distribution.\n\n The probability density function of the normal distribution, first\n derived by De Moivre and 200 years later by both Gauss and Laplace\n independently [2]_, is often called the bell curve because of\n its characteristic shape (see the example below).\n\n The normal distributions occurs often in nature. For example, it\n describes the commonly occurring distribution of samples influenced\n by a large number of tiny, random disturbances, each with its own\n unique distribution [2]_.\n\n Parameters\n ----------\n loc : float\n Mean (\"centre\") of the distribution.\n scale : float\n Standard deviation (spread or \"width\") of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.distributions.norm : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Gaussian distribution is\n\n .. math:: p(x) = \\frac{1}{\\sqrt{ 2 \\pi \\sigma^2 }}\n e^{ - \\frac{ (x - \\mu)^2 } {2 \\sigma^2} },\n\n where :math:`\\mu` is the mean and :math:`\\sigma` the standard deviation.\n The square of the standard deviation, :math:`\\sigma^2`, is called the\n variance.\n\n The function has its peak at the mean, and its \"spread\" increases with\n the standard deviation (the function reaches 0.607 times its maximum at\n :math:`x + \\sigma` and :math:`x - \\sigma` [2]_). This implies that\n `numpy.random.normal` is more likely to return samples lying close to the\n mean, rather than those far away.\n\n References\n ----------\n .. [1] Wikipedia, \"Normal distribution\",\n http://en.wikipedia.org/wiki/Normal_distribution\n .. [2] P. R. Peebles Jr., \"Central Limit Theorem\" in \"Probability, Random\n Variables and Random Signal Principles\", 4th ed., 2001,\n pp. 51, 51, 125.\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, sigma = 0, 0.1 # mean and standard deviation\n >>> s = np.random.normal(mu, sigma, 1000)\n\n Verify the mean and the variance:\n\n >>> abs(mu - np.mean(s)) < 0.01\n True\n\n >>> abs(sigma - np.std(s, ddof=1)) < 0.01\n True\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 30, normed=True)\n >>> plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) *\n ... np.exp( - (bins - mu)**2 / (2 * sigma**2) ),\n ... linewidth=2, color=\'r\')\n >>> plt.show()\n\n ";
@@ -2929,33 +3206,35 @@ static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, Py
__pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":954 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1004 */
__pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":955 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1005 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":956 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1006 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":957 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1007 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}
- Py_INCREF(__pyx_k73p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k73p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;}
+ Py_INCREF(__pyx_k74p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":959 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1009 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -2963,64 +3242,66 @@ static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, Py
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":961 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1011 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":963 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1013 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oloc));
__pyx_v_oloc = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":964 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1014 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_oscale));
- __pyx_v_oscale = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":965 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1015 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oscale));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}
- Py_INCREF(__pyx_k74p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;}
+ Py_INCREF(__pyx_k75p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":967 */
- __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1017 */
+ __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -3042,15 +3323,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-static PyObject *__pyx_k75p;
static PyObject *__pyx_k76p;
static PyObject *__pyx_k77p;
static PyObject *__pyx_k78p;
+static PyObject *__pyx_k79p;
-static char __pyx_k75[] = "a <= 0";
-static char __pyx_k76[] = "b <= 0";
-static char __pyx_k77[] = "a <= 0";
-static char __pyx_k78[] = "b <= 0";
+static char __pyx_k76[] = "a <= 0";
+static char __pyx_k77[] = "b <= 0";
+static char __pyx_k78[] = "a <= 0";
+static char __pyx_k79[] = "b <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_beta[] = "\n beta(a, b, size=None)\n\n The Beta distribution over ``[0, 1]``.\n\n The Beta distribution is a special case of the Dirichlet distribution,\n and is related to the Gamma distribution. It has the probability\n distribution function\n\n .. math:: f(x; a,b) = \\frac{1}{B(\\alpha, \\beta)} x^{\\alpha - 1}\n (1 - x)^{\\beta - 1},\n\n where the normalisation, B, is the beta function,\n\n .. math:: B(\\alpha, \\beta) = \\int_0^1 t^{\\alpha - 1}\n (1 - t)^{\\beta - 1} dt.\n\n It is often seen in Bayesian inference and order statistics.\n\n Parameters\n ----------\n a : float\n Alpha, non-negative.\n b : float\n Beta, non-negative.\n size : tuple of ints, optional\n The number of samples to draw. The ouput is packed according to\n the size given.\n\n Returns\n -------\n out : ndarray\n Array of the given shape, containing values drawn from a\n Beta distribution.\n\n ";
@@ -3078,48 +3359,52 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_ob = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1009 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1059 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1010 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1060 */
__pyx_v_fb = PyFloat_AsDouble(__pyx_v_b);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1011 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1061 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1012 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1062 */
__pyx_1 = (__pyx_v_fa <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;}
- Py_INCREF(__pyx_k75p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k75p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; goto __pyx_L1;}
+ Py_INCREF(__pyx_k76p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1014 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1064 */
__pyx_1 = (__pyx_v_fb <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
- Py_INCREF(__pyx_k76p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k76p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;}
+ Py_INCREF(__pyx_k77p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1016 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_fa,__pyx_v_fb); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1066 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_fa,__pyx_v_fb); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -3127,101 +3412,105 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1018 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1068 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1020 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1070 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oa));
__pyx_v_oa = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1021 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1071 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_ob));
- __pyx_v_ob = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_ob = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1022 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1072 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oa));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;}
- Py_INCREF(__pyx_k77p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;}
+ Py_INCREF(__pyx_k78p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1024 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1074 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
+ __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_ob));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_ob));
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;}
- Py_INCREF(__pyx_k78p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k78p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
+ Py_INCREF(__pyx_k79p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k79p);
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1026 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_oa,__pyx_v_ob); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;}
- __pyx_r = __pyx_2;
- __pyx_2 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1076 */
+ __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_oa,__pyx_v_ob); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}
+ __pyx_r = __pyx_3;
+ __pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -3243,11 +3532,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-static PyObject *__pyx_k79p;
static PyObject *__pyx_k80p;
+static PyObject *__pyx_k81p;
-static char __pyx_k79[] = "scale <= 0";
static char __pyx_k80[] = "scale <= 0";
+static char __pyx_k81[] = "scale <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_exponential[] = "\n exponential(scale=1.0, size=None)\n\n Exponential distribution.\n\n Its probability density function is\n\n .. math:: f(x; \\lambda) = \\lambda \\exp(-\\lambda x),\n\n for ``x > 0`` and 0 elsewhere. :math:`lambda` is\n known as the rate parameter.\n\n The exponential distribution is a continuous analogue of the\n geometric distribution. It describes many common situations, such as\n the size of raindrops measured over many rainstorms [1]_, or the time\n between page requests to Wikipedia [2]_.\n\n Parameters\n ----------\n scale : float\n The rate parameter, :math:`\\lambda`.\n size : tuple of ints\n Number of samples to draw. The output is shaped\n according to `size`.\n\n References\n ----------\n .. [1] Peyton Z. Peebles Jr., \"Probability, Random Variables and\n Random Signal Principles\", 4th ed, 2001, p. 57.\n .. [2] \"Poisson Process\", Wikipedia,\n http://en.wikipedia.org/wiki/Poisson_process\n\n ";
@@ -3271,30 +3560,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_sel
Py_INCREF(__pyx_v_size);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1065 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1115 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1066 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1116 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1067 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1117 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
- Py_INCREF(__pyx_k79p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k79p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;}
+ Py_INCREF(__pyx_k80p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1069 */
- __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1119 */
+ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -3302,57 +3593,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_sel
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1071 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1121 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1073 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1123 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oscale));
__pyx_v_oscale = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1074 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1124 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oscale));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
- Py_INCREF(__pyx_k80p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k80p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
+ Py_INCREF(__pyx_k81p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k81p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1076 */
- __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1126 */
+ __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -3383,7 +3676,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_size);
- __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; goto __pyx_L1;}
+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -3400,11 +3693,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__
return __pyx_r;
}
-static PyObject *__pyx_k81p;
static PyObject *__pyx_k82p;
+static PyObject *__pyx_k83p;
-static char __pyx_k81[] = "shape <= 0";
static char __pyx_k82[] = "shape <= 0";
+static char __pyx_k83[] = "shape <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = "\n standard_gamma(shape, size=None)\n\n Standard Gamma distribution.\n\n ";
@@ -3427,30 +3720,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_
Py_INCREF(__pyx_v_size);
__pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1097 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1147 */
__pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1098 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1148 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1099 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1149 */
__pyx_1 = (__pyx_v_fshape <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;}
- Py_INCREF(__pyx_k81p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k81p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; goto __pyx_L1;}
+ Py_INCREF(__pyx_k82p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1101 */
- __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_fshape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1151 */
+ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_fshape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -3458,57 +3753,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1103 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1153 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1104 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1154 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oshape));
__pyx_v_oshape = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1105 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1155 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oshape));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oshape));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;}
- Py_INCREF(__pyx_k82p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k82p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;}
+ Py_INCREF(__pyx_k83p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k83p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1107 */
- __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_oshape); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1157 */
+ __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_oshape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -3528,15 +3825,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_
return __pyx_r;
}
-static PyObject *__pyx_k83p;
static PyObject *__pyx_k84p;
static PyObject *__pyx_k85p;
static PyObject *__pyx_k86p;
+static PyObject *__pyx_k87p;
-static char __pyx_k83[] = "shape <= 0";
-static char __pyx_k84[] = "scale <= 0";
-static char __pyx_k85[] = "shape <= 0";
-static char __pyx_k86[] = "scale <= 0";
+static char __pyx_k84[] = "shape <= 0";
+static char __pyx_k85[] = "scale <= 0";
+static char __pyx_k86[] = "shape <= 0";
+static char __pyx_k87[] = "scale <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_gamma[] = "\n gamma(shape, scale=1.0, size=None)\n\n Gamma distribution.\n\n ";
@@ -3565,48 +3862,52 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO
__pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1119 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1169 */
__pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1120 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1170 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1121 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1171 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1122 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1172 */
__pyx_1 = (__pyx_v_fshape <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;}
- Py_INCREF(__pyx_k83p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k83p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
+ Py_INCREF(__pyx_k84p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1124 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1174 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
- Py_INCREF(__pyx_k84p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k84p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;}
+ Py_INCREF(__pyx_k85p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1126 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_fshape,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1176 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_fshape,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -3614,101 +3915,105 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1128 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1178 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1129 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1179 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oshape));
__pyx_v_oshape = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1130 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1180 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_oscale));
- __pyx_v_oscale = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1131 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1181 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oshape));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oshape));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;}
- Py_INCREF(__pyx_k85p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
+ Py_INCREF(__pyx_k86p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1133 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1183 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
+ __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oscale));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;}
- Py_INCREF(__pyx_k86p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k86p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;}
+ Py_INCREF(__pyx_k87p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k87p);
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1135 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_oshape,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; goto __pyx_L1;}
- __pyx_r = __pyx_2;
- __pyx_2 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1185 */
+ __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_oshape,__pyx_v_oscale); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;}
+ __pyx_r = __pyx_3;
+ __pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -3730,15 +4035,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-static PyObject *__pyx_k87p;
static PyObject *__pyx_k88p;
static PyObject *__pyx_k89p;
static PyObject *__pyx_k90p;
+static PyObject *__pyx_k91p;
-static char __pyx_k87[] = "shape <= 0";
-static char __pyx_k88[] = "scale <= 0";
-static char __pyx_k89[] = "dfnum <= 0";
-static char __pyx_k90[] = "dfden <= 0";
+static char __pyx_k88[] = "shape <= 0";
+static char __pyx_k89[] = "scale <= 0";
+static char __pyx_k90[] = "dfnum <= 0";
+static char __pyx_k91[] = "dfden <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_f[] = "\n f(dfnum, dfden, size=None)\n\n F distribution.\n\n ";
@@ -3766,48 +4071,52 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec
__pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1147 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1197 */
__pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1148 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1198 */
__pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1149 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1199 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1150 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1200 */
__pyx_1 = (__pyx_v_fdfnum <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;}
- Py_INCREF(__pyx_k87p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k87p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
+ Py_INCREF(__pyx_k88p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1152 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1202 */
__pyx_1 = (__pyx_v_fdfden <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;}
- Py_INCREF(__pyx_k88p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k88p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
+ Py_INCREF(__pyx_k89p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1154 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1204 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -3815,101 +4124,105 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1156 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1206 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1158 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1208 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_odfnum));
__pyx_v_odfnum = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1159 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1209 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_odfden));
- __pyx_v_odfden = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_odfden = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1160 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1210 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_odfnum));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odfnum));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; goto __pyx_L1;}
- Py_INCREF(__pyx_k89p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;}
+ Py_INCREF(__pyx_k90p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1162 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1212 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
+ __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_odfden));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_odfden));
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;}
- Py_INCREF(__pyx_k90p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k90p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;}
+ Py_INCREF(__pyx_k91p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k91p);
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1164 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;}
- __pyx_r = __pyx_2;
- __pyx_2 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1214 */
+ __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; goto __pyx_L1;}
+ __pyx_r = __pyx_3;
+ __pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -3933,19 +4246,19 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec
static PyObject *__pyx_n_less;
-static PyObject *__pyx_k91p;
static PyObject *__pyx_k92p;
static PyObject *__pyx_k93p;
static PyObject *__pyx_k94p;
static PyObject *__pyx_k95p;
static PyObject *__pyx_k96p;
+static PyObject *__pyx_k97p;
-static char __pyx_k91[] = "dfnum <= 1";
-static char __pyx_k92[] = "dfden <= 0";
-static char __pyx_k93[] = "nonc < 0";
-static char __pyx_k94[] = "dfnum <= 1";
-static char __pyx_k95[] = "dfden <= 0";
-static char __pyx_k96[] = "nonc < 0";
+static char __pyx_k92[] = "dfnum <= 1";
+static char __pyx_k93[] = "dfden <= 0";
+static char __pyx_k94[] = "nonc < 0";
+static char __pyx_k95[] = "dfnum <= 1";
+static char __pyx_k96[] = "dfden <= 0";
+static char __pyx_k97[] = "nonc < 0";
static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = "\n noncentral_f(dfnum, dfden, nonc, size=None)\n\n Noncentral F distribution.\n\n ";
@@ -3978,66 +4291,72 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se
__pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1176 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1226 */
__pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1177 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1227 */
__pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1178 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1228 */
__pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1179 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1229 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1180 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1230 */
__pyx_1 = (__pyx_v_fdfnum <= 1);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
- Py_INCREF(__pyx_k91p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k91p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;}
+ Py_INCREF(__pyx_k92p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1182 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1232 */
__pyx_1 = (__pyx_v_fdfden <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
- Py_INCREF(__pyx_k92p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k92p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;}
+ Py_INCREF(__pyx_k93p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1184 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1234 */
__pyx_1 = (__pyx_v_fnonc < 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;}
- Py_INCREF(__pyx_k93p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k93p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;}
+ Py_INCREF(__pyx_k94p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1186 */
- __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1236 */
+ __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -4045,145 +4364,151 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1189 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1239 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1191 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1241 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_odfnum));
__pyx_v_odfnum = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1192 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1242 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_odfden));
- __pyx_v_odfden = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_odfden = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1193 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1243 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_ononc));
- __pyx_v_ononc = ((PyArrayObject *)__pyx_3);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
-
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1195 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
+ __pyx_v_ononc = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1245 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_odfnum));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odfnum));
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
__pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}
- Py_INCREF(__pyx_k94p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k94p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;}
+ Py_INCREF(__pyx_k95p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k95p);
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1197 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1247 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
+ __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_odfden));
- PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_odfden));
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_odfden));
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;}
- Py_INCREF(__pyx_k95p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k95p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;}
+ Py_INCREF(__pyx_k96p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k96p);
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1199 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1249 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_ononc));
- PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_ononc));
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ononc));
+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;}
- Py_INCREF(__pyx_k96p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;}
+ Py_INCREF(__pyx_k97p);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k97p);
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;}
goto __pyx_L8;
}
__pyx_L8:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1201 */
- __pyx_5 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden,__pyx_v_ononc); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
- __pyx_r = __pyx_5;
- __pyx_5 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1251 */
+ __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden,__pyx_v_ononc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;}
+ __pyx_r = __pyx_2;
+ __pyx_2 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -4207,11 +4532,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se
return __pyx_r;
}
-static PyObject *__pyx_k97p;
static PyObject *__pyx_k98p;
+static PyObject *__pyx_k99p;
-static char __pyx_k97[] = "df <= 0";
static char __pyx_k98[] = "df <= 0";
+static char __pyx_k99[] = "df <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_chisquare[] = "\n chisquare(df, size=None)\n\n Draw samples from a chi-square distribution.\n\n When `df` independent random variables, each with standard\n normal distributions (mean 0, variance 1), are squared and summed,\n the resulting distribution is chi-square (see Notes). This\n distribution is often used in hypothesis testing.\n\n Parameters\n ----------\n df : int\n Number of degrees of freedom.\n size : tuple of ints, int, optional\n Size of the returned array. By default, a scalar is\n returned.\n\n Returns\n -------\n output : ndarray\n Samples drawn from the distribution, packed in a `size`-shaped\n array.\n\n Raises\n ------\n ValueError\n When `df` <= 0 or when an inappropriate `size` (e.g. ``size=-1``)\n is given.\n\n Notes\n -----\n The variable obtained by summing the squares of `df` independent,\n standard normally distributed random variables:\n\n .. math:: Q = \\sum_{i=0}^{\\mathtt{df}} X^2_i\n\n is chi-square distributed, denoted\n\n .. math:: Q \\sim \\chi^2_k.\n\n The probability density function of the chi-squared distribution is\n\n .. math:: p(x) = \\frac{(1/2)^{k/2}}{\\Gamma(k/2)}\n x^{k/2 - 1} e^{-x/2},\n\n where :math:`\\Gamma` is the gamma function,\n\n .. math:: \\Gamma(x) = \\int_0^{-\\infty} t^{x - 1} e^{-t} dt.\n\n References\n ----------\n .. [1] NIST/SEMATECH e-Handbook of Statistical Methods,\n http://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm\n .. [2] Wikipedia, \"Chi-square distribution\",\n http://en.wikipedia.org/wiki/Chi-square_distribution\n\n Examples\n --------\n >>> np.random.chisquare(2,4)\n array([ 1.89920014, 9.00867716, 3.13710533, 5.62318272])\n\n ";
@@ -4234,30 +4559,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self,
Py_INCREF(__pyx_v_size);
__pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1271 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1321 */
__pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1272 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1322 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1273 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1323 */
__pyx_1 = (__pyx_v_fdf <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
- Py_INCREF(__pyx_k97p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k97p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;}
+ Py_INCREF(__pyx_k98p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1275 */
- __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1325 */
+ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -4265,57 +4592,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self,
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1277 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1327 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1279 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1329 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_odf));
__pyx_v_odf = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1280 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1330 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_odf));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; goto __pyx_L1;}
- Py_INCREF(__pyx_k98p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k98p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;}
+ Py_INCREF(__pyx_k99p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k99p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1282 */
- __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1332 */
+ __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_odf); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -4335,15 +4664,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self,
return __pyx_r;
}
-static PyObject *__pyx_k99p;
static PyObject *__pyx_k100p;
static PyObject *__pyx_k101p;
static PyObject *__pyx_k102p;
+static PyObject *__pyx_k103p;
-static char __pyx_k99[] = "df <= 0";
-static char __pyx_k100[] = "nonc <= 0";
-static char __pyx_k101[] = "df <= 1";
-static char __pyx_k102[] = "nonc < 0";
+static char __pyx_k100[] = "df <= 0";
+static char __pyx_k101[] = "nonc <= 0";
+static char __pyx_k102[] = "df <= 1";
+static char __pyx_k103[] = "nonc < 0";
static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = "\n noncentral_chisquare(df, nonc, size=None)\n\n Draw samples from a noncentral chi-square distribution.\n\n The noncentral :math:`\\chi^2` distribution is a generalisation of\n the :math:`\\chi^2` distribution.\n\n Parameters\n ----------\n df : int\n Degrees of freedom.\n nonc : float\n Non-centrality.\n size : tuple of ints\n Shape of the output.\n\n ";
@@ -4371,48 +4700,52 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__
__pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1305 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1355 */
__pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1306 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1356 */
__pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1307 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1357 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1308 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1358 */
__pyx_1 = (__pyx_v_fdf <= 1);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
- Py_INCREF(__pyx_k99p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k99p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; goto __pyx_L1;}
+ Py_INCREF(__pyx_k100p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1310 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1360 */
__pyx_1 = (__pyx_v_fnonc <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;}
- Py_INCREF(__pyx_k100p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k100p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}
+ Py_INCREF(__pyx_k101p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1312 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_fdf,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1362 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_fdf,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -4420,101 +4753,105 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1315 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1365 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1317 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1367 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_odf));
__pyx_v_odf = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1318 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1368 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_ononc));
- __pyx_v_ononc = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_ononc = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1319 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1369 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_odf));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; goto __pyx_L1;}
- Py_INCREF(__pyx_k101p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;}
+ Py_INCREF(__pyx_k102p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1321 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1371 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
+ __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_ononc));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_ononc));
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;}
- Py_INCREF(__pyx_k102p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k102p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; goto __pyx_L1;}
+ Py_INCREF(__pyx_k103p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k103p);
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1323 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_odf,__pyx_v_ononc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; goto __pyx_L1;}
- __pyx_r = __pyx_2;
- __pyx_2 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1373 */
+ __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_odf,__pyx_v_ononc); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; goto __pyx_L1;}
+ __pyx_r = __pyx_3;
+ __pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -4547,7 +4884,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_size);
- __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; goto __pyx_L1;}
+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -4564,11 +4901,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v
return __pyx_r;
}
-static PyObject *__pyx_k103p;
static PyObject *__pyx_k104p;
+static PyObject *__pyx_k105p;
-static char __pyx_k103[] = "df <= 0";
static char __pyx_k104[] = "df <= 0";
+static char __pyx_k105[] = "df <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_standard_t[] = "\n standard_t(df, size=None)\n\n Standard Student\'s t distribution with df degrees of freedom.\n\n ";
@@ -4591,30 +4928,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self
Py_INCREF(__pyx_v_size);
__pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1345 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1395 */
__pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1346 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1396 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1347 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1397 */
__pyx_1 = (__pyx_v_fdf <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; goto __pyx_L1;}
- Py_INCREF(__pyx_k103p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k103p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;}
+ Py_INCREF(__pyx_k104p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1349 */
- __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1399 */
+ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -4622,57 +4961,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1351 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1401 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1353 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1403 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_odf));
__pyx_v_odf = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1354 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1404 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_odf));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; goto __pyx_L1;}
- Py_INCREF(__pyx_k104p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k104p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
+ Py_INCREF(__pyx_k105p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k105p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1356 */
- __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1406 */
+ __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_odf); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -4692,11 +5033,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self
return __pyx_r;
}
-static PyObject *__pyx_k105p;
static PyObject *__pyx_k106p;
+static PyObject *__pyx_k107p;
-static char __pyx_k105[] = "kappa < 0";
static char __pyx_k106[] = "kappa < 0";
+static char __pyx_k107[] = "kappa < 0";
static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_vonmises[] = "\n vonmises(mu=0.0, kappa=1.0, size=None)\n\n Draw samples from a von Mises distribution.\n\n Samples are drawn from a von Mises distribution with specified mode (mu)\n and dispersion (kappa), on the interval [-pi, pi].\n\n The von Mises distribution (also known as the circular normal\n distribution) is a continuous probability distribution on the circle. It\n may be thought of as the circular analogue of the normal distribution.\n\n Parameters\n ----------\n mu : float\n Mode (\"center\") of the distribution.\n kappa : float, >= 0.\n Dispersion of the distribution.\n size : {tuple, int}\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n Returns\n -------\n samples : {ndarray, scalar}\n The returned samples live on the unit circle [-\\pi, \\pi].\n\n See Also\n --------\n scipy.stats.distributions.vonmises : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the von Mises distribution is\n\n .. math:: p(x) = \\frac{e^{\\kappa cos(x-\\mu)}}{2\\pi I_0(\\kappa)},\n\n where :math:`\\mu` is the mode and :math:`\\kappa` the dispersion,\n and :math:`I_0(\\kappa)` is the modified Bessel function of order 0.\n\n The von Mises, named for Richard Edler von Mises, born in\n Austria-Hungary, in what is now the Ukraine. He fled to the United\n States in 1939 and became a professor at Harvard. He worked in\n probability theory, aerodynamics, fluid mechanics, and philosophy of\n science.\n\n References\n ----------\n .. [1] Abramowitz, M. and Stegun, I. A. (ed.), Handbook of Mathematical\n Functions, National Bureau of Standards, 1964; reprinted Dover\n Publications, 1965.\n .. [2] von Mises, Richard, 1964, Mathematical Theory of Probability\n and Statistics (New York: Academic Press).\n .. [3] Wikipedia, \"Von Mises distribution\",\n http://en.wikipedia.org/wiki/Von_Mises_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, kappa = 0.0, 4.0 # mean and dispersion\n >>> s = np.random.vonmises(mu, kappa, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> import scipy.special as sps\n >>> count, bins, ignored = plt.hist(s, 50, normed=True)\n >>> x = arange(-pi, pi, 2*pi/50.)\n >>> y = -np.exp(kappa*np.cos(x-mu))/(2*pi*sps.jn(0,kappa))\n >>> plt.plot(x, y/max(y), linewidth=2, color=\'r\')\n >>> plt.show()\n\n ";
@@ -4724,33 +5065,35 @@ static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,
__pyx_v_omu = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_okappa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1438 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1488 */
__pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1439 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1489 */
__pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1440 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1490 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1441 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1491 */
__pyx_1 = (__pyx_v_fkappa < 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; goto __pyx_L1;}
- Py_INCREF(__pyx_k105p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k105p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
+ Py_INCREF(__pyx_k106p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1443 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_fmu,__pyx_v_fkappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1493 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_fmu,__pyx_v_fkappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -4758,64 +5101,66 @@ static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1445 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1495 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1447 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1497 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_omu));
__pyx_v_omu = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1448 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1498 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_okappa));
- __pyx_v_okappa = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_okappa = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1449 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1499 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_okappa));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_okappa));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; goto __pyx_L1;}
- Py_INCREF(__pyx_k106p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;}
+ Py_INCREF(__pyx_k107p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1451 */
- __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_omu,__pyx_v_okappa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1501 */
+ __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_omu,__pyx_v_okappa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -4837,11 +5182,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,
return __pyx_r;
}
-static PyObject *__pyx_k107p;
static PyObject *__pyx_k108p;
+static PyObject *__pyx_k109p;
-static char __pyx_k107[] = "a <= 0";
static char __pyx_k108[] = "a <= 0";
+static char __pyx_k109[] = "a <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_pareto[] = "\n pareto(a, size=None)\n\n Draw samples from a Pareto distribution with specified shape.\n\n This is a simplified version of the Generalized Pareto distribution\n (available in SciPy), with the scale set to one and the location set to\n zero. Most authors default the location to one.\n\n The Pareto distribution must be greater than zero, and is unbounded above.\n It is also known as the \"80-20 rule\". In this distribution, 80 percent of\n the weights are in the lowest 20 percent of the range, while the other 20\n percent fill the remaining 80 percent of the range.\n\n Parameters\n ----------\n shape : float, > 0.\n Shape of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.distributions.genpareto.pdf : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Pareto distribution is\n\n .. math:: p(x) = \\frac{am^a}{x^{a+1}}\n\n where :math:`a` is the shape and :math:`m` the location\n\n The Pareto distribution, named after the Italian economist Vilfredo Pareto,\n is a power law probability distribution useful in many real world problems.\n Outside the field of economics it is generally referred to as the Bradford\n distribution. Pareto developed the distribution to describe the\n distribution of wealth in an economy. It has also found use in insurance,\n web page access statistics, oil field sizes, and many other problems,\n including the download frequency for projects in Sourceforge [1]. It is\n one of the so-called \"fat-tailed\" distributions.\n\n\n References\n ----------\n .. [1] Francis Hunt and Paul Johnson, On the Pareto Distribution of\n Sourceforge projects.\n .. [2] Pareto, V. (1896). Course of Political Economy. Lausanne.\n .. [3] Reiss, R.D., Thomas, M.(2001), Statistical Analysis of Extreme\n Values, Birkhauser Verlag, Basel, pp 23-30.\n .. [4] Wikipedia, \"Pareto distribution\",\n http://en.wikipedia.org/wiki/Pareto_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a, m = 3., 1. # shape and mode\n >>> s = np.random.pareto(a, 1000) + m\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 100, normed=True, align=\'center\')\n >>> fit = a*m**a/bins**(a+1)\n >>> plt.plot(bins, max(count)*fit/max(fit),linewidth=2, color=\'r\')\n >>> plt.show()\n\n ";
@@ -4864,30 +5209,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, Py
Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1529 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1579 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1530 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1580 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1531 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1581 */
__pyx_1 = (__pyx_v_fa <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;}
- Py_INCREF(__pyx_k107p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k107p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;}
+ Py_INCREF(__pyx_k108p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1533 */
- __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1583 */
+ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -4895,57 +5242,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, Py
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1535 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1585 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1537 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1587 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oa));
__pyx_v_oa = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1538 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1588 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oa));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; goto __pyx_L1;}
- Py_INCREF(__pyx_k108p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k108p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; goto __pyx_L1;}
+ Py_INCREF(__pyx_k109p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k109p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1540 */
- __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1590 */
+ __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -4965,11 +5314,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-static PyObject *__pyx_k109p;
static PyObject *__pyx_k110p;
+static PyObject *__pyx_k111p;
-static char __pyx_k109[] = "a <= 0";
static char __pyx_k110[] = "a <= 0";
+static char __pyx_k111[] = "a <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_weibull[] = "\n weibull(a, size=None)\n\n Weibull distribution.\n\n Draw samples from a 1-parameter Weibull distribution with the given\n shape parameter.\n\n .. math:: X = (-ln(U))^{1/a}\n\n Here, U is drawn from the uniform distribution over (0,1].\n\n The more common 2-parameter Weibull, including a scale parameter\n :math:`\\lambda` is just :math:`X = \\lambda(-ln(U))^{1/a}`.\n\n The Weibull (or Type III asymptotic extreme value distribution for smallest\n values, SEV Type III, or Rosin-Rammler distribution) is one of a class of\n Generalized Extreme Value (GEV) distributions used in modeling extreme\n value problems. This class includes the Gumbel and Frechet distributions.\n\n Parameters\n ----------\n a : float\n Shape of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.distributions.weibull : probability density function,\n distribution or cumulative density function, etc.\n\n gumbel, scipy.stats.distributions.genextreme\n\n Notes\n -----\n The probability density for the Weibull distribution is\n\n .. math:: p(x) = \\frac{a}\n {\\lambda}(\\frac{x}{\\lambda})^{a-1}e^{-(x/\\lambda)^a},\n\n where :math:`a` is the shape and :math:`\\lambda` the scale.\n\n The function has its peak (the mode) at\n :math:`\\lambda(\\frac{a-1}{a})^{1/a}`.\n\n When ``a = 1``, the Weibull distribution reduces to the exponential\n distribution.\n\n References\n ----------\n .. [1] Waloddi Weibull, Professor, Royal Technical University, Stockholm,\n 1939 \"A Statistical Theory Of The Strength Of Materials\",\n Ingeniorsvetenskapsakademiens Handlingar Nr 151, 1939,\n Generalstabens Litografiska Anstalts Forlag, Stockholm.\n .. [2] Waloddi Weibull, 1951 \"A Statistical Distribution Function of Wide\n Applicability\", Journal Of Applied Mechanics ASME Paper.\n .. [3] Wikipedia, \"Weibull distribution\",\n http://en.wikipedia.org/wiki/Weibull_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a = 5. # shape\n >>> s = np.random.weibull(a, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> def weib(x,n,a):\n ... return (a/n)*(x/n)**(a-1)*exp(-(x/n)**a)\n\n >>> count, bins, ignored = plt.hist(numpy.random.weibull(5.,1000))\n >>> scale = count.max()/weib(x, 1., 5.).max()\n >>> x = arange(1,100.)/50.\n >>> plt.plot(x, weib(x, 1., 5.)*scale)\n >>> plt.show()\n\n ";
@@ -4992,30 +5341,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, P
Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1628 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1678 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1629 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1679 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1630 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1680 */
__pyx_1 = (__pyx_v_fa <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; goto __pyx_L1;}
- Py_INCREF(__pyx_k109p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k109p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;}
+ Py_INCREF(__pyx_k110p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1632 */
- __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1682 */
+ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -5023,57 +5374,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, P
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1634 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1684 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1636 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1686 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oa));
__pyx_v_oa = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1637 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1687 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oa));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; goto __pyx_L1;}
- Py_INCREF(__pyx_k110p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k110p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;}
+ Py_INCREF(__pyx_k111p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k111p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1639 */
- __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1689 */
+ __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -5093,11 +5446,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, P
return __pyx_r;
}
-static PyObject *__pyx_k111p;
static PyObject *__pyx_k112p;
+static PyObject *__pyx_k113p;
-static char __pyx_k111[] = "a <= 0";
static char __pyx_k112[] = "a <= 0";
+static char __pyx_k113[] = "a <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_power[] = "\n power(a, size=None)\n\n Power distribution.\n\n ";
@@ -5120,30 +5473,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyO
Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1651 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1701 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1652 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1702 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1653 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1703 */
__pyx_1 = (__pyx_v_fa <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;}
- Py_INCREF(__pyx_k111p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k111p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;}
+ Py_INCREF(__pyx_k112p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k112p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1655 */
- __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1705 */
+ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -5151,57 +5506,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyO
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1657 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1707 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1659 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1709 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oa));
__pyx_v_oa = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1660 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1710 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oa));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L1;}
- Py_INCREF(__pyx_k112p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
+ Py_INCREF(__pyx_k113p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1662 */
- __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1712 */
+ __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -5221,11 +5578,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-static PyObject *__pyx_k113p;
static PyObject *__pyx_k114p;
+static PyObject *__pyx_k115p;
-static char __pyx_k113[] = "scale <= 0";
static char __pyx_k114[] = "scale <= 0";
+static char __pyx_k115[] = "scale <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_laplace[] = "\n laplace(loc=0.0, scale=1.0, size=None)\n\n Laplace or double exponential distribution.\n\n It has the probability density function\n\n .. math:: f(x; \\mu, \\lambda) = \\frac{1}{2\\lambda}\n \\exp\\left(-\\frac{|x - \\mu|}{\\lambda}\\right).\n\n The Laplace distribution is similar to the Gaussian/normal distribution,\n but is sharper at the peak and has fatter tails.\n\n Parameters\n ----------\n loc : float\n The position, :math:`\\mu`, of the distribution peak.\n scale : float\n :math:`\\lambda`, the exponential decay.\n\n ";
@@ -5255,33 +5612,35 @@ static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, P
__pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1689 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1739 */
__pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1690 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1740 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1691 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1741 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1692 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1742 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;}
- Py_INCREF(__pyx_k113p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;}
+ Py_INCREF(__pyx_k114p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k114p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1694 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1744 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -5289,64 +5648,66 @@ static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, P
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1696 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1746 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1697 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1747 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oloc));
__pyx_v_oloc = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1698 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1748 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oscale));
- __pyx_v_oscale = ((PyArrayObject *)__pyx_2);
- __pyx_2 = 0;
+ __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
+ __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1699 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1749 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oscale));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;}
- Py_INCREF(__pyx_k114p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k114p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;}
+ Py_INCREF(__pyx_k115p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1701 */
- __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1751 */
+ __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -5368,11 +5729,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, P
return __pyx_r;
}
-static PyObject *__pyx_k115p;
static PyObject *__pyx_k116p;
+static PyObject *__pyx_k117p;
-static char __pyx_k115[] = "scale <= 0";
static char __pyx_k116[] = "scale <= 0";
+static char __pyx_k117[] = "scale <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_gumbel[] = "\n gumbel(loc=0.0, scale=1.0, size=None)\n\n Gumbel distribution.\n\n Draw samples from a Gumbel distribution with specified location (or mean)\n and scale (or standard deviation).\n\n The Gumbel (or Smallest Extreme Value (SEV) or the Smallest Extreme Value\n Type I) distribution is one of a class of Generalized Extreme Value (GEV)\n distributions used in modeling extreme value problems. The Gumbel is a\n special case of the Extreme Value Type I distribution for maximums from\n distributions with \"exponential-like\" tails, it may be derived by\n considering a Gaussian process of measurements, and generating the pdf for\n the maximum values from that set of measurements (see examples).\n\n Parameters\n ----------\n loc : float\n The location of the mode of the distribution.\n scale : float\n The scale parameter of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.gumbel : probability density function,\n distribution or cumulative density function, etc.\n weibull, scipy.stats.genextreme\n\n Notes\n -----\n The probability density for the Gumbel distribution is\n\n .. math:: p(x) = \\frac{e^{-(x - \\mu)/ \\beta}}{\\beta} e^{ -e^{-(x - \\mu)/\n \\beta}},\n\n where :math:`\\mu` is the mode, a location parameter, and :math:`\\beta`\n is the scale parameter.\n\n The Gumbel (named for German mathematician Emil Julius Gumbel) was used\n very early in the hydrology literature, for modeling the occurrence of\n flood events. It is also used for modeling maximum wind speed and rainfall\n rates. It is a \"fat-tailed\" distribution - the probability of an event in\n the tail of the distribution is larger than if one used a Gaussian, hence\n the surprisingly frequent occurrence of 100-year floods. Floods were\n initially modeled as a Gaussian process, which underestimated the frequency\n of extreme events.\n\n It is one of a class of extreme value distributions, the Generalized\n Extreme Value (GEV) distributions, which also includes the Weibull and\n Frechet.\n\n The function has a mean of :math:`\\mu + 0.57721\\beta` and a variance of\n :math:`\\frac{\\pi^2}{6}\\beta^2`.\n\n References\n ----------\n .. [1] Gumbel, E.J. (1958). Statistics of Extremes. Columbia University\n Press.\n .. [2] Reiss, R.-D. and Thomas M. (2001), Statistical Analysis of Extreme\n Values, from Insurance, Finance, Hydrology and Other Fields,\n Birkhauser Verlag, Basel: Boston : Berlin.\n .. [3] Wikipedia, \"Gumbel distribution\",\n http://en.wikipedia.org/wiki/Gumbel_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, beta = 0, 0.1 # location and scale\n >>> s = np.random.gumbel(mu, beta, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 30, normed=True)\n >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)*\n ... np.exp( -np.exp( -(bins - mu) /beta) ),\n ... linewidth=2, color=\'r\')\n >>> plt.show()\n\n Show how an extreme value distribution can arise from a Gaussian process\n and compare to a Gaussian:\n\n >>> means = []\n >>> maxima = []\n >>> for i in range(0,1000) :\n ... a = np.random.normal(mu, beta, 1000)\n ... means.append(a.mean())\n ... maxima.append(a.max())\n >>> count, bins, ignored = plt.hist(maxima, 30, normed=True)\n >>> beta = np.std(maxima)*np.pi/np.sqrt(6)\n >>> mu = np.mean(maxima) - 0.57721*beta\n >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)*\n ... np.exp( -np.exp( -(bins - mu) /beta) ),\n ... linewidth=2, color=\'r\')\n >>> plt.plot(bins, 1/(beta * np.sqrt(2 * np.pi)) *\n ... np.exp( - (bins - mu)**2 / (2 * beta**2) ),\n ... linewidth=2, color=\'g\')\n >>> plt.show()\n\n ";
@@ -5402,33 +5763,35 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, Py
__pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1813 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1863 */
__pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1814 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1864 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1815 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1865 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1816 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1866 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; goto __pyx_L1;}
- Py_INCREF(__pyx_k115p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k115p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; goto __pyx_L1;}
+ Py_INCREF(__pyx_k116p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k116p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1818 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1868 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -5436,64 +5799,66 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, Py
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1820 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1870 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1821 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1871 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oloc));
__pyx_v_oloc = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1822 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1872 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oscale));
- __pyx_v_oscale = ((PyArrayObject *)__pyx_2);
- __pyx_2 = 0;
+ __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
+ __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1823 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1873 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oscale));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; goto __pyx_L1;}
- Py_INCREF(__pyx_k116p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k116p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;}
+ Py_INCREF(__pyx_k117p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1825 */
- __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1875 */
+ __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -5515,11 +5880,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-static PyObject *__pyx_k117p;
static PyObject *__pyx_k118p;
+static PyObject *__pyx_k119p;
-static char __pyx_k117[] = "scale <= 0";
static char __pyx_k118[] = "scale <= 0";
+static char __pyx_k119[] = "scale <= 0";
static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_logistic[] = "\n logistic(loc=0.0, scale=1.0, size=None)\n\n Logistic distribution.\n\n ";
@@ -5549,33 +5914,35 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,
__pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1837 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1887 */
__pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1838 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1888 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1839 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1889 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1840 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1890 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; goto __pyx_L1;}
- Py_INCREF(__pyx_k117p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k117p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;}
+ Py_INCREF(__pyx_k118p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k118p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1842 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1892 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -5583,64 +5950,66 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1844 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1894 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1845 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1895 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oloc));
__pyx_v_oloc = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1846 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1896 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oscale));
- __pyx_v_oscale = ((PyArrayObject *)__pyx_2);
- __pyx_2 = 0;
+ __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
+ __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1847 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1897 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oscale));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; goto __pyx_L1;}
- Py_INCREF(__pyx_k118p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k118p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; goto __pyx_L1;}
+ Py_INCREF(__pyx_k119p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k119p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1849 */
- __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1899 */
+ __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -5662,11 +6031,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,
return __pyx_r;
}
-static PyObject *__pyx_k119p;
static PyObject *__pyx_k120p;
+static PyObject *__pyx_k121p;
-static char __pyx_k119[] = "sigma <= 0";
-static char __pyx_k120[] = "sigma <= 0.0";
+static char __pyx_k120[] = "sigma <= 0";
+static char __pyx_k121[] = "sigma <= 0.0";
static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_lognormal[] = "\n lognormal(mean=0.0, sigma=1.0, size=None)\n\n Log-normal distribution.\n\n Draw samples from a log-normal distribution with specified mean, standard\n deviation, and shape. Note that the mean and standard deviation are not the\n values for the distribution itself, but of the underlying normal\n distribution it is derived from.\n\n\n Parameters\n ----------\n mean : float\n Mean value of the underlying normal distribution\n sigma : float, >0.\n Standard deviation of the underlying normal distribution\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.lognorm : probability density function, distribution,\n cumulative density function, etc.\n\n Notes\n -----\n A variable `x` has a log-normal distribution if `log(x)` is normally\n distributed.\n\n The probability density function for the log-normal distribution is\n\n .. math:: p(x) = \\frac{1}{\\sigma x \\sqrt{2\\pi}}\n e^{(-\\frac{(ln(x)-\\mu)^2}{2\\sigma^2})}\n\n where :math:`\\mu` is the mean and :math:`\\sigma` is the standard deviation\n of the normally distributed logarithm of the variable.\n\n A log normal distribution results if a random variable is the *product* of\n a large number of independent, identically-distributed variables in the\n same way that a normal distribution results if the variable is the *sum*\n of a large number of independent, identically-distributed variables\n (see the last example). It is one of the so-called \"fat-tailed\"\n distributions.\n\n The log-normal distribution is commonly used to model the lifespan of units\n with fatigue-stress failure modes. Since this includes\n most mechanical systems, the lognormal distribution has widespread\n application.\n\n It is also commonly used to model oil field sizes, species abundance, and\n latent periods of infectious diseases.\n\n References\n ----------\n .. [1] Eckhard Limpert, Werner A. Stahel, and Markus Abbt, \"Log-normal\n Distributions across the Sciences: Keys and Clues\", May 2001\n Vol. 51 No. 5 BioScience\n http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf\n .. [2] Reiss, R.D., Thomas, M.(2001), Statistical Analysis of Extreme\n Values, Birkhauser Verlag, Basel, pp 31-32.\n .. [3] Wikipedia, \"Lognormal distribution\",\n http://en.wikipedia.org/wiki/Lognormal_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, sigma = 3., 1. # mean and standard deviation\n >>> s = np.random.lognormal(mu, sigma, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 100, normed=True, align=\'center\')\n\n >>> x = np.linspace(min(bins), max(bins), 10000)\n >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2))\n ... / (x * sigma * np.sqrt(2 * np.pi)))\n\n >>> plt.plot(x, pdf, linewidth=2, color=\'r\')\n >>> plt.axis(\'tight\')\n >>> plt.show()\n\n Demonstrate that taking the products of random samples from a uniform\n distribution can be fit well by a log-normal pdf.\n\n >>> # Generate a thousand samples: each is the product of 100 random\n >>> # values, drawn from a normal distribution.\n >>> b = []\n >>> for i in range(1000):\n ... a = 10. + np.random.random(100)\n ... b.append(np.product(a))\n\n >>> b = np.array(b) / np.min(b) # scale values to be positive\n\n >>> count, bins, ignored = plt.hist(b, 100, normed=True, align=\'center\')\n\n >>> sigma = np.std(np.log(b))\n >>> mu = np.mean(np.log(b))\n\n >>> x = np.linspace(min(bins), max(bins), 10000)\n >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2))\n ... / (x * sigma * np.sqrt(2 * np.pi)))\n\n >>> plt.plot(x, pdf, color=\'r\', linewidth=2)\n >>> plt.show()\n\n ";
@@ -5696,33 +6065,35 @@ static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self,
__pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_osigma = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1966 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2016 */
__pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1967 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2017 */
__pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1969 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2019 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1970 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2020 */
__pyx_1 = (__pyx_v_fsigma <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; goto __pyx_L1;}
- Py_INCREF(__pyx_k119p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k119p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; goto __pyx_L1;}
+ Py_INCREF(__pyx_k120p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k120p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1972 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_fmean,__pyx_v_fsigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2022 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_fmean,__pyx_v_fsigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -5730,64 +6101,66 @@ static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self,
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1974 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2024 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1976 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2026 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_omean));
__pyx_v_omean = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1977 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2027 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_osigma));
- __pyx_v_osigma = ((PyArrayObject *)__pyx_2);
- __pyx_2 = 0;
+ __pyx_v_osigma = ((PyArrayObject *)__pyx_4);
+ __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1978 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2028 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_osigma));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_osigma));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; goto __pyx_L1;}
- Py_INCREF(__pyx_k120p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k120p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
+ Py_INCREF(__pyx_k121p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k121p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1980 */
- __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_omean,__pyx_v_osigma); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2030 */
+ __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_omean,__pyx_v_osigma); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -5809,11 +6182,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self,
return __pyx_r;
}
-static PyObject *__pyx_k121p;
static PyObject *__pyx_k122p;
+static PyObject *__pyx_k123p;
-static char __pyx_k121[] = "scale <= 0";
-static char __pyx_k122[] = "scale <= 0.0";
+static char __pyx_k122[] = "scale <= 0";
+static char __pyx_k123[] = "scale <= 0.0";
static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_rayleigh[] = "\n rayleigh(scale=1.0, size=None)\n\n Rayleigh distribution.\n\n ";
@@ -5837,30 +6210,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,
Py_INCREF(__pyx_v_size);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1992 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2042 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1994 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2044 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1995 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2045 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; goto __pyx_L1;}
- Py_INCREF(__pyx_k121p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k121p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; goto __pyx_L1;}
+ Py_INCREF(__pyx_k122p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k122p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1997 */
- __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2047 */
+ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -5868,57 +6243,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1999 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2049 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2001 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2051 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oscale));
__pyx_v_oscale = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2002 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2052 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oscale));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; goto __pyx_L1;}
- Py_INCREF(__pyx_k122p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k122p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; goto __pyx_L1;}
+ Py_INCREF(__pyx_k123p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k123p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2004 */
- __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2004; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2054 */
+ __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -5938,15 +6315,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,
return __pyx_r;
}
-static PyObject *__pyx_k123p;
static PyObject *__pyx_k124p;
static PyObject *__pyx_k125p;
static PyObject *__pyx_k126p;
+static PyObject *__pyx_k127p;
-static char __pyx_k123[] = "mean <= 0";
-static char __pyx_k124[] = "scale <= 0";
-static char __pyx_k125[] = "mean <= 0.0";
-static char __pyx_k126[] = "scale <= 0.0";
+static char __pyx_k124[] = "mean <= 0";
+static char __pyx_k125[] = "scale <= 0";
+static char __pyx_k126[] = "mean <= 0.0";
+static char __pyx_k127[] = "scale <= 0.0";
static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_wald[] = "\n wald(mean, scale, size=None)\n\n Wald (inverse Gaussian) distribution.\n\n ";
@@ -5974,48 +6351,52 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb
__pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2016 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2066 */
__pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2017 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2067 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2018 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2068 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2019 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2069 */
__pyx_1 = (__pyx_v_fmean <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}
- Py_INCREF(__pyx_k123p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k123p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;}
+ Py_INCREF(__pyx_k124p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k124p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2021 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2071 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;}
- Py_INCREF(__pyx_k124p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k124p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; goto __pyx_L1;}
+ Py_INCREF(__pyx_k125p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k125p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2023 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_fmean,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2073 */
+ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_fmean,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -6023,98 +6404,102 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2025 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2075 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2026 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2076 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_omean));
__pyx_v_omean = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2027 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2077 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2077; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2077; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oscale));
- __pyx_v_oscale = ((PyArrayObject *)__pyx_2);
- __pyx_2 = 0;
+ __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
+ __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2028 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2078 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_omean));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_omean));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
- Py_INCREF(__pyx_k125p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k125p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; goto __pyx_L1;}
+ Py_INCREF(__pyx_k126p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k126p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; goto __pyx_L1;}
goto __pyx_L5;
}
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
+ __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oscale));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; goto __pyx_L1;}
- Py_INCREF(__pyx_k126p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k126p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; goto __pyx_L1;}
+ Py_INCREF(__pyx_k127p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k127p);
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2032 */
- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_omean,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; goto __pyx_L1;}
- __pyx_r = __pyx_2;
- __pyx_2 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2082 */
+ __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_omean,__pyx_v_oscale); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; goto __pyx_L1;}
+ __pyx_r = __pyx_3;
+ __pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -6139,19 +6524,19 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb
static PyObject *__pyx_n_greater;
static PyObject *__pyx_n_equal;
-static PyObject *__pyx_k127p;
static PyObject *__pyx_k128p;
static PyObject *__pyx_k129p;
static PyObject *__pyx_k130p;
static PyObject *__pyx_k131p;
static PyObject *__pyx_k132p;
+static PyObject *__pyx_k133p;
-static char __pyx_k127[] = "left > mode";
-static char __pyx_k128[] = "mode > right";
-static char __pyx_k129[] = "left == right";
-static char __pyx_k130[] = "left > mode";
-static char __pyx_k131[] = "mode > right";
-static char __pyx_k132[] = "left == right";
+static char __pyx_k128[] = "left > mode";
+static char __pyx_k129[] = "mode > right";
+static char __pyx_k130[] = "left == right";
+static char __pyx_k131[] = "left > mode";
+static char __pyx_k132[] = "mode > right";
+static char __pyx_k133[] = "left == right";
static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_triangular[] = "\n triangular(left, mode, right, size=None)\n\n Triangular distribution starting at left, peaking at mode, and\n ending at right (left <= mode <= right).\n\n ";
@@ -6184,66 +6569,72 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self
__pyx_v_omode = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oright = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2047 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2097 */
__pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2048 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2098 */
__pyx_v_fright = PyFloat_AsDouble(__pyx_v_right);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2049 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2099 */
__pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2050 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2100 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2051 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2101 */
__pyx_1 = (__pyx_v_fleft > __pyx_v_fmode);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
- Py_INCREF(__pyx_k127p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k127p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;}
+ Py_INCREF(__pyx_k128p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k128p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2053 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2103 */
__pyx_1 = (__pyx_v_fmode > __pyx_v_fright);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;}
- Py_INCREF(__pyx_k128p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k128p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;}
+ Py_INCREF(__pyx_k129p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k129p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2055 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2105 */
__pyx_1 = (__pyx_v_fleft == __pyx_v_fright);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; goto __pyx_L1;}
- Py_INCREF(__pyx_k129p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k129p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;}
+ Py_INCREF(__pyx_k130p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k130p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2057 */
- __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_fleft,__pyx_v_fmode,__pyx_v_fright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2107 */
+ __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_fleft,__pyx_v_fmode,__pyx_v_fright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -6251,140 +6642,146 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2060 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2110 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2061 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2111 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oleft));
__pyx_v_oleft = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2062 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2112 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_omode));
- __pyx_v_omode = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_omode = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2063 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2113 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_oright));
- __pyx_v_oright = ((PyArrayObject *)__pyx_3);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
-
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2065 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
+ __pyx_v_oright = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2115 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oleft));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_oleft));
Py_INCREF(((PyObject *)__pyx_v_omode));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_omode));
- __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
__pyx_5 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; goto __pyx_L1;}
- Py_INCREF(__pyx_k130p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k130p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;}
+ Py_INCREF(__pyx_k131p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k131p);
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2067 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2117 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_omode));
- PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_omode));
+ PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_omode));
Py_INCREF(((PyObject *)__pyx_v_oright));
- PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)__pyx_v_oright));
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_oright));
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; goto __pyx_L1;}
- Py_INCREF(__pyx_k131p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k131p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;}
+ Py_INCREF(__pyx_k132p);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k132p);
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2069 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2119 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oleft));
- PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oleft));
+ PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_oleft));
Py_INCREF(((PyObject *)__pyx_v_oright));
- PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_oright));
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_oright));
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
__pyx_5 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;}
- Py_INCREF(__pyx_k132p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k132p);
- __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; goto __pyx_L1;}
+ Py_INCREF(__pyx_k133p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k133p);
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; goto __pyx_L1;}
goto __pyx_L8;
}
__pyx_L8:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2071 */
- __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_oleft,__pyx_v_omode,__pyx_v_oright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2121 */
+ __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_oleft,__pyx_v_omode,__pyx_v_oright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -6410,19 +6807,19 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self
return __pyx_r;
}
-static PyObject *__pyx_k133p;
static PyObject *__pyx_k134p;
static PyObject *__pyx_k135p;
static PyObject *__pyx_k136p;
static PyObject *__pyx_k137p;
static PyObject *__pyx_k138p;
+static PyObject *__pyx_k139p;
-static char __pyx_k133[] = "n <= 0";
-static char __pyx_k134[] = "p < 0";
-static char __pyx_k135[] = "p > 1";
-static char __pyx_k136[] = "n <= 0";
-static char __pyx_k137[] = "p < 0";
-static char __pyx_k138[] = "p > 1";
+static char __pyx_k134[] = "n <= 0";
+static char __pyx_k135[] = "p < 0";
+static char __pyx_k136[] = "p > 1";
+static char __pyx_k137[] = "n <= 0";
+static char __pyx_k138[] = "p < 0";
+static char __pyx_k139[] = "p > 1";
static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_binomial[] = "\n binomial(n, p, size=None)\n\n Binomial distribution of n trials and p probability of success.\n\n ";
@@ -6450,60 +6847,66 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,
__pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2086 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2136 */
__pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2087 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2137 */
__pyx_v_ln = PyInt_AsLong(__pyx_v_n);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2088 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2138 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2089 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2139 */
__pyx_1 = (__pyx_v_ln <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; goto __pyx_L1;}
- Py_INCREF(__pyx_k133p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k133p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}
+ Py_INCREF(__pyx_k134p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k134p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2091 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2141 */
__pyx_1 = (__pyx_v_fp < 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; goto __pyx_L1;}
- Py_INCREF(__pyx_k134p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k134p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;}
+ Py_INCREF(__pyx_k135p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k135p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_1 = (__pyx_v_fp > 1);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; goto __pyx_L1;}
- Py_INCREF(__pyx_k135p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k135p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;}
+ Py_INCREF(__pyx_k136p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k136p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2095 */
- __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2145 */
+ __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -6511,138 +6914,144 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2097 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2147 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2099 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2149 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_on));
__pyx_v_on = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2100 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2150 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_op));
- __pyx_v_op = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_op = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2101 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2151 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
Py_INCREF(__pyx_v_n);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n);
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;}
- Py_INCREF(__pyx_k136p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k136p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; goto __pyx_L1;}
+ Py_INCREF(__pyx_k137p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k137p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2103 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2153 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
+ __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
Py_INCREF(__pyx_v_p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;}
- Py_INCREF(__pyx_k137p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k137p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; goto __pyx_L1;}
+ Py_INCREF(__pyx_k138p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k138p);
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2105 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2155 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
Py_INCREF(__pyx_v_p);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p);
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;}
- Py_INCREF(__pyx_k138p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k138p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; goto __pyx_L1;}
+ Py_INCREF(__pyx_k139p);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k139p);
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; goto __pyx_L1;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2107 */
- __pyx_5 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; goto __pyx_L1;}
- __pyx_r = __pyx_5;
- __pyx_5 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2157 */
+ __pyx_4 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; goto __pyx_L1;}
+ __pyx_r = __pyx_4;
+ __pyx_4 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -6664,19 +7073,19 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,
return __pyx_r;
}
-static PyObject *__pyx_k139p;
static PyObject *__pyx_k140p;
static PyObject *__pyx_k141p;
static PyObject *__pyx_k142p;
static PyObject *__pyx_k143p;
static PyObject *__pyx_k144p;
+static PyObject *__pyx_k145p;
-static char __pyx_k139[] = "n <= 0";
-static char __pyx_k140[] = "p < 0";
-static char __pyx_k141[] = "p > 1";
-static char __pyx_k142[] = "n <= 0";
-static char __pyx_k143[] = "p < 0";
-static char __pyx_k144[] = "p > 1";
+static char __pyx_k140[] = "n <= 0";
+static char __pyx_k141[] = "p < 0";
+static char __pyx_k142[] = "p > 1";
+static char __pyx_k143[] = "n <= 0";
+static char __pyx_k144[] = "p < 0";
+static char __pyx_k145[] = "p > 1";
static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = "\n negative_binomial(n, p, size=None)\n\n Negative Binomial distribution.\n\n ";
@@ -6686,7 +7095,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_on;
PyArrayObject *__pyx_v_op;
- long __pyx_v_ln;
+ double __pyx_v_fn;
double __pyx_v_fp;
PyObject *__pyx_r;
int __pyx_1;
@@ -6704,60 +7113,66 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx
__pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2121 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2171 */
__pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2122 */
- __pyx_v_ln = PyInt_AsLong(__pyx_v_n);
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2172 */
+ __pyx_v_fn = PyFloat_AsDouble(__pyx_v_n);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2123 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2173 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2124 */
- __pyx_1 = (__pyx_v_ln <= 0);
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2174 */
+ __pyx_1 = (__pyx_v_fn <= 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;}
- Py_INCREF(__pyx_k139p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k139p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; goto __pyx_L1;}
+ Py_INCREF(__pyx_k140p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k140p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2126 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2176 */
__pyx_1 = (__pyx_v_fp < 0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; goto __pyx_L1;}
- Py_INCREF(__pyx_k140p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k140p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; goto __pyx_L1;}
+ Py_INCREF(__pyx_k141p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k141p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_1 = (__pyx_v_fp > 1);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; goto __pyx_L1;}
- Py_INCREF(__pyx_k141p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k141p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; goto __pyx_L1;}
+ Py_INCREF(__pyx_k142p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k142p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2130 */
- __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2180 */
+ __pyx_2 = __pyx_f_6mtrand_discdd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_fn,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2180; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -6765,138 +7180,144 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2133 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2183 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2135 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2135; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2185 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2185; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_on));
__pyx_v_on = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2136 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2186 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2186; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_op));
- __pyx_v_op = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_op = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2137 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2187 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
Py_INCREF(__pyx_v_n);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n);
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; goto __pyx_L1;}
- Py_INCREF(__pyx_k142p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k142p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; goto __pyx_L1;}
+ Py_INCREF(__pyx_k143p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k143p);
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2139 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2189 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
+ __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
Py_INCREF(__pyx_v_p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}
- Py_INCREF(__pyx_k143p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k143p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L1;}
+ Py_INCREF(__pyx_k144p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k144p);
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2141 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2191 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
Py_INCREF(__pyx_v_p);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p);
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;}
- Py_INCREF(__pyx_k144p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k144p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;}
+ Py_INCREF(__pyx_k145p);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k145p);
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2143 */
- __pyx_5 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; goto __pyx_L1;}
- __pyx_r = __pyx_5;
- __pyx_5 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2193 */
+ __pyx_4 = __pyx_f_6mtrand_discdd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; goto __pyx_L1;}
+ __pyx_r = __pyx_4;
+ __pyx_4 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -6918,11 +7339,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx
return __pyx_r;
}
-static PyObject *__pyx_k145p;
static PyObject *__pyx_k146p;
+static PyObject *__pyx_k147p;
-static char __pyx_k145[] = "lam < 0";
static char __pyx_k146[] = "lam < 0";
+static char __pyx_k147[] = "lam < 0";
static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_poisson[] = "\n poisson(lam=1.0, size=None)\n\n Poisson distribution.\n\n ";
@@ -6946,33 +7367,35 @@ static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, P
Py_INCREF(__pyx_v_size);
__pyx_v_olam = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2155 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2205 */
__pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2156 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2206 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2157 */
- __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; goto __pyx_L1;}
- if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2207 */
+ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; goto __pyx_L1;}
__pyx_1 = __pyx_1 < 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; goto __pyx_L1;}
- Py_INCREF(__pyx_k145p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k145p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;}
+ Py_INCREF(__pyx_k146p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k146p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2159 */
- __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_flam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2209 */
+ __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_flam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -6980,57 +7403,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, P
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2161 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2211 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2163 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2213 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2213; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_olam));
__pyx_v_olam = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2164 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2214 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_olam));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_olam));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; goto __pyx_L1;}
- Py_INCREF(__pyx_k146p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k146p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; goto __pyx_L1;}
+ Py_INCREF(__pyx_k147p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k147p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2166 */
- __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_olam); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2216 */
+ __pyx_5 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_olam); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -7050,11 +7475,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, P
return __pyx_r;
}
-static PyObject *__pyx_k147p;
static PyObject *__pyx_k148p;
+static PyObject *__pyx_k149p;
-static char __pyx_k147[] = "a <= 1.0";
static char __pyx_k148[] = "a <= 1.0";
+static char __pyx_k149[] = "a <= 1.0";
static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_zipf[] = "\n zipf(a, size=None)\n\n Draw samples from a Zipf distribution.\n\n Samples are drawn from a Zipf distribution with specified parameter (a),\n where a > 1.\n\n The zipf distribution (also known as the zeta\n distribution) is a continuous probability distribution that satisfies\n Zipf\'s law, where the frequency of an item is inversely proportional to\n its rank in a frequency table.\n\n Parameters\n ----------\n a : float\n parameter, > 1.\n size : {tuple, int}\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n Returns\n -------\n samples : {ndarray, scalar}\n The returned samples are greater than or equal to one.\n\n See Also\n --------\n scipy.stats.distributions.zipf : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Zipf distribution is\n\n .. math:: p(x) = \\frac{x^{-a}}{\\zeta(a)},\n\n where :math:`\\zeta` is the Riemann Zeta function.\n\n Named after the American linguist George Kingsley Zipf, who noted that\n the frequency of any word in a sample of a language is inversely\n proportional to its rank in the frequency table.\n\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Zipf Distribution.\" From MathWorld--A Wolfram\n Web Resource. http://mathworld.wolfram.com/ZipfDistribution.html\n .. [2] Wikipedia, \"Zeta distribution\",\n http://en.wikipedia.org/wiki/Zeta_distribution\n .. [3] Wikipedia, \"Zipf\'s Law\",\n http://en.wikipedia.org/wiki/Zipf%27s_law\n .. [4] Zipf, George Kingsley (1932): Selected Studies of the Principle\n of Relative Frequency in Language. Cambridge (Mass.).\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a = 2. # parameter\n >>> s = np.random.zipf(a, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> import scipy.special as sps\n Truncate s values at 50 so plot is interesting\n >>> count, bins, ignored = plt.hist(s[s<50], 50, normed=True)\n >>> x = arange(1., 50.)\n >>> y = x**(-a)/sps.zetac(a)\n >>> plt.plot(x, y/max(y), linewidth=2, color=\'r\')\n >>> plt.show()\n\n ";
@@ -7077,30 +7502,32 @@ static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyOb
Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2247 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2297 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2248 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2298 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2249 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2299 */
__pyx_1 = (__pyx_v_fa <= 1.0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; goto __pyx_L1;}
- Py_INCREF(__pyx_k147p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k147p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;}
+ Py_INCREF(__pyx_k148p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k148p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2251 */
- __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2301 */
+ __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -7108,57 +7535,59 @@ static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyOb
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2253 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2303 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2255 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2305 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2305; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_oa));
__pyx_v_oa = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2256 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2306 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(1.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_oa));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; goto __pyx_L1;}
- Py_INCREF(__pyx_k148p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k148p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L1;}
+ Py_INCREF(__pyx_k149p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k149p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2258 */
- __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2308 */
+ __pyx_5 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2308; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -7178,15 +7607,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-static PyObject *__pyx_k149p;
static PyObject *__pyx_k150p;
static PyObject *__pyx_k151p;
static PyObject *__pyx_k152p;
+static PyObject *__pyx_k153p;
-static char __pyx_k149[] = "p < 0.0";
-static char __pyx_k150[] = "p > 1.0";
-static char __pyx_k151[] = "p < 0.0";
-static char __pyx_k152[] = "p > 1.0";
+static char __pyx_k150[] = "p < 0.0";
+static char __pyx_k151[] = "p > 1.0";
+static char __pyx_k152[] = "p < 0.0";
+static char __pyx_k153[] = "p > 1.0";
static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_geometric[] = "\n geometric(p, size=None)\n\n Draw samples from the geometric distribution.\n\n Bernoulli trials are experiments with one of two outcomes:\n success or failure (an example of such an experiment is flipping\n a coin). The geometric distribution models the number of trials\n that must be run in order to achieve success. It is therefore\n supported on the positive integers, ``k = 1, 2, ...``.\n\n The probability mass function of the geometric distribution is\n\n .. math:: f(k) = (1 - p)^{k - 1} p\n\n where `p` is the probability of success of an individual trial.\n\n Parameters\n ----------\n p : float\n The probability of success of an individual trial.\n size : tuple of ints\n Number of values to draw from the distribution. The output\n is shaped according to `size`.\n\n Returns\n -------\n out : ndarray\n Samples from the geometric distribution, shaped according to\n `size`.\n\n Examples\n --------\n Draw ten thousand values from the geometric distribution,\n with the probability of an individual success equal to 0.35:\n\n >>> z = np.random.geometric(p=0.35, size=10000)\n\n How many trials succeeded after a single run?\n\n >>> (z == 1).sum() / 10000.\n 0.34889999999999999 #random\n\n ";
@@ -7209,45 +7638,49 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,
Py_INCREF(__pyx_v_size);
__pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2308 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2358 */
__pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2309 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2359 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2310 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2360 */
__pyx_1 = (__pyx_v_fp < 0.0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; goto __pyx_L1;}
- Py_INCREF(__pyx_k149p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k149p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;}
+ Py_INCREF(__pyx_k150p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k150p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2312 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2362 */
__pyx_1 = (__pyx_v_fp > 1.0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; goto __pyx_L1;}
- Py_INCREF(__pyx_k150p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k150p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;}
+ Py_INCREF(__pyx_k151p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k151p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2314 */
- __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2364 */
+ __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -7255,94 +7688,98 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2316 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2366 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2319 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2319; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2369 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_op));
__pyx_v_op = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2320 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2370 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_op));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; goto __pyx_L1;}
- Py_INCREF(__pyx_k151p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k151p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; goto __pyx_L1;}
+ Py_INCREF(__pyx_k152p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k152p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2322 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2372 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
+ __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_op));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; goto __pyx_L1;}
- Py_INCREF(__pyx_k152p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k152p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; goto __pyx_L1;}
+ Py_INCREF(__pyx_k153p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k153p);
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2324 */
- __pyx_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_op); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; goto __pyx_L1;}
- __pyx_r = __pyx_3;
- __pyx_3 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2374 */
+ __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_op); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; goto __pyx_L1;}
+ __pyx_r = __pyx_2;
+ __pyx_2 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -7364,7 +7801,6 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,
static PyObject *__pyx_n_add;
-static PyObject *__pyx_k153p;
static PyObject *__pyx_k154p;
static PyObject *__pyx_k155p;
static PyObject *__pyx_k156p;
@@ -7372,15 +7808,16 @@ static PyObject *__pyx_k157p;
static PyObject *__pyx_k158p;
static PyObject *__pyx_k159p;
static PyObject *__pyx_k160p;
+static PyObject *__pyx_k161p;
-static char __pyx_k153[] = "ngood < 1";
-static char __pyx_k154[] = "nbad < 1";
-static char __pyx_k155[] = "nsample < 1";
-static char __pyx_k156[] = "ngood + nbad < nsample";
-static char __pyx_k157[] = "ngood < 1";
-static char __pyx_k158[] = "nbad < 1";
-static char __pyx_k159[] = "nsample < 1";
-static char __pyx_k160[] = "ngood + nbad < nsample";
+static char __pyx_k154[] = "ngood < 1";
+static char __pyx_k155[] = "nbad < 1";
+static char __pyx_k156[] = "nsample < 1";
+static char __pyx_k157[] = "ngood + nbad < nsample";
+static char __pyx_k158[] = "ngood < 1";
+static char __pyx_k159[] = "nbad < 1";
+static char __pyx_k160[] = "nsample < 1";
+static char __pyx_k161[] = "ngood + nbad < nsample";
static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = "\n hypergeometric(ngood, nbad, nsample, size=None)\n\n Hypergeometric distribution.\n\n Consider an urn with ngood \"good\" balls and nbad \"bad\" balls. If one\n were to draw nsample balls from the urn without replacement, then\n the hypergeometric distribution describes the distribution of \"good\"\n balls in the sample.\n\n ";
@@ -7414,286 +7851,302 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_
__pyx_v_onbad = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_onsample = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2341 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2391 */
__pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2342 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2392 */
__pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2343 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2393 */
__pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2344 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2394 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2345 */
- __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; goto __pyx_L1;}
- if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2395 */
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;}
__pyx_1 = __pyx_1 < 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; goto __pyx_L1;}
- Py_INCREF(__pyx_k153p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k153p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
+ Py_INCREF(__pyx_k154p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k154p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2347 */
- __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; goto __pyx_L1;}
- if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2397 */
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;}
__pyx_1 = __pyx_1 < 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; goto __pyx_L1;}
- Py_INCREF(__pyx_k154p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k154p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;}
+ Py_INCREF(__pyx_k155p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k155p);
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2349 */
- __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; goto __pyx_L1;}
- if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2399 */
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; goto __pyx_L1;}
__pyx_1 = __pyx_1 < 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; goto __pyx_L1;}
- Py_INCREF(__pyx_k155p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k155p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2400; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2400; goto __pyx_L1;}
+ Py_INCREF(__pyx_k156p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k156p);
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2400; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2400; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2351 */
- __pyx_2 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; goto __pyx_L1;}
- if (PyObject_Cmp(__pyx_2, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2401 */
+ __pyx_4 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_4, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; goto __pyx_L1;}
__pyx_1 = __pyx_1 < 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2352; goto __pyx_L1;}
- Py_INCREF(__pyx_k156p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k156p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2352; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; goto __pyx_L1;}
+ Py_INCREF(__pyx_k157p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k157p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2352; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2353 */
- __pyx_3 = __pyx_f_6mtrand_discnmN_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_lngood,__pyx_v_lnbad,__pyx_v_lnsample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2353; goto __pyx_L1;}
- __pyx_r = __pyx_3;
- __pyx_3 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2403 */
+ __pyx_2 = __pyx_f_6mtrand_discnmN_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_lngood,__pyx_v_lnbad,__pyx_v_lnsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2403; goto __pyx_L1;}
+ __pyx_r = __pyx_2;
+ __pyx_2 = 0;
goto __pyx_L0;
goto __pyx_L2;
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2357 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2407 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2359 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2359; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2409 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_ongood));
- __pyx_v_ongood = ((PyArrayObject *)__pyx_2);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_v_ongood = ((PyArrayObject *)__pyx_3);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2360 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2360; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2410 */
+ __pyx_4 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_onbad));
- __pyx_v_onbad = ((PyArrayObject *)__pyx_3);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_v_onbad = ((PyArrayObject *)__pyx_4);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2361 */
- __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2411 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_onsample));
__pyx_v_onsample = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2362 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2412 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_ongood));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_ongood));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;}
- Py_INCREF(__pyx_k157p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k157p);
- __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; goto __pyx_L1;}
+ Py_INCREF(__pyx_k158p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k158p);
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; goto __pyx_L1;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2364 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2414 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
+ __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_onbad));
- PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_onbad));
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_onbad));
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; goto __pyx_L1;}
- Py_INCREF(__pyx_k158p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k158p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; goto __pyx_L1;}
+ Py_INCREF(__pyx_k159p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k159p);
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; goto __pyx_L1;}
goto __pyx_L8;
}
__pyx_L8:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2366 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2416 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_onsample));
- PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_onsample));
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_onsample));
+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; goto __pyx_L1;}
- Py_INCREF(__pyx_k159p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k159p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; goto __pyx_L1;}
+ Py_INCREF(__pyx_k160p);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k160p);
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; goto __pyx_L1;}
goto __pyx_L9;
}
__pyx_L9:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2368 */
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2418 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_add); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_ongood));
- PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_ongood));
+ PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ongood));
Py_INCREF(((PyObject *)__pyx_v_onbad));
- PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onbad));
- __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_onbad));
+ __pyx_6 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_6);
Py_INCREF(((PyObject *)__pyx_v_onsample));
- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_onsample));
+ PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onsample));
__pyx_6 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; goto __pyx_L1;}
- Py_INCREF(__pyx_k160p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k160p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; goto __pyx_L1;}
+ Py_INCREF(__pyx_k161p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k161p);
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; goto __pyx_L1;}
goto __pyx_L10;
}
__pyx_L10:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2370 */
- __pyx_4 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ongood,__pyx_v_onbad,__pyx_v_onsample); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2420 */
+ __pyx_6 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ongood,__pyx_v_onbad,__pyx_v_onsample); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; goto __pyx_L1;}
+ __pyx_r = __pyx_6;
+ __pyx_6 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -7718,15 +8171,17 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_
return __pyx_r;
}
-static PyObject *__pyx_k161p;
+static PyObject *__pyx_n_greater_equal;
+
static PyObject *__pyx_k162p;
static PyObject *__pyx_k163p;
static PyObject *__pyx_k164p;
+static PyObject *__pyx_k165p;
-static char __pyx_k161[] = "p < 0.0";
-static char __pyx_k162[] = "p > 1.0";
-static char __pyx_k163[] = "p < 0.0";
-static char __pyx_k164[] = "p > 1.0";
+static char __pyx_k162[] = "p <= 0.0";
+static char __pyx_k163[] = "p >= 1.0";
+static char __pyx_k164[] = "p <= 0.0";
+static char __pyx_k165[] = "p >= 1.0";
static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_logseries[] = "\n logseries(p, size=None)\n\n Logarithmic series distribution.\n\n ";
@@ -7749,45 +8204,49 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,
Py_INCREF(__pyx_v_size);
__pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2383 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2433 */
__pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2384 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2434 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2385 */
- __pyx_1 = (__pyx_v_fp < 0.0);
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2435 */
+ __pyx_1 = (__pyx_v_fp <= 0.0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; goto __pyx_L1;}
- Py_INCREF(__pyx_k161p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k161p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;}
+ Py_INCREF(__pyx_k162p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k162p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2387 */
- __pyx_1 = (__pyx_v_fp > 1.0);
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2437 */
+ __pyx_1 = (__pyx_v_fp >= 1.0);
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; goto __pyx_L1;}
- Py_INCREF(__pyx_k162p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k162p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;}
+ Py_INCREF(__pyx_k163p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k163p);
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2389 */
- __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2439 */
+ __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -7795,94 +8254,98 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2391 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2441 */
PyErr_Clear();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2393 */
- __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2443 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2443; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_op));
__pyx_v_op = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2394 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2444 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_op));
PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;}
- Py_INCREF(__pyx_k163p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k163p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; goto __pyx_L1;}
+ Py_INCREF(__pyx_k164p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k164p);
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2396 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2446 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
+ __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_op));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;}
- Py_INCREF(__pyx_k164p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k164p);
- __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; goto __pyx_L1;}
+ Py_INCREF(__pyx_k165p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k165p);
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2398 */
- __pyx_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_op); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;}
- __pyx_r = __pyx_3;
- __pyx_3 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2448 */
+ __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_op); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2448; goto __pyx_L1;}
+ __pyx_r = __pyx_2;
+ __pyx_2 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -7904,22 +8367,24 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,
static PyObject *__pyx_n_array;
static PyObject *__pyx_n_shape;
+static PyObject *__pyx_n_list;
static PyObject *__pyx_n_append;
static PyObject *__pyx_n_multiply;
static PyObject *__pyx_n_reduce;
static PyObject *__pyx_n_svd;
static PyObject *__pyx_n_dot;
static PyObject *__pyx_n_sqrt;
+static PyObject *__pyx_n_tuple;
-static PyObject *__pyx_k165p;
static PyObject *__pyx_k166p;
static PyObject *__pyx_k167p;
static PyObject *__pyx_k168p;
+static PyObject *__pyx_k169p;
-static char __pyx_k165[] = "mean must be 1 dimensional";
-static char __pyx_k166[] = "cov must be 2 dimensional and square";
-static char __pyx_k167[] = "mean and cov must have same length";
-static char __pyx_k168[] = "numpy.dual";
+static char __pyx_k166[] = "mean must be 1 dimensional";
+static char __pyx_k167[] = "cov must be 2 dimensional and square";
+static char __pyx_k168[] = "mean and cov must have same length";
+static char __pyx_k169[] = "numpy.dual";
static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = "\n multivariate_normal(mean, cov[, size])\n\n Draw random samples from a multivariate normal distribution.\n\n The multivariate normal, multinormal or Gaussian distribution is a\n generalisation of the one-dimensional normal distribution to higher\n dimensions.\n\n Such a distribution is specified by its mean and covariance matrix,\n which are analogous to the mean (average or \"centre\") and variance\n (standard deviation squared or \"width\") of the one-dimensional normal\n distribution.\n\n Parameters\n ----------\n mean : (N,) ndarray\n Mean of the N-dimensional distribution.\n cov : (N,N) ndarray\n Covariance matrix of the distribution.\n size : tuple of ints, optional\n Given a shape of, for example, (m,n,k), m*n*k samples are\n generated, and packed in an m-by-n-by-k arrangement. Because each\n sample is N-dimensional, the output shape is (m,n,k,N). If no\n shape is specified, a single sample is returned.\n\n Returns\n -------\n out : ndarray\n The drawn samples, arranged according to `size`. If the\n shape given is (m,n,...), then the shape of `out` is is\n (m,n,...,N).\n\n In other words, each entry ``out[i,j,...,:]`` is an N-dimensional\n value drawn from the distribution.\n\n Notes\n -----\n The mean is a coordinate in N-dimensional space, which represents the\n location where samples are most likely to be generated. This is\n analogous to the peak of the bell curve for the one-dimensional or\n univariate normal distribution.\n\n Covariance indicates the level to which two variables vary together.\n From the multivariate normal distribution, we draw N-dimensional\n samples, :math:`X = [x_1, x_2, ... x_N]`. The covariance matrix\n element :math:`C_{ij}` is the covariance of :math:`x_i` and :math:`x_j`.\n The element :math:`C_{ii}` is the variance of :math:`x_i` (i.e. its\n \"spread\").\n\n Instead of specifying the full covariance matrix, popular\n approximations include:\n\n - Spherical covariance (`cov` is a multiple of the identity matrix)\n - Diagonal covariance (`cov` has non-negative elements, and only on\n the diagonal)\n\n This geometrical property can be seen in two dimensions by plotting\n generated data-points:\n\n >>> mean = [0,0]\n >>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis\n\n >>> import matplotlib.pyplot as plt\n >>> x,y = np.random.multivariate_normal(mean,cov,5000).T\n >>> plt.plot(x,y,\'x\'); plt.axis(\'equal\'); plt.show()\n\n Note that the covariance matrix must be non-negative definite.\n\n References\n ----------\n .. [1] A. Papoulis, \"Probability, Random Variables, and Stochastic\n Processes,\" 3rd ed., McGraw-Hill Companies, 1991\n .. [2] R.O. Duda, P.E. Hart, and D.G. Stork, \"Pattern Classification,\"\n 2nd ed., Wiley, 2001.\n\n Examples\n --------\n >>> mean = (1,2)\n >>> cov = [[1,0],[1,0]]\n >>> x = np.random.multivariate_normal(mean,cov,(3,3))\n >>> x.shape\n (3, 3, 2)\n\n The following is probably true, given that 0.6 is roughly twice the\n standard deviation:\n\n >>> print list( (x[0,0,:] - mean) < 0.6 )\n [True, True]\n\n ";
@@ -7956,38 +8421,38 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p
__pyx_v_s = Py_None; Py_INCREF(Py_None);
__pyx_v_v = Py_None; Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2494 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2544 */
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;}
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; goto __pyx_L1;}
Py_INCREF(__pyx_v_mean);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);
- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_mean);
__pyx_v_mean = __pyx_3;
__pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2495 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2545 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; goto __pyx_L1;}
Py_INCREF(__pyx_v_cov);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);
- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_cov);
__pyx_v_cov = __pyx_2;
__pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2496 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2546 */
__pyx_4 = __pyx_v_size == Py_None;
if (__pyx_4) {
- __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2497; goto __pyx_L1;}
+ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; goto __pyx_L1;}
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_1;
__pyx_1 = 0;
@@ -8000,82 +8465,98 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2500 */
- __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2500; goto __pyx_L1;}
- __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2500; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2550 */
+ __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; goto __pyx_L1;}
+ __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_4 = (__pyx_5 != 1);
if (__pyx_4) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; goto __pyx_L1;}
- Py_INCREF(__pyx_k165p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k165p);
- __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; goto __pyx_L1;}
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; goto __pyx_L1;}
+ Py_INCREF(__pyx_k166p);
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k166p);
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_1, 0, 0);
Py_DECREF(__pyx_1); __pyx_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2502 */
- __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;}
- __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2552 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
+ __pyx_5 = PyObject_Length(__pyx_2); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = (__pyx_5 != 2);
if (!__pyx_4) {
- __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;}
- __pyx_1 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;}
- __pyx_2 = PySequence_GetItem(__pyx_3, 1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;}
- __pyx_4 = __pyx_4 != 0;
+ __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
+ __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ if (PyObject_Cmp(__pyx_2, __pyx_6, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;}
+ __pyx_4 = __pyx_4 != 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
}
if (__pyx_4) {
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; goto __pyx_L1;}
- Py_INCREF(__pyx_k166p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k166p);
- __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __Pyx_Raise(__pyx_1, 0, 0);
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; goto __pyx_L1;}
+ Py_INCREF(__pyx_k167p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k167p);
+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2504 */
- __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;}
- __pyx_3 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;}
- __pyx_2 = PySequence_GetItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2554 */
+ __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;}
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyObject_Cmp(__pyx_3, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;}
+ __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;}
__pyx_4 = __pyx_4 != 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_4) {
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; goto __pyx_L1;}
- Py_INCREF(__pyx_k167p);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k167p);
- __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; goto __pyx_L1;}
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; goto __pyx_L1;}
+ Py_INCREF(__pyx_k168p);
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k168p);
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2507 */
- __pyx_4 = PyObject_IsInstance(__pyx_v_shape,((PyObject *)(&PyInt_Type))); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2557 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; goto __pyx_L1;}
+ __pyx_4 = PyObject_IsInstance(__pyx_v_shape,__pyx_1); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_4) {
- __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2508; goto __pyx_L1;}
+ __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2558; goto __pyx_L1;}
Py_INCREF(__pyx_v_shape);
PyList_SET_ITEM(__pyx_2, 0, __pyx_v_shape);
Py_DECREF(__pyx_v_shape);
@@ -8085,166 +8566,174 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p
}
__pyx_L6:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2509 */
- __pyx_1 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
- __pyx_1 = 0;
- __pyx_2 = PyObject_CallObject(((PyObject *)(&PyList_Type)), __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2559 */
+ __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; goto __pyx_L1;}
+ __pyx_3 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; goto __pyx_L1;}
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_final_shape);
__pyx_v_final_shape = __pyx_2;
__pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2510 */
- __pyx_1 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;}
- __pyx_2 = PySequence_GetItem(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2560 */
+ __pyx_3 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;}
+ __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;}
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2514 */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;}
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2564 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;}
+ __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;}
Py_INCREF(__pyx_v_final_shape);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_final_shape);
- __pyx_6 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);
+ __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_6);
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6);
__pyx_6 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_x);
- __pyx_v_x = __pyx_2;
- __pyx_2 = 0;
+ __pyx_v_x = __pyx_3;
+ __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2515 */
- __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2565 */
+ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
- __pyx_2 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_5 - 1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
- __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; goto __pyx_L1;}
- __pyx_3 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1);
- PyTuple_SET_ITEM(__pyx_6, 1, __pyx_3);
- __pyx_1 = 0;
+ __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
+ __pyx_3 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_5 - 1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3);
__pyx_3 = 0;
- if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; goto __pyx_L1;}
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; goto __pyx_L1;}
+ __pyx_6 = PyObject_GetItem(__pyx_3, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_6);
+ __pyx_2 = 0;
+ __pyx_6 = 0;
+ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2524 */
- __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2574 */
+ __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; goto __pyx_L1;}
Py_INCREF(__pyx_n_svd);
- PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);
- __pyx_1 = __Pyx_Import(__pyx_k168p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_svd); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; goto __pyx_L1;}
- Py_DECREF(__pyx_v_svd);
- __pyx_v_svd = __pyx_3;
- __pyx_3 = 0;
+ PyList_SET_ITEM(__pyx_1, 0, __pyx_n_svd);
+ __pyx_2 = __Pyx_Import(__pyx_k169p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_6 = PyObject_GetAttr(__pyx_2, __pyx_n_svd); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_svd);
+ __pyx_v_svd = __pyx_6;
+ __pyx_6 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2526 */
- __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2576 */
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;}
Py_INCREF(__pyx_v_cov);
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_cov);
- __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);
+ __pyx_1 = PyObject_CallObject(__pyx_v_svd, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_6 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;}
Py_DECREF(__pyx_v_u);
- __pyx_v_u = __pyx_3;
- __pyx_3 = 0;
- __pyx_6 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;}
- Py_DECREF(__pyx_v_s);
- __pyx_v_s = __pyx_6;
+ __pyx_v_u = __pyx_6;
__pyx_6 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;}
+ __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_s);
+ __pyx_v_s = __pyx_3;
+ __pyx_3 = 0;
+ __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;}
Py_DECREF(__pyx_v_v);
- __pyx_v_v = __pyx_2;
- __pyx_2 = 0;
- if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
-
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2527 */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
- __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_dot); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_sqrt); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
+ __pyx_v_v = __pyx_1;
+ __pyx_1 = 0;
+ if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
- Py_INCREF(__pyx_v_s);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);
- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
+
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2577 */
+ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_dot); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = PyNumber_Multiply(__pyx_v_x, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
+ Py_INCREF(__pyx_v_s);
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_s);
+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
- Py_INCREF(__pyx_v_v);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);
- __pyx_1 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
+ Py_INCREF(__pyx_v_v);
+ PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_v);
+ __pyx_2 = 0;
+ __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_v_x);
- __pyx_v_x = __pyx_2;
- __pyx_2 = 0;
+ __pyx_v_x = __pyx_1;
+ __pyx_1 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2530 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;}
- __pyx_6 = PyObject_GetAttr(__pyx_1, __pyx_n_add); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2580 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; goto __pyx_L1;}
Py_INCREF(__pyx_v_mean);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_mean);
Py_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_x);
Py_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);
- __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
+ PyTuple_SET_ITEM(__pyx_6, 2, __pyx_v_x);
+ __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2531 */
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2581 */
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; goto __pyx_L1;}
Py_INCREF(__pyx_v_final_shape);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_final_shape);
- __pyx_6 = PyObject_CallObject(((PyObject *)(&PyTuple_Type)), __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);
+ __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2532 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2582 */
Py_INCREF(__pyx_v_x);
__pyx_r = __pyx_v_x;
goto __pyx_L0;
@@ -8275,9 +8764,9 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p
static PyObject *__pyx_n_zeros;
-static PyObject *__pyx_k170p;
+static PyObject *__pyx_k171p;
-static char __pyx_k170[] = "sum(pvals[:-1]) > 1.0";
+static char __pyx_k171[] = "sum(pvals[:-1]) > 1.0";
static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_multinomial[] = "\n multinomial(n, pvals, size=None)\n\n Draw samples from a multinomial distribution.\n\n The multinomial distribution is a multivariate generalisation of the\n binomial distribution. Take an experiment with one of ``p``\n possible outcomes. An example of such an experiment is throwing a dice,\n where the outcome can be 1 through 6. Each sample drawn from the\n distribution represents `n` such experiments. Its values,\n ``X_i = [X_0, X_1, ..., X_p]``, represent the number of times the outcome\n was ``i``.\n\n Parameters\n ----------\n n : int\n Number of experiments.\n pvals : sequence of floats, length p\n Probabilities of each of the ``p`` different outcomes. These\n should sum to 1 (however, the last element is always assumed to\n account for the remaining probability, as long as\n ``sum(pvals[:-1]) <= 1)``.\n size : tuple of ints\n Given a `size` of ``(M, N, K)``, then ``M*N*K`` samples are drawn,\n and the output shape becomes ``(M, N, K, p)``, since each sample\n has shape ``(p,)``.\n\n Examples\n --------\n Throw a dice 20 times:\n\n >>> np.random.multinomial(20, [1/6.]*6, size=1)\n array([[4, 1, 7, 5, 2, 1]])\n\n It landed 4 times on 1, once on 2, etc.\n\n Now, throw the dice 20 times, and 20 times again:\n\n >>> np.random.multinomial(20, [1/6.]*6, size=2)\n array([[3, 4, 3, 3, 4, 3],\n [2, 4, 3, 4, 0, 7]])\n\n For the first run, we threw 3 times 1, 4 times 2, etc. For the second,\n we threw 2 times 1, 4 times 2, etc.\n\n A loaded dice is more likely to land on number 6:\n\n >>> np.random.multinomial(100, [1/7.]*5)\n array([13, 16, 13, 16, 42])\n\n ";
@@ -8314,40 +8803,42 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
__pyx_v_shape = Py_None; Py_INCREF(Py_None);
__pyx_v_multin = Py_None; Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2593 */
- __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2643 */
+ __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; goto __pyx_L1;}
__pyx_v_d = __pyx_1;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2594 */
- __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2644 */
+ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject_parr));
arrayObject_parr = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2595 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2645 */
__pyx_v_pix = ((double *)arrayObject_parr->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2597 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2647 */
__pyx_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > (1.0 + 1e-12));
if (__pyx_3) {
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; goto __pyx_L1;}
- Py_INCREF(__pyx_k170p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k170p);
- __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; goto __pyx_L1;}
+ Py_INCREF(__pyx_k171p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k171p);
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; goto __pyx_L1;}
+ __Pyx_Raise(__pyx_5, 0, 0);
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2600 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2650 */
__pyx_3 = __pyx_v_size == Py_None;
if (__pyx_3) {
- __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
Py_DECREF(__pyx_v_shape);
@@ -8355,16 +8846,20 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
__pyx_4 = 0;
goto __pyx_L3;
}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- __pyx_4 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = __pyx_4 == ((PyObject *)(&PyInt_Type));
+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; goto __pyx_L1;}
+ __pyx_3 = __pyx_4 == __pyx_5;
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_3) {
- __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2603; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2603; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
@@ -8375,67 +8870,68 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
goto __pyx_L3;
}
/*else*/ {
- __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_2 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_5 = PyInt_FromLong(__pyx_v_d); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2655; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2655; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_4 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2655; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_shape);
- __pyx_v_shape = __pyx_2;
- __pyx_2 = 0;
+ __pyx_v_shape = __pyx_4;
+ __pyx_4 = 0;
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2607 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2657 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;}
Py_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_shape);
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)(&PyInt_Type)));
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_v_multin);
- __pyx_v_multin = __pyx_5;
- __pyx_5 = 0;
+ __pyx_v_multin = __pyx_4;
+ __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2608 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2658 */
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin)));
Py_DECREF(((PyObject *)arrayObject_mnarr));
arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2609 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2659 */
__pyx_v_mnix = ((long *)arrayObject_mnarr->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2610 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2660 */
__pyx_v_i = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2611 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2661 */
while (1) {
__pyx_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));
if (!__pyx_3) break;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2612 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2662 */
__pyx_v_Sum = 1.0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2613 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2663 */
__pyx_v_dn = __pyx_v_n;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2614 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2664 */
__pyx_6 = (__pyx_v_d - 1);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; ++__pyx_v_j) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2615 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2665 */
(__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2616 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2666 */
__pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2617 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2667 */
__pyx_3 = (__pyx_v_dn <= 0);
if (__pyx_3) {
goto __pyx_L7;
@@ -8443,12 +8939,12 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
}
__pyx_L8:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2619 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2669 */
__pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));
}
__pyx_L7:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2620 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2670 */
__pyx_3 = (__pyx_v_dn > 0);
if (__pyx_3) {
(__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;
@@ -8456,11 +8952,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
}
__pyx_L9:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2623 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2673 */
__pyx_v_i = (__pyx_v_i + __pyx_v_d);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2625 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2675 */
Py_INCREF(__pyx_v_multin);
__pyx_r = __pyx_v_multin;
goto __pyx_L0;
@@ -8518,25 +9014,25 @@ static PyObject *__pyx_f_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self,
__pyx_v_shape = Py_None; Py_INCREF(Py_None);
__pyx_v_diric = Py_None; Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2691 */
- __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2691; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2741 */
+ __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;}
__pyx_v_k = __pyx_1;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2692 */
- __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2742 */
+ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2742; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_alpha_arr));
__pyx_v_alpha_arr = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2693 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2743 */
__pyx_v_alpha_data = ((double *)__pyx_v_alpha_arr->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2695 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2745 */
__pyx_3 = __pyx_v_size == Py_None;
if (__pyx_3) {
- __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
Py_DECREF(__pyx_v_shape);
@@ -8544,102 +9040,106 @@ static PyObject *__pyx_f_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self,
__pyx_4 = 0;
goto __pyx_L2;
}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- __pyx_4 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = __pyx_4 == ((PyObject *)(&PyInt_Type));
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; goto __pyx_L1;}
+ __pyx_3 = __pyx_5 == __pyx_2;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_3) {
- __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; goto __pyx_L1;}
+ __pyx_4 = PyInt_FromLong(__pyx_v_k); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
- __pyx_2 = 0;
- Py_DECREF(__pyx_v_shape);
- __pyx_v_shape = __pyx_4;
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
__pyx_4 = 0;
+ Py_DECREF(__pyx_v_shape);
+ __pyx_v_shape = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L2;
}
/*else*/ {
- __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2750; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2750; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_2 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; goto __pyx_L1;}
+ __pyx_5 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2750; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_shape);
- __pyx_v_shape = __pyx_2;
- __pyx_2 = 0;
+ __pyx_v_shape = __pyx_5;
+ __pyx_5 = 0;
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2702 */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;}
- Py_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5);
- __pyx_5 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2752 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_zeros); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_float64); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;}
+ Py_INCREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_v_diric);
- __pyx_v_diric = __pyx_5;
- __pyx_5 = 0;
+ __pyx_v_diric = __pyx_2;
+ __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2703 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2753 */
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric)));
Py_DECREF(((PyObject *)__pyx_v_val_arr));
__pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2704 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2754 */
__pyx_v_val_data = ((double *)__pyx_v_val_arr->data);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2706 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2756 */
__pyx_v_i = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2707 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2757 */
__pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2708 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2758 */
while (1) {
__pyx_3 = (__pyx_v_i < __pyx_v_totsize);
if (!__pyx_3) break;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2709 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2759 */
__pyx_v_acc = 0.0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2710 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2760 */
for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2711 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2761 */
(__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = rk_standard_gamma(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,(__pyx_v_alpha_data[__pyx_v_j]));
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2712 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2762 */
__pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]));
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2713 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2763 */
__pyx_v_invacc = (1 / __pyx_v_acc);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2714 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2764 */
for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) {
(__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = ((__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) * __pyx_v_invacc);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2716 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2766 */
__pyx_v_i = (__pyx_v_i + __pyx_v_k);
}
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2718 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2768 */
Py_INCREF(__pyx_v_diric);
__pyx_r = __pyx_v_diric;
goto __pyx_L0;
@@ -8684,25 +9184,28 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2731 */
- __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2781 */
+ __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; goto __pyx_L1;}
__pyx_v_i = (__pyx_1 - 1);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2732 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2782 */
/*try:*/ {
- __pyx_2 = PySequence_GetItem(__pyx_v_x, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; goto __pyx_L2;}
- __pyx_1 = PyObject_Length(__pyx_2); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; goto __pyx_L2;}
+ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; goto __pyx_L2;}
+ __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; goto __pyx_L2;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = PyObject_Length(__pyx_3); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; goto __pyx_L2;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_v_j = __pyx_1;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
+ Py_XDECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2734 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2784 */
/*except:*/ {
__Pyx_AddTraceback("mtrand.shuffle");
- if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; goto __pyx_L1;}
+ if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;}
__pyx_v_j = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
@@ -8711,64 +9214,82 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P
}
__pyx_L3:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2737 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2787 */
__pyx_5 = (__pyx_v_j == 0);
if (__pyx_5) {
while (1) {
__pyx_5 = (__pyx_v_i > 0);
if (!__pyx_5) break;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2740 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2790 */
__pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2741 */
- __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;}
- __pyx_3 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;}
- if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2791 */
+ __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;}
+ __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
+ if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
+ if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2742 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2792 */
__pyx_v_i = (__pyx_v_i - 1);
}
goto __pyx_L4;
}
/*else*/ {
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2745 */
- __pyx_4 = PySequence_GetItem(__pyx_v_x, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2745; goto __pyx_L1;}
- __pyx_5 = PyObject_HasAttr(__pyx_4,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2745; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2795 */
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_5 = PyObject_HasAttr(__pyx_2,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_v_copy = __pyx_5;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2746 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2796 */
__pyx_5 = __pyx_v_copy;
if (__pyx_5) {
while (1) {
__pyx_5 = (__pyx_v_i > 0);
if (!__pyx_5) break;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2748 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2798 */
__pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2749 */
- __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2799 */
+ __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_copy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;}
+ __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2750 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2800 */
__pyx_v_i = (__pyx_v_i - 1);
}
goto __pyx_L7;
@@ -8778,22 +9299,30 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P
__pyx_5 = (__pyx_v_i > 0);
if (!__pyx_5) break;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2753 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2803 */
__pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2754 */
- __pyx_3 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;}
- __pyx_4 = PySequence_GetSlice(__pyx_3, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;}
- __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2804 */
+ __pyx_4 = PyInt_FromLong(__pyx_v_j); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;}
+ __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;}
+ __pyx_4 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2755 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2805 */
__pyx_v_i = (__pyx_v_i - 1);
}
}
@@ -8825,67 +9354,68 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
- int __pyx_3;
- PyObject *__pyx_4 = 0;
+ PyObject *__pyx_3 = 0;
+ int __pyx_4;
static char *__pyx_argnames[] = {"x",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x);
__pyx_v_arr = Py_None; Py_INCREF(Py_None);
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2784 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_integer); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;}
- Py_INCREF(((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)(&PyInt_Type)));
- PyTuple_SET_ITEM(__pyx_1, 1, __pyx_2);
- __pyx_2 = 0;
- __pyx_3 = PyObject_IsInstance(__pyx_v_x,__pyx_1); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__pyx_3) {
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2834 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_3);
+ __pyx_1 = 0;
+ __pyx_3 = 0;
+ __pyx_4 = PyObject_IsInstance(__pyx_v_x,__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ if (__pyx_4) {
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;}
Py_INCREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);
- __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_arr);
- __pyx_v_arr = __pyx_4;
- __pyx_4 = 0;
+ __pyx_v_arr = __pyx_1;
+ __pyx_1 = 0;
goto __pyx_L2;
}
/*else*/ {
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;}
Py_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_x);
- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_arr);
- __pyx_v_arr = __pyx_1;
- __pyx_1 = 0;
+ __pyx_v_arr = __pyx_3;
+ __pyx_3 = 0;
}
__pyx_L2:;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2788 */
- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2838 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2838; goto __pyx_L1;}
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2838; goto __pyx_L1;}
Py_INCREF(__pyx_v_arr);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_arr);
- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_arr);
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2838; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2789 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2839 */
Py_INCREF(__pyx_v_arr);
__pyx_r = __pyx_v_arr;
goto __pyx_L0;
@@ -8895,7 +9425,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_4);
+ Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("mtrand.RandomState.permutation");
__pyx_r = 0;
__pyx_L0:;
@@ -8907,6 +9437,8 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_MT19937, "MT19937"},
+ {&__pyx_n_TypeError, "TypeError"},
+ {&__pyx_n_ValueError, "ValueError"},
{&__pyx_n___RandomState_ctor, "__RandomState_ctor"},
{&__pyx_n__rand, "_rand"},
{&__pyx_n_add, "add"},
@@ -8931,12 +9463,15 @@ static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_geometric, "geometric"},
{&__pyx_n_get_state, "get_state"},
{&__pyx_n_greater, "greater"},
+ {&__pyx_n_greater_equal, "greater_equal"},
{&__pyx_n_gumbel, "gumbel"},
{&__pyx_n_hypergeometric, "hypergeometric"},
+ {&__pyx_n_int, "int"},
{&__pyx_n_integer, "integer"},
{&__pyx_n_laplace, "laplace"},
{&__pyx_n_less, "less"},
{&__pyx_n_less_equal, "less_equal"},
+ {&__pyx_n_list, "list"},
{&__pyx_n_logistic, "logistic"},
{&__pyx_n_lognormal, "lognormal"},
{&__pyx_n_logseries, "logseries"},
@@ -8975,6 +9510,8 @@ static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_subtract, "subtract"},
{&__pyx_n_svd, "svd"},
{&__pyx_n_triangular, "triangular"},
+ {&__pyx_n_tuple, "tuple"},
+ {&__pyx_n_type, "type"},
{&__pyx_n_uint, "uint"},
{&__pyx_n_uint32, "uint32"},
{&__pyx_n_uniform, "uniform"},
@@ -8993,10 +9530,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},
{&__pyx_k65p, __pyx_k65, sizeof(__pyx_k65)},
{&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},
- {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},
+ {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},
{&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},
{&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},
- {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},
+ {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},
{&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},
{&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},
{&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},
@@ -9092,7 +9629,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_k166p, __pyx_k166, sizeof(__pyx_k166)},
{&__pyx_k167p, __pyx_k167, sizeof(__pyx_k167)},
{&__pyx_k168p, __pyx_k168, sizeof(__pyx_k168)},
- {&__pyx_k170p, __pyx_k170, sizeof(__pyx_k170)},
+ {&__pyx_k169p, __pyx_k169, sizeof(__pyx_k169)},
+ {&__pyx_k171p, __pyx_k171, sizeof(__pyx_k171)},
{0, 0, 0}
};
@@ -9115,6 +9653,14 @@ static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {
(*o->ob_type->tp_free)(o);
}
+static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {
+ return 0;
+}
+
+static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {
+ return 0;
+}
+
static struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {
{"seed", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},
{"get_state", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},
@@ -9260,10 +9806,10 @@ PyTypeObject __pyx_type_6mtrand_RandomState = {
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"\n RandomState(seed=None)\n\n Container for the Mersenne Twister PRNG.\n\n `RandomState` exposes a number of methods for generating random numbers\n drawn from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n `size` that defaults to ``None``. If `size` is ``None``, then a single\n value is generated and returned. If `size` is an integer, then a 1-D\n numpy array filled with generated values is returned. If size is a tuple,\n then a numpy array with that shape is filled and returned.\n\n Parameters\n ----------\n seed : {None, int, array-like}\n Random seed initializing the PRNG.\n Can be an integer, an array (or other sequence) of integers of\n any length, or ``None``.\n If `seed` is ``None``, then `RandomState` will try to read data from\n ``/dev/urandom`` (or the Windows analogue) if available or seed from\n the clock otherwise.\n\n ", /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
+ __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/
+ __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -9327,559 +9873,559 @@ PyMODINIT_FUNC initmtrand(void) {
__pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; goto __pyx_L1;}
__pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (!__pyx_ptype_6mtrand_flatiter) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (!__pyx_ptype_6mtrand_broadcast) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; goto __pyx_L1;}
- if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;}
- if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;}
+ if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}
+ if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}
__pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":120 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":121 */
import_array();
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":122 */
- __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
- if (PyObject_SetAttr(__pyx_m, __pyx_n_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":123 */
+ __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":496 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":546 */
Py_INCREF(Py_None);
__pyx_k2 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":506 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":556 */
Py_INCREF(Py_None);
__pyx_k3 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":596 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":646 */
Py_INCREF(Py_None);
__pyx_k4 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":605 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":655 */
Py_INCREF(Py_None);
__pyx_k5 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":633 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":683 */
Py_INCREF(Py_None);
__pyx_k6 = Py_None;
Py_INCREF(Py_None);
__pyx_k7 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":697 */
- __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":747 */
+ __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;}
__pyx_k8 = __pyx_1;
__pyx_1 = 0;
- __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;}
__pyx_k9 = __pyx_2;
__pyx_2 = 0;
Py_INCREF(Py_None);
__pyx_k10 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":845 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":895 */
Py_INCREF(Py_None);
__pyx_k11 = Py_None;
Py_INCREF(Py_None);
__pyx_k12 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":860 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":910 */
Py_INCREF(Py_None);
__pyx_k13 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":869 */
- __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":919 */
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;}
__pyx_k14 = __pyx_3;
__pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;}
__pyx_k15 = __pyx_4;
__pyx_4 = 0;
Py_INCREF(Py_None);
__pyx_k16 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":969 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1019 */
Py_INCREF(Py_None);
__pyx_k17 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1028 */
- __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1078 */
+ __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; goto __pyx_L1;}
__pyx_k18 = __pyx_5;
__pyx_5 = 0;
Py_INCREF(Py_None);
__pyx_k19 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1078 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1128 */
Py_INCREF(Py_None);
__pyx_k20 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1087 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1137 */
Py_INCREF(Py_None);
__pyx_k21 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1109 */
- __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1159 */
+ __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;}
__pyx_k22 = __pyx_6;
__pyx_6 = 0;
Py_INCREF(Py_None);
__pyx_k23 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1137 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1187 */
Py_INCREF(Py_None);
__pyx_k24 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1166 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1216 */
Py_INCREF(Py_None);
__pyx_k25 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1204 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1254 */
Py_INCREF(Py_None);
__pyx_k26 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1284 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1334 */
Py_INCREF(Py_None);
__pyx_k27 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1326 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1376 */
Py_INCREF(Py_None);
__pyx_k28 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1335 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1385 */
Py_INCREF(Py_None);
__pyx_k29 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1358 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1408 */
Py_INCREF(Py_None);
__pyx_k30 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1453 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1503 */
Py_INCREF(Py_None);
__pyx_k31 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1542 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1592 */
Py_INCREF(Py_None);
__pyx_k32 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1641 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1691 */
Py_INCREF(Py_None);
__pyx_k33 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1664 */
- __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1714 */
+ __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;}
__pyx_k34 = __pyx_7;
__pyx_7 = 0;
- __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;}
+ __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;}
__pyx_k35 = __pyx_8;
__pyx_8 = 0;
Py_INCREF(Py_None);
__pyx_k36 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1703 */
- __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1753 */
+ __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; goto __pyx_L1;}
__pyx_k37 = __pyx_9;
__pyx_9 = 0;
- __pyx_10 = PyFloat_FromDouble(1.0); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;}
+ __pyx_10 = PyFloat_FromDouble(1.0); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; goto __pyx_L1;}
__pyx_k38 = __pyx_10;
__pyx_10 = 0;
Py_INCREF(Py_None);
__pyx_k39 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1827 */
- __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1877 */
+ __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; goto __pyx_L1;}
__pyx_k40 = __pyx_11;
__pyx_11 = 0;
- __pyx_12 = PyFloat_FromDouble(1.0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; goto __pyx_L1;}
+ __pyx_12 = PyFloat_FromDouble(1.0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; goto __pyx_L1;}
__pyx_k41 = __pyx_12;
__pyx_12 = 0;
Py_INCREF(Py_None);
__pyx_k42 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1851 */
- __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1901 */
+ __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; goto __pyx_L1;}
__pyx_k43 = __pyx_13;
__pyx_13 = 0;
- __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; goto __pyx_L1;}
+ __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; goto __pyx_L1;}
__pyx_k44 = __pyx_14;
__pyx_14 = 0;
Py_INCREF(Py_None);
__pyx_k45 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1982 */
- __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2032 */
+ __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; goto __pyx_L1;}
__pyx_k46 = __pyx_15;
__pyx_15 = 0;
Py_INCREF(Py_None);
__pyx_k47 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2006 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2056 */
Py_INCREF(Py_None);
__pyx_k48 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2036 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2086 */
Py_INCREF(Py_None);
__pyx_k49 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2075 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2125 */
Py_INCREF(Py_None);
__pyx_k50 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2109 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2159 */
Py_INCREF(Py_None);
__pyx_k51 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2146 */
- __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2196 */
+ __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2196; goto __pyx_L1;}
__pyx_k52 = __pyx_16;
__pyx_16 = 0;
Py_INCREF(Py_None);
__pyx_k53 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2168 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2218 */
Py_INCREF(Py_None);
__pyx_k54 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2260 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2310 */
Py_INCREF(Py_None);
__pyx_k55 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2326 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2376 */
Py_INCREF(Py_None);
__pyx_k56 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2373 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2423 */
Py_INCREF(Py_None);
__pyx_k57 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2401 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2451 */
Py_INCREF(Py_None);
__pyx_k58 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2534 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2584 */
Py_INCREF(Py_None);
__pyx_k59 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2627 */
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2677 */
Py_INCREF(Py_None);
__pyx_k60 = Py_None;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2791 */
- __pyx_17 = PyObject_CallObject(((PyObject *)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
- if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2841 */
+ __pyx_17 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2792 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2842 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2793 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2843 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2794 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2844 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2844; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2844; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2844; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2795 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2845 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2796 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2846 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2797 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2847 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2798 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2848 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2848; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2848; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2848; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2799 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2849 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2800 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2850 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2801 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2851 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2802 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2852 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2803 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2853 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2853; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2853; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2853; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2804 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2854 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2854; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2854; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2854; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2805 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2855 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2855; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2855; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2855; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2806 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2856 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2856; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2856; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2856; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2807 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2857 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2857; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2857; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2857; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2808 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2858 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2858; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2858; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2858; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2809 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2859 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2810 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2860 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2860; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2860; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2860; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2811 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2861 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2861; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2861; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2861; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2812 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2862 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2813 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2863 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2814 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2864 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2815 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2865 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2816 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2866 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2866; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2866; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2866; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2817 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2867 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2867; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2867; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2867; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2818 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2868 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2819 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2869 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2869; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2869; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2869; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2820 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2870 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2821 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2871 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2822 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2872 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2823 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2873 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2824 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2874 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2874; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2874; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2874; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2825 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2875 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2827 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2877 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2828 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2878 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2829 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2879 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2830 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2880 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2831 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2881 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2832 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2882 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2882; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2882; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2882; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2833 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2883 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2883; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2883; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2883; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2835 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2885 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2836 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2886 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2837 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2887 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2887; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2887; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2887; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2839 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2889 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2840 */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; goto __pyx_L1;}
+ /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2890 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
return;
__pyx_L1:;
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index abbe33fb3..1dd8b9f05 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -92,7 +92,7 @@ cdef extern from "distributions.h":
long rk_binomial(rk_state *state, long n, double p)
long rk_binomial_btpe(rk_state *state, long n, double p)
long rk_binomial_inversion(rk_state *state, long n, double p)
- long rk_negative_binomial(rk_state *state, long n, double p)
+ long rk_negative_binomial(rk_state *state, double n, double p)
long rk_poisson(rk_state *state, double lam)
long rk_poisson_mult(rk_state *state, double lam)
long rk_poisson_ptrs(rk_state *state, double lam)
@@ -108,6 +108,7 @@ ctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c)
ctypedef long (* rk_disc0)(rk_state *state)
ctypedef long (* rk_discnp)(rk_state *state, long n, double p)
+ctypedef long (* rk_discdd)(rk_state *state, double n, double p)
ctypedef long (* rk_discnmN)(rk_state *state, long n, long m, long N)
ctypedef long (* rk_discd)(rk_state *state, double a)
@@ -355,6 +356,55 @@ cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray o
return array
+cdef object discdd_array_sc(rk_state *state, rk_discdd func, object size, double n, double p):
+ cdef long *array_data
+ cdef ndarray array "arrayObject"
+ cdef long length
+ cdef long i
+
+ if size is None:
+ return func(state, n, p)
+ else:
+ array = <ndarray>np.empty(size, int)
+ length = PyArray_SIZE(array)
+ array_data = <long *>array.data
+ for i from 0 <= i < length:
+ array_data[i] = func(state, n, p)
+ return array
+
+cdef object discdd_array(rk_state *state, rk_discdd func, object size, ndarray on, ndarray op):
+ cdef long *array_data
+ cdef ndarray array "arrayObject"
+ cdef npy_intp length
+ cdef npy_intp i
+ cdef double *op_data
+ cdef double *on_data
+ cdef broadcast multi
+
+ if size is None:
+ multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op)
+ array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
+ array_data = <long *>array.data
+ for i from 0 <= i < multi.size:
+ on_data = <double *>PyArray_MultiIter_DATA(multi, 0)
+ op_data = <double *>PyArray_MultiIter_DATA(multi, 1)
+ array_data[i] = func(state, on_data[0], op_data[0])
+ PyArray_MultiIter_NEXT(multi)
+ else:
+ array = <ndarray>np.empty(size, int)
+ array_data = <long *>array.data
+ multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
+ if (multi.size != PyArray_SIZE(array)):
+ raise ValueError("size is not compatible with inputs")
+ for i from 0 <= i < multi.size:
+ on_data = <double *>PyArray_MultiIter_DATA(multi, 1)
+ op_data = <double *>PyArray_MultiIter_DATA(multi, 2)
+ array_data[i] = func(state, on_data[0], op_data[0])
+ PyArray_MultiIter_NEXTi(multi, 1)
+ PyArray_MultiIter_NEXTi(multi, 2)
+
+ return array
+
cdef object discnmN_array_sc(rk_state *state, rk_discnmN func, object size,
long n, long m, long N):
cdef long *array_data
@@ -2115,24 +2165,24 @@ cdef class RandomState:
"""
cdef ndarray on
cdef ndarray op
- cdef long ln
+ cdef double fn
cdef double fp
fp = PyFloat_AsDouble(p)
- ln = PyInt_AsLong(n)
+ fn = PyFloat_AsDouble(n)
if not PyErr_Occurred():
- if ln <= 0:
+ if fn <= 0:
raise ValueError("n <= 0")
if fp < 0:
raise ValueError("p < 0")
elif fp > 1:
raise ValueError("p > 1")
- return discnp_array_sc(self.internal_state, rk_negative_binomial,
- size, ln, fp)
+ return discdd_array_sc(self.internal_state, rk_negative_binomial,
+ size, fn, fp)
PyErr_Clear()
- on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED)
+ on = <ndarray>PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ALIGNED)
op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
if np.any(np.less_equal(n, 0)):
raise ValueError("n <= 0")
@@ -2140,7 +2190,7 @@ cdef class RandomState:
raise ValueError("p < 0")
if np.any(np.greater(p, 1)):
raise ValueError("p > 1")
- return discnp_array(self.internal_state, rk_negative_binomial, size,
+ return discdd_array(self.internal_state, rk_negative_binomial, size,
on, op)
def poisson(self, lam=1.0, size=None):
@@ -2382,19 +2432,19 @@ cdef class RandomState:
fp = PyFloat_AsDouble(p)
if not PyErr_Occurred():
- if fp < 0.0:
- raise ValueError("p < 0.0")
- if fp > 1.0:
- raise ValueError("p > 1.0")
+ if fp <= 0.0:
+ raise ValueError("p <= 0.0")
+ if fp >= 1.0:
+ raise ValueError("p >= 1.0")
return discd_array_sc(self.internal_state, rk_logseries, size, fp)
PyErr_Clear()
op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- if np.any(np.less(op, 0.0)):
- raise ValueError("p < 0.0")
- if np.any(np.greater(op, 1.0)):
- raise ValueError("p > 1.0")
+ if np.any(np.less_equal(op, 0.0)):
+ raise ValueError("p <= 0.0")
+ if np.any(np.greater_equal(op, 1.0)):
+ raise ValueError("p >= 1.0")
return discd_array(self.internal_state, rk_logseries, size, op)
# Multivariate distributions:
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index a665ff423..8dae16fcb 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -60,6 +60,12 @@ class TestSetState(TestCase):
assert np.all(x1 == x2)
assert np.all(x1 == x3)
+ def test_negative_binomial(self):
+ """ Ensure that the negative binomial results take floating point
+ arguments without truncation.
+ """
+ self.prng.negative_binomial(0.5, 0.5)
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/setup.py b/numpy/setup.py
index c081c9c44..4cc7f6f37 100644
--- a/numpy/setup.py
+++ b/numpy/setup.py
@@ -15,7 +15,6 @@ def configuration(parent_package='',top_path=None):
config.add_subpackage('random')
config.add_subpackage('ma')
config.add_subpackage('doc')
- config.add_subpackage('doc/reference')
config.add_data_dir('doc')
config.add_data_dir('tests')
config.make_config_py() # installs __config__.py
diff --git a/numpy/testing/decorators.py b/numpy/testing/decorators.py
index 77871d339..5d8f863d2 100644
--- a/numpy/testing/decorators.py
+++ b/numpy/testing/decorators.py
@@ -83,12 +83,41 @@ def skipif(skip_condition, msg=None):
return nose.tools.make_decorator(f)(skipper)
return skip_decorator
-def skipknownfailure(f):
- ''' Decorator to raise SkipTest for test known to fail
+def knownfailureif(skip_condition, msg=None):
+ ''' Make function raise KnownFailureTest exception if skip_condition is true
+
+ Parameters
+ ---------
+ skip_condition : bool
+ Flag to determine whether to mark test as known failure (True)
+ or not (False)
+ msg : string
+ Message to give on raising a KnownFailureTest exception
+
+ Returns
+ -------
+ decorator : function
+ Decorator, which, when applied to a function, causes SkipTest
+ to be raised when the skip_condition was True, and the function
+ to be called normally otherwise.
+
+ Notes
+ -----
+ You will see from the code that we had to further decorate the
+ decorator with the nose.tools.make_decorator function in order to
+ transmit function name, and various other metadata.
'''
- # Local import to avoid a hard nose dependency and only incur the
- # import time overhead at actual test-time.
- import nose
- def skipper(*args, **kwargs):
- raise nose.SkipTest, 'This test is known to fail'
- return nose.tools.make_decorator(f)(skipper)
+ if msg is None:
+ msg = 'Test skipped due to known failure'
+ def skip_decorator(f):
+ # Local import to avoid a hard nose dependency and only incur the
+ # import time overhead at actual test-time.
+ import nose
+ from noseclasses import KnownFailureTest
+ def skipper(*args, **kwargs):
+ if skip_condition:
+ raise KnownFailureTest, msg
+ else:
+ return f(*args, **kwargs)
+ return nose.tools.make_decorator(f)(skipper)
+ return skip_decorator
diff --git a/numpy/testing/noseclasses.py b/numpy/testing/noseclasses.py
index 68b9dff8f..d838a5f84 100644
--- a/numpy/testing/noseclasses.py
+++ b/numpy/testing/noseclasses.py
@@ -7,8 +7,9 @@ import os
import doctest
from nose.plugins import doctests as npd
+from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
from nose.plugins.base import Plugin
-from nose.util import src, tolist
+from nose.util import src, getpackage
import numpy
from nosetester import get_package_name
import inspect
@@ -16,14 +17,14 @@ import inspect
_doctest_ignore = ['generate_numpy_api.py', 'scons_support.py',
'setupscons.py', 'setup.py']
-# All the classes in this module begin with 'numpy' to clearly distinguish them
-# from the plethora of very similar names from nose/unittest/doctest
+# Some of the classes in this module begin with 'Numpy' to clearly distinguish
+# them from the plethora of very similar names from nose/unittest/doctest
#-----------------------------------------------------------------------------
# Modified version of the one in the stdlib, that fixes a python bug (doctests
# not found in extension modules, http://bugs.python.org/issue3158)
-class numpyDocTestFinder(doctest.DocTestFinder):
+class NumpyDocTestFinder(doctest.DocTestFinder):
def _from_module(self, module, object):
"""
@@ -78,10 +79,11 @@ class numpyDocTestFinder(doctest.DocTestFinder):
# doctests in extension modules.
# Local shorthands
- from inspect import isroutine, isclass, ismodule
+ from inspect import isroutine, isclass, ismodule, isfunction, \
+ ismethod
# Look for tests in a module's contained objects.
- if inspect.ismodule(obj) and self._recurse:
+ if ismodule(obj) and self._recurse:
for valname, val in obj.__dict__.items():
valname1 = '%s.%s' % (name, valname)
if ( (isroutine(val) or isclass(val))
@@ -92,7 +94,7 @@ class numpyDocTestFinder(doctest.DocTestFinder):
# Look for tests in a class's contained objects.
- if inspect.isclass(obj) and self._recurse:
+ if isclass(obj) and self._recurse:
#print 'RECURSE into class:',obj # dbg
for valname, val in obj.__dict__.items():
#valname1 = '%s.%s' % (name, valname) # dbg
@@ -104,16 +106,15 @@ class numpyDocTestFinder(doctest.DocTestFinder):
val = getattr(obj, valname).im_func
# Recurse to methods, properties, and nested classes.
- if ((inspect.isfunction(val) or inspect.isclass(val) or
- inspect.ismethod(val) or
- isinstance(val, property)) and
+ if ((isfunction(val) or isclass(val) or
+ ismethod(val) or isinstance(val, property)) and
self._from_module(module, val)):
valname = '%s.%s' % (name, valname)
self._find(tests, val, valname, module, source_lines,
globs, seen)
-class numpyDocTestCase(npd.DocTestCase):
+class NumpyDocTestCase(npd.DocTestCase):
"""Proxy for DocTestCase: provides an address() method that
returns the correct address for the doctest case. Otherwise
acts as a proxy to the test case. To provide hints for address(),
@@ -137,7 +138,7 @@ class numpyDocTestCase(npd.DocTestCase):
# second-chance checker; if the default comparison doesn't
# pass, then see if the expected output string contains flags that
# tell us to ignore the output
-class numpyOutputChecker(doctest.OutputChecker):
+class NumpyOutputChecker(doctest.OutputChecker):
def check_output(self, want, got, optionflags):
ret = doctest.OutputChecker.check_output(self, want, got,
optionflags)
@@ -151,7 +152,7 @@ class numpyOutputChecker(doctest.OutputChecker):
# Subclass nose.plugins.doctests.DocTestCase to work around a bug in
# its constructor that blocks non-default arguments from being passed
# down into doctest.DocTestCase
-class numpyDocTestCase(npd.DocTestCase):
+class NumpyDocTestCase(npd.DocTestCase):
def __init__(self, test, optionflags=0, setUp=None, tearDown=None,
checker=None, obj=None, result_var='_'):
self._result_var = result_var
@@ -164,7 +165,7 @@ class numpyDocTestCase(npd.DocTestCase):
print_state = numpy.get_printoptions()
-class numpyDoctest(npd.Doctest):
+class NumpyDoctest(npd.Doctest):
name = 'numpydoctest' # call nosetests with --with-numpydoctest
enabled = True
@@ -174,8 +175,7 @@ class numpyDoctest(npd.Doctest):
def configure(self, options, config):
Plugin.configure(self, options, config)
self.doctest_tests = True
-# self.extension = tolist(options.doctestExtension)
- self.finder = numpyDocTestFinder()
+ self.finder = NumpyDocTestFinder()
self.parser = doctest.DocTestParser()
# Turn on whitespace normalization, set a minimal execution context
@@ -223,15 +223,12 @@ class numpyDoctest(npd.Doctest):
p2 = p[-1]
test.globs[p2] = __import__(pkg_name, test.globs, {}, [p2])
- print 'additional import for %s: from %s import %s' % (test.filename, p1, p2)
- print ' (%s): %r' % (pkg_name, test.globs[p2])
-
# always use whitespace and ellipsis options
optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
- yield numpyDocTestCase(test,
+ yield NumpyDocTestCase(test,
optionflags=optionflags,
- checker=numpyOutputChecker())
+ checker=NumpyOutputChecker())
# Add an afterContext method to nose.plugins.doctests.Doctest in order
@@ -246,3 +243,35 @@ class numpyDoctest(npd.Doctest):
if bn in _doctest_ignore:
return False
return npd.Doctest.wantFile(self, file)
+
+
+class KnownFailureTest(Exception):
+ '''Raise this exception to mark a test as a known failing test.'''
+ pass
+
+
+class KnownFailure(ErrorClassPlugin):
+ '''Plugin that installs a KNOWNFAIL error class for the
+ KnownFailureClass exception. When KnownFailureTest is raised,
+ the exception will be logged in the knownfail attribute of the
+ result, 'K' or 'KNOWNFAIL' (verbose) will be output, and the
+ exception will not be counted as an error or failure.'''
+ enabled = True
+ knownfail = ErrorClass(KnownFailureTest,
+ label='KNOWNFAIL',
+ isfailure=False)
+
+ def options(self, parser, env=os.environ):
+ env_opt = 'NOSE_WITHOUT_KNOWNFAIL'
+ parser.add_option('--no-knownfail', action='store_true',
+ dest='noKnownFail', default=env.get(env_opt, False),
+ help='Disable special handling of KnownFailureTest '
+ 'exceptions')
+
+ def configure(self, options, conf):
+ if not self.can_configure:
+ return
+ self.conf = conf
+ disable = getattr(options, 'noKnownFail', False)
+ if disable:
+ self.enabled = False
diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py
index ed46681e1..bd4c78308 100644
--- a/numpy/testing/nosetester.py
+++ b/numpy/testing/nosetester.py
@@ -62,6 +62,9 @@ def run_module_suite(file_to_run = None):
# contructs NoseTester method docstrings
def _docmethod(meth, testtype):
+ if not meth.__doc__:
+ return
+
test_header = \
'''Parameters
----------
@@ -144,6 +147,24 @@ class NoseTester(object):
argv += extra_argv
return argv
+ def _show_system_info(self):
+ nose = import_nose()
+
+ import numpy
+ print "NumPy version %s" % numpy.__version__
+ npdir = os.path.dirname(numpy.__file__)
+ print "NumPy is installed in %s" % npdir
+
+ if 'scipy' in self.package_name:
+ import scipy
+ print "SciPy version %s" % scipy.__version__
+ spdir = os.path.dirname(scipy.__file__)
+ print "SciPy is installed in %s" % spdir
+
+ pyversion = sys.version.replace('\n','')
+ print "Python version %s" % pyversion
+ print "nose version %d.%d.%d" % nose.__versioninfo__
+
def test(self, label='fast', verbose=1, extra_argv=None, doctests=False,
coverage=False, **kwargs):
@@ -216,22 +237,9 @@ class NoseTester(object):
argv += ['--exclude','swig_ext']
argv += ['--exclude','array_from_pyobj']
- nose = import_nose()
-
- import numpy
- print "NumPy version %s" % numpy.__version__
- npdir = os.path.dirname(numpy.__file__)
- print "NumPy is installed in %s" % npdir
-
- if 'scipy' in self.package_name:
- import scipy
- print "SciPy version %s" % scipy.__version__
- spdir = os.path.dirname(scipy.__file__)
- print "SciPy is installed in %s" % spdir
+ self._show_system_info()
- pyversion = sys.version.replace('\n','')
- print "Python version %s" % pyversion
- print "nose version %d.%d.%d" % nose.__versioninfo__
+ nose = import_nose()
# Because nose currently discards the test result object, but we need
# to return it to the user, override TestProgram.runTests to retain
@@ -258,8 +266,8 @@ class NoseTester(object):
# construct list of plugins, omitting the existing doctest plugin
import nose.plugins.builtin
- from noseclasses import numpyDoctest
- plugins = [numpyDoctest()]
+ from noseclasses import NumpyDoctest, KnownFailure
+ plugins = [NumpyDoctest(), KnownFailure()]
for p in nose.plugins.builtin.plugins:
plug = p()
if plug.name == 'doctest':
@@ -274,6 +282,10 @@ class NoseTester(object):
''' Run benchmarks for module using nose
%(test_header)s'''
+
+ print "Running benchmarks for %s" % self.package_name
+ self._show_system_info()
+
nose = import_nose()
argv = self._test_argv(label, verbose, extra_argv)
argv += ['--match', r'(?:^|[\\b_\\.%s-])[Bb]ench' % os.sep]
diff --git a/numpy/testing/parametric.py b/numpy/testing/parametric.py
index 7ff68f260..27b9d23c6 100644
--- a/numpy/testing/parametric.py
+++ b/numpy/testing/parametric.py
@@ -40,6 +40,7 @@ unittest itself changes in the future. I have only tested this with Python
__docformat__ = "restructuredtext en"
import unittest
+import warnings
class _ParametricTestCase(unittest.TestCase):
"""TestCase subclass with support for parametric tests.
@@ -59,6 +60,11 @@ class _ParametricTestCase(unittest.TestCase):
#: to mutate the state you are using, which will alter later tests).
_shareParTestPrefix = 'testsp'
+ def __init__(self, methodName = 'runTest'):
+ warnings.warn("ParametricTestCase will be removed in the next NumPy "
+ "release", DeprecationWarning)
+ unittest.TestCase.__init__(self, methodName)
+
def exec_test(self,test,args,result):
"""Execute a single test. Returns a success boolean"""
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index 2d42e0a9a..275e34b2c 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -7,14 +7,12 @@ class _GenericTest(object):
self._assert_func(a, b)
def _test_not_equal(self, a, b):
- passed = False
try:
self._assert_func(a, b)
passed = True
except AssertionError:
pass
-
- if passed:
+ else:
raise AssertionError("a and b are found equal but are not")
def test_array_rank1_eq(self):
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index f28a6dd68..35373734d 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -162,10 +162,12 @@ def assert_equal(actual,desired,err_msg='',verbose=True):
"""
if isinstance(desired, dict):
- assert isinstance(actual, dict), repr(type(actual))
+ if not isinstance(actual, dict) :
+ raise AssertionError(repr(type(actual)))
assert_equal(len(actual),len(desired),err_msg,verbose)
for k,i in desired.items():
- assert k in actual, repr(k)
+ if k not in actual :
+ raise AssertionError(repr(k))
assert_equal(actual[k], desired[k], 'key=%r\n%s' % (k,err_msg), verbose)
return
if isinstance(desired, (list,tuple)) and isinstance(actual, (list,tuple)):
@@ -177,7 +179,8 @@ def assert_equal(actual,desired,err_msg='',verbose=True):
if isinstance(actual, ndarray) or isinstance(desired, ndarray):
return assert_array_equal(actual, desired, err_msg, verbose)
msg = build_err_msg([actual, desired], err_msg, verbose=verbose)
- assert desired == actual, msg
+ if desired != actual :
+ raise AssertionError(msg)
def print_assert_equal(test_string,actual,desired):
import pprint
@@ -191,7 +194,7 @@ def print_assert_equal(test_string,actual,desired):
pprint.pprint(actual,msg)
msg.write('DESIRED: \n')
pprint.pprint(desired,msg)
- raise AssertionError, msg.getvalue()
+ raise AssertionError(msg.getvalue())
def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True):
""" Raise an assertion if two items are not equal.
@@ -204,7 +207,8 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True):
if isinstance(actual, ndarray) or isinstance(desired, ndarray):
return assert_array_almost_equal(actual, desired, decimal, err_msg)
msg = build_err_msg([actual, desired], err_msg, verbose=verbose)
- assert round(abs(desired - actual),decimal) == 0, msg
+ if round(abs(desired - actual),decimal) != 0 :
+ raise AssertionError(msg)
def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True):
@@ -231,12 +235,12 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True):
header='Items are not equal to %d significant digits:' %
significant,
verbose=verbose)
- assert math.fabs(sc_desired - sc_actual) < pow(10.,-(significant-1)), msg
+ if math.fabs(sc_desired - sc_actual) >= pow(10.,-(significant-1)) :
+ raise AssertionError(msg)
def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
header=''):
from numpy.core import asarray, isnan, any
- from numpy import isreal, iscomplex
x = asarray(x)
y = asarray(y)
@@ -252,7 +256,8 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
y.shape),
verbose=verbose, header=header,
names=('x', 'y'))
- assert cond, msg
+ if not cond :
+ raise AssertionError(msg)
if (isnumber(x) and isnumber(y)) and (any(isnan(x)) or any(isnan(y))):
# Handling nan: we first check that x and y have the nan at the
@@ -286,7 +291,8 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
+ '\n(mismatch %s%%)' % (match,),
verbose=verbose, header=header,
names=('x', 'y'))
- assert cond, msg
+ if not cond :
+ raise AssertionError(msg)
except ValueError:
msg = build_err_msg([x, y], err_msg, verbose=verbose, header=header,
names=('x', 'y'))
@@ -315,8 +321,10 @@ def assert_string_equal(actual, desired):
# delay import of difflib to reduce startup time
import difflib
- assert isinstance(actual, str),`type(actual)`
- assert isinstance(desired, str),`type(desired)`
+ if not isinstance(actual, str) :
+ raise AssertionError(`type(actual)`)
+ if not isinstance(desired, str):
+ raise AssertionError(`type(desired)`)
if re.match(r'\A'+desired+r'\Z', actual, re.M): return
diff = list(difflib.Differ().compare(actual.splitlines(1), desired.splitlines(1)))
diff_list = []
@@ -330,7 +338,8 @@ def assert_string_equal(actual, desired):
if d2.startswith('? '):
l.append(d2)
d2 = diff.pop(0)
- assert d2.startswith('+ '),`d2`
+ if not d2.startswith('+ ') :
+ raise AssertionError(`d2`)
l.append(d2)
d3 = diff.pop(0)
if d3.startswith('? '):
@@ -341,10 +350,12 @@ def assert_string_equal(actual, desired):
continue
diff_list.extend(l)
continue
- assert False, `d1`
- if not diff_list: return
+ raise AssertionError(`d1`)
+ if not diff_list:
+ return
msg = 'Differences in strings:\n%s' % (''.join(diff_list)).rstrip()
- assert actual==desired, msg
+ if actual != desired :
+ raise AssertionError(msg)
def rundocs(filename=None):
@@ -430,7 +441,7 @@ def measure(code_str,times=1,label=None):
'exec')
i = 0
elapsed = jiffies()
- while i<times:
+ while i < times:
i += 1
exec code in globs,locs
elapsed = jiffies() - elapsed
diff --git a/numpy/tests/test_ctypeslib.py b/numpy/tests/test_ctypeslib.py
index f17860db4..aad6c96af 100644
--- a/numpy/tests/test_ctypeslib.py
+++ b/numpy/tests/test_ctypeslib.py
@@ -1,8 +1,11 @@
+import sys
+
import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.testing import *
class TestLoadLibrary(TestCase):
+ @dec.knownfailureif(sys.platform=='cygwin', "This test is known to fail on cygwin")
def test_basic(self):
try:
cdll = load_library('multiarray',
@@ -12,6 +15,7 @@ class TestLoadLibrary(TestCase):
" (import error was: %s)" % str(e)
print msg
+ @dec.knownfailureif(sys.platform=='cygwin', "This test is known to fail on cygwin")
def test_basic2(self):
"""Regression for #801: load_library with a full library name
(including extension) does not work."""
diff --git a/numpy/version.py b/numpy/version.py
index 3e9a3e8de..7a83d6daf 100644
--- a/numpy/version.py
+++ b/numpy/version.py
@@ -1,4 +1,4 @@
-version='1.2.0'
+version='1.3.0'
release=False
if not release: